diff options
author | Duarte Duarte <dnpd.dd@gmail.com> | 2015-09-02 07:20:20 -0700 |
---|---|---|
committer | Duarte Duarte <dnpd.dd@gmail.com> | 2015-09-02 07:20:20 -0700 |
commit | 139598a07edd4179d8b8c52e2088bea0826db794 (patch) | |
tree | fb87b8eab38c7bc7ee7ae05a5db45d6527f62a4f | |
parent | e28ee386641d4f28b7997e057c4d4450c55186a3 (diff) | |
parent | bc67016e7bfe8ffcd7220897c44e4d49d1392834 (diff) |
Merge pull request #15384 from ShinDarth/quest_backports2
DB/World schema backport: sort some quest_template fields using 6.x style
-rw-r--r-- | sql/updates/world/2015_08_29_01_world_335.sql | 28 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 14 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 28 |
3 files changed, 47 insertions, 23 deletions
diff --git a/sql/updates/world/2015_08_29_01_world_335.sql b/sql/updates/world/2015_08_29_01_world_335.sql new file mode 100644 index 00000000000..c2454f69c0c --- /dev/null +++ b/sql/updates/world/2015_08_29_01_world_335.sql @@ -0,0 +1,28 @@ +-- RewardItem(s) and RewardAmount(s) [4x2 fields] +ALTER TABLE `quest_template` + CHANGE COLUMN `RewardAmount1` `RewardAmount1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardItem1`, + CHANGE COLUMN `RewardAmount2` `RewardAmount2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardItem2`, + CHANGE COLUMN `RewardAmount3` `RewardAmount3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardItem3`, + CHANGE COLUMN `RewardAmount4` `RewardAmount4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardItem4`; + +-- RewardChoiceItemID(s) and RewardChoiceItemQuantity(s) [6x2 fields] +ALTER TABLE `quest_template` + CHANGE COLUMN `RewardChoiceItemQuantity1` `RewardChoiceItemQuantity1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID1`, + CHANGE COLUMN `RewardChoiceItemQuantity2` `RewardChoiceItemQuantity2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID2`, + CHANGE COLUMN `RewardChoiceItemQuantity3` `RewardChoiceItemQuantity3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID3`, + CHANGE COLUMN `RewardChoiceItemQuantity4` `RewardChoiceItemQuantity4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID4`, + CHANGE COLUMN `RewardChoiceItemQuantity5` `RewardChoiceItemQuantity5` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID5`, + CHANGE COLUMN `RewardChoiceItemQuantity6` `RewardChoiceItemQuantity6` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardChoiceItemID6`; + +-- RewardFactionID(s), RewardFactionValue(s) and RewardFactionOverride(s) [5x3 fields] +ALTER TABLE `quest_template` + CHANGE COLUMN `RewardFactionValue1` `RewardFactionValue1` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionID1`, + CHANGE COLUMN `RewardFactionOverride1` `RewardFactionOverride1` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionValue1`, + CHANGE COLUMN `RewardFactionValue2` `RewardFactionValue2` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionID2`, + CHANGE COLUMN `RewardFactionOverride2` `RewardFactionOverride2` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionValue2`, + CHANGE COLUMN `RewardFactionValue3` `RewardFactionValue3` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionID3`, + CHANGE COLUMN `RewardFactionOverride3` `RewardFactionOverride3` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionValue3`, + CHANGE COLUMN `RewardFactionValue4` `RewardFactionValue4` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionID4`, + CHANGE COLUMN `RewardFactionOverride4` `RewardFactionOverride4` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionValue4`, + CHANGE COLUMN `RewardFactionValue5` `RewardFactionValue5` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionID5`, + CHANGE COLUMN `RewardFactionOverride5` `RewardFactionOverride5` MEDIUMINT(8) NOT NULL DEFAULT '0' AFTER `RewardFactionValue5`; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 4cb1116d2fd..a568409d918 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3974,14 +3974,12 @@ void ObjectMgr::LoadQuests() "NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, " // 21 22 23 24 25 26 "SourceItemId, Flags, RewardTitle, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " - // 27 28 29 30 31 32 33 34 - "RewardItem1, RewardItem2, RewardItem3, RewardItem4, RewardAmount1, RewardAmount2, RewardAmount3, RewardAmount4, " - // 35 36 37 38 39 40 41 42 43 44 45 46 - "RewardChoiceItemID1, RewardChoiceItemID2, RewardChoiceItemID3, RewardChoiceItemID4, RewardChoiceItemID5, RewardChoiceItemID6, RewardChoiceItemQuantity1, RewardChoiceItemQuantity2, RewardChoiceItemQuantity3, RewardChoiceItemQuantity4, RewardChoiceItemQuantity5, RewardChoiceItemQuantity6, " - // 47 48 49 50 51 52 53 54 55 56 - "RewardFactionID1, RewardFactionID2, RewardFactionID3, RewardFactionID4, RewardFactionID5, RewardFactionValue1, RewardFactionValue2, RewardFactionValue3, RewardFactionValue4, RewardFactionValue5, " - // 57 58 59 60 61 - "RewardFactionOverride1, RewardFactionOverride2, RewardFactionOverride3, RewardFactionOverride4, RewardFactionOverride5, " + // 27 28 29 30 31 32 33 34 + "RewardItem1, RewardAmount1, RewardItem2, RewardAmount2, RewardItem3, RewardAmount3, RewardItem4, RewardAmount4, " + // 35 36 37 38 39 40 41 42 43 44 45 46 + "RewardChoiceItemID1, RewardChoiceItemQuantity1, RewardChoiceItemID2, RewardChoiceItemQuantity2, RewardChoiceItemID3, RewardChoiceItemQuantity3, RewardChoiceItemID4, RewardChoiceItemQuantity4, RewardChoiceItemID5, RewardChoiceItemQuantity5, RewardChoiceItemID6, RewardChoiceItemQuantity6, " + // 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 + "RewardFactionID1, RewardFactionValue1, RewardFactionOverride1, RewardFactionID2, RewardFactionValue2, RewardFactionOverride2, RewardFactionID3, RewardFactionValue3, RewardFactionOverride3, RewardFactionID4, RewardFactionValue4, RewardFactionOverride4, RewardFactionID5, RewardFactionValue5, RewardFactionOverride5," // 62 63 64 65 "PointMapId, PointX, PointY, PointOption, " // 66 67 68 69 70 diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index ac9759d31cd..eea0fd72e8b 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -51,25 +51,23 @@ Quest::Quest(Field* questRecord) RewardArenaPoints = questRecord[26].GetUInt16(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemId[i] = questRecord[27+i].GetUInt32(); - - for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemIdCount[i] = questRecord[31+i].GetUInt16(); - - for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemId[i] = questRecord[35+i].GetUInt32(); + { + RewardItemId[i] = questRecord[27+i*2].GetUInt32(); + RewardItemIdCount[i] = questRecord[28+i*2].GetUInt16(); + } for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemCount[i] = questRecord[41+i].GetUInt16(); - - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[47+i].GetUInt16(); - - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueId[i] = questRecord[52+i].GetInt32(); + { + RewardChoiceItemId[i] = questRecord[35+i*2].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[36+i*2].GetUInt16(); + } for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueIdOverride[i] = questRecord[57+i].GetInt32(); + { + RewardFactionId[i] = questRecord[47+i*3].GetUInt16(); + RewardFactionValueId[i] = questRecord[48+i*3].GetInt32(); + RewardFactionValueIdOverride[i] = questRecord[49+i*3].GetInt32(); + } PointMapId = questRecord[62].GetUInt16(); PointX = questRecord[63].GetFloat(); |