From bf2c3fd8cf32578324162a8bef2ac6e48e7e0009 Mon Sep 17 00:00:00 2001 From: win32 Date: Wed, 16 Dec 2009 18:58:36 +0200 Subject: MaNGOS merge: Mail System. * Store loot in mail_loot_template indexed by mail template ids. * Implement proper creating mail text copy item from mail template based mail. * Move send functions to new MailDraft class from WorldSession. * Implement mails sending at player levelup. * Autor VladimirMangos, converted by me. --HG-- branch : trunk --- sql/updates/6521_world_command.sql | 1 + sql/updates/6521_world_mail_level_reward.sql | 15 ++++++ .../6521_world_quest_mail_loot_template.sql | 4 ++ sql/world.sql | 55 +++++++++++++--------- 4 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 sql/updates/6521_world_command.sql create mode 100644 sql/updates/6521_world_mail_level_reward.sql create mode 100644 sql/updates/6521_world_quest_mail_loot_template.sql (limited to 'sql') diff --git a/sql/updates/6521_world_command.sql b/sql/updates/6521_world_command.sql new file mode 100644 index 00000000000..11bb1c404ce --- /dev/null +++ b/sql/updates/6521_world_command.sql @@ -0,0 +1 @@ +UPDATE `command` SET `name`='reload mail_loot_template' WHERE `name`='reload quest_mail_loot_template'; \ No newline at end of file diff --git a/sql/updates/6521_world_mail_level_reward.sql b/sql/updates/6521_world_mail_level_reward.sql new file mode 100644 index 00000000000..656bb83c69c --- /dev/null +++ b/sql/updates/6521_world_mail_level_reward.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS `mail_level_reward`; +CREATE TABLE `mail_level_reward` ( + `level` tinyint(3) unsigned NOT NULL default '0', + `raceMask` mediumint(8) unsigned NOT NULL default '0', + `mailTemplateId` mediumint(8) unsigned NOT NULL default '0', + `senderEntry` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`level`,`raceMask`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Mail System'; + +INSERT INTO `mail_level_reward` VALUES +(20, 1, 224, 4732),(20, 8, 225, 4753), +(20, 4, 226, 4772),(20, 1024, 227, 20914), +(20, 64, 228, 7954),(20, 32, 229, 3690), +(20, 128, 230, 7953),(20, 2, 231, 4752), +(20, 512, 232, 16280),(20, 16, 233, 4773); \ No newline at end of file diff --git a/sql/updates/6521_world_quest_mail_loot_template.sql b/sql/updates/6521_world_quest_mail_loot_template.sql new file mode 100644 index 00000000000..08ebe03eca4 --- /dev/null +++ b/sql/updates/6521_world_quest_mail_loot_template.sql @@ -0,0 +1,4 @@ +RENAME TABLE quest_mail_loot_template TO mail_loot_template; + +UPDATE mail_loot_template, quest_template + SET mail_loot_template.entry = quest_template.RewMailTemplateId WHERE mail_loot_template.entry = quest_template.entry; \ No newline at end of file diff --git a/sql/world.sql b/sql/world.sql index 3907d139b01..d8a20c724b0 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -1813,6 +1813,40 @@ CREATE TABLE `locales_quest` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; +-- +-- Table structure for table `mail_level_reward` +-- + +DROP TABLE IF EXISTS `mail_level_reward`; +CREATE TABLE `mail_level_reward` ( + `level` tinyint(3) unsigned NOT NULL default '0', + `raceMask` mediumint(8) unsigned NOT NULL default '0', + `mailTemplateId` mediumint(8) unsigned NOT NULL default '0', + `senderEntry` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`level`,`raceMask`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Mail System'; + +-- +-- Table structure for table `mail_loot_template` +-- + +DROP TABLE IF EXISTS `mail_loot_template`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +CREATE TABLE `mail_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `milling_loot_template` -- @@ -2379,27 +2413,6 @@ CREATE TABLE `quest_end_scripts` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; --- --- Table structure for table `quest_mail_loot_template` --- - -DROP TABLE IF EXISTS `quest_mail_loot_template`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -CREATE TABLE `quest_mail_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `quest_start_scripts` -- -- cgit v1.2.3