diff --git a/data/sql/updates/pending_db_characters/rev_1781860213893615800.sql b/data/sql/updates/pending_db_characters/rev_1781860213893615800.sql new file mode 100644 index 000000000..151857799 --- /dev/null +++ b/data/sql/updates/pending_db_characters/rev_1781860213893615800.sql @@ -0,0 +1,53 @@ +DELETE FROM `mail_server_template` WHERE `id` IN (14646, 14647, 14648, 14649, 14650, 14651, 20938, 22888, 39713); +INSERT INTO `mail_server_template` (`id`, `senderEntry`, `moneyA`, `moneyH`, `subject`, `body`, `active`) VALUES +(14646, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(14647, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(14648, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(14649, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(14650, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(14651, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(20938, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(22888, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1), +(39713, 19506, 0, 0, 'A Very Special Delivery', 'Thank you for your purchase of the World of Warcraft Collector''s Edition! As a special gift of appreciation, we would like to present you with this gift voucher. Turn it in to receive a little companion to join you on your quest for adventure and glory!', 1); + +DELETE FROM `mail_server_template_items` WHERE `templateID` IN (14646, 14647, 14648, 14649, 14650, 14651, 20938, 22888, 39713); +INSERT INTO `mail_server_template_items` (`templateID`, `faction`, `item`, `itemCount`) VALUES +(14646, 'Alliance', 14646, 1), -- Goldshire Gift Voucher (Human) +(14647, 'Alliance', 14647, 1), -- Kharanos Gift Voucher (Dwarf, Gnome) +(14648, 'Alliance', 14648, 1), -- Dolanaar Gift Voucher (Night Elf) +(14649, 'Horde', 14649, 1), -- Razor Hill Gift Voucher (Orc, Troll) +(14650, 'Horde', 14650, 1), -- Bloodhoof Village Gift Voucher (Tauren) +(14651, 'Horde', 14651, 1), -- Brill Gift Voucher (Undead) +(20938, 'Horde', 20938, 1), -- Falconwing Square Gift Voucher (Blood Elf) +(22888, 'Alliance', 22888, 1), -- Azure Watch Gift Voucher (Draenei) +(39713, 'Alliance', 39713, 1), -- Ebon Hold Gift Voucher (Death Knight, Alliance) +(39713, 'Horde', 39713, 1); -- Ebon Hold Gift Voucher (Death Knight, Horde) + +DELETE FROM `mail_server_template_conditions` WHERE `templateID` IN (14646, 14647, 14648, 14649, 14650, 14651, 20938, 22888, 39713); +INSERT INTO `mail_server_template_conditions` (`templateID`, `conditionType`, `conditionValue`) VALUES +(14646, 'Race', 1), +(14646, 'Class', 1503), +(14646, 'AccountFlags', 4), +(14647, 'Race', 68), +(14647, 'Class', 1503), +(14647, 'AccountFlags', 4), +(14648, 'Race', 8), +(14648, 'Class', 1503), +(14648, 'AccountFlags', 4), +(14649, 'Race', 130), +(14649, 'Class', 1503), +(14649, 'AccountFlags', 4), +(14650, 'Race', 32), +(14650, 'Class', 1503), +(14650, 'AccountFlags', 4), +(14651, 'Race', 16), +(14651, 'Class', 1503), +(14651, 'AccountFlags', 4), +(20938, 'Race', 512), +(20938, 'Class', 1503), +(20938, 'AccountFlags', 4), +(22888, 'Race', 1024), +(22888, 'Class', 1503), +(22888, 'AccountFlags', 4), +(39713, 'Class', 32), +(39713, 'AccountFlags', 4); diff --git a/src/common/Common.h b/src/common/Common.h index 264b06ca9..e551dbacd 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -66,7 +66,7 @@ enum AccountFlag { ACCOUNT_FLAG_GM = 0x1, // Account is GM ACCOUNT_FLAG_NOKICK = 0x2, // Will not be logged out while AFK - ACCOUNT_FLAG_COLLECTOR = 0x4, // NYI Collector's Edition + ACCOUNT_FLAG_COLLECTOR = 0x4, // Collector's Edition ACCOUNT_FLAG_TRIAL = 0x8, // Trial account ACCOUNT_FLAG_CANCELLED = 0x10, // NYI UNK ACCOUNT_FLAG_IGR = 0x20, // NYI Internet Game Room (Internet cafe?) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 49ab2e722..daa4ba995 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -666,6 +666,52 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo for (PlayerCreateInfoItems::const_iterator item_id_itr = info->item.begin(); item_id_itr != info->item.end(); ++item_id_itr) StoreNewItemInBestSlots(item_id_itr->item_id, item_id_itr->item_amount); + // Collector's Edition starter gift voucher + if (GetSession()->HasAccountFlag(ACCOUNT_FLAG_COLLECTOR)) + { + uint32 voucherId = 0; + if (IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_INIT)) + voucherId = 39713; // Ebon Hold Gift Voucher + else + { + switch (createInfo->Race) + { + case RACE_HUMAN: + voucherId = 14646; break; // Goldshire Gift Voucher + case RACE_DWARF: + case RACE_GNOME: + voucherId = 14647; break; // Kharanos Gift Voucher + case RACE_NIGHTELF: + voucherId = 14648; break; // Dolanaar Gift Voucher + case RACE_ORC: + case RACE_TROLL: + voucherId = 14649; break; // Razor Hill Gift Voucher + case RACE_TAUREN: + voucherId = 14650; break; // Bloodhoof Village Gift Voucher + case RACE_UNDEAD_PLAYER: + voucherId = 14651; break; // Brill Gift Voucher + case RACE_BLOODELF: + voucherId = 20938; break; // Falconwing Square Gift Voucher + case RACE_DRAENEI: + voucherId = 22888; break; // Azure Watch Gift Voucher + default: + break; + } + } + + // Only guard against mail delivery if the item was actually stored, otherwise + // a full bag would suppress the mail fallback and lose the voucher permanently. + if (voucherId && StoreNewItemInBestSlots(voucherId, 1)) + { + // Prevent characters from receiving duplicate vouchers through the mail system. + // voucherId doubles as the mail template id (item == templateID in the SQL data). + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_MAIL_SERVER_CHARACTER); + stmt->SetData(0, guidlow); + stmt->SetData(1, voucherId); + CharacterDatabase.Execute(stmt); + } + } + // bags and main-hand weapon must equipped at this moment // now second pass for not equipped (offhand weapon/shield if it attempt equipped before main-hand weapon) // or ammo not equipped in special bag