diff options
author | Brian <runningnak3d@gmail.com> | 2010-03-02 09:59:59 -0700 |
---|---|---|
committer | Brian <runningnak3d@gmail.com> | 2010-03-02 09:59:59 -0700 |
commit | 29666451f3a616eaa1f50cb99d9379124b4bfe28 (patch) | |
tree | 07c1057db7c525c9cc8bfc0d819bc1284e6795e0 /src/game/ObjectMgr.cpp | |
parent | 0f4855d8f3b5fac8f9b01171e372df86df2e2ba0 (diff) |
* Add support for sending quest completion text
* Original patch by NoFantasy - thank you
* Ported to Trinity by seirgy - thank you
* Closes issue #873
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 895e651baef..6a4236b4932 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3518,40 +3518,41 @@ void ObjectMgr::LoadQuests() mExclusiveQuestGroups.clear(); - // 0 1 2 3 4 5 6 7 8 + // 0 1 2 3 4 5 6 7 8 QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClass, MinLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue," // 9 10 11 12 13 14 15 16 17 18 "RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime," - // 19 20 21 22 23 24 25 26 27 28 29 30 + // 19 20 21 22 23 24 25 26 27 28 29 30 31 "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell," - // 31 32 33 34 35 36 37 38 39 40 - "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," - // 41 42 43 44 45 46 47 48 49 50 51 52 + // 32 33 34 35 36 37 38 39 40 41 42 + "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," + // 43 44 45 46 47 48 49 50 51 52 53 54 "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6," - // 53 54 55 56 57 58 59 60 + // 55 56 57 58 59 60 61 62 "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4," - // 61 62 63 64 65 66 67 68 + // 63 64 65 66 67 68 69 70 "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4," - // 69 70 71 72 + // 71 72 73 74 "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4," - // 73 74 75 76 77 78 + // 75 76 77 78 79 80 "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6," - // 79 80 81 82 83 84 + // 81 82 83 84 85 86 "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6," - // 85 86 87 88 89 90 91 92 + // 87 88 89 90 91 92 93 94 "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4," - // 93 94 95 96 97 98 99 100 101 102 + // 95 96 97 98 99 100 101 102 103 104 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5," + // 105 106 107 108 109 "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," - // 103 104 105 106 107 108 109 110 111 112 113 + // 110 111 112 113 114 115 116 117 118 119 120 121 "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," - // 114 115 116 117 118 119 120 121 + // 122 123 124 125 126 127 128 129 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," - // 122 123 124 125 126 127 + // 130 131 132 133 134 135 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," - // 128 129 130 131 + // 136 137 138 139 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," - // 132 133 + // 140 141 "StartScript, CompleteScript" " FROM quest_template"); if(result == NULL) @@ -4192,14 +4193,14 @@ void ObjectMgr::LoadQuestLocales() mQuestLocaleMap.clear(); // need for reload case QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry," - "Title_loc1,Details_loc1,Objectives_loc1,OfferRewardText_loc1,RequestItemsText_loc1,EndText_loc1,ObjectiveText1_loc1,ObjectiveText2_loc1,ObjectiveText3_loc1,ObjectiveText4_loc1," - "Title_loc2,Details_loc2,Objectives_loc2,OfferRewardText_loc2,RequestItemsText_loc2,EndText_loc2,ObjectiveText1_loc2,ObjectiveText2_loc2,ObjectiveText3_loc2,ObjectiveText4_loc2," - "Title_loc3,Details_loc3,Objectives_loc3,OfferRewardText_loc3,RequestItemsText_loc3,EndText_loc3,ObjectiveText1_loc3,ObjectiveText2_loc3,ObjectiveText3_loc3,ObjectiveText4_loc3," - "Title_loc4,Details_loc4,Objectives_loc4,OfferRewardText_loc4,RequestItemsText_loc4,EndText_loc4,ObjectiveText1_loc4,ObjectiveText2_loc4,ObjectiveText3_loc4,ObjectiveText4_loc4," - "Title_loc5,Details_loc5,Objectives_loc5,OfferRewardText_loc5,RequestItemsText_loc5,EndText_loc5,ObjectiveText1_loc5,ObjectiveText2_loc5,ObjectiveText3_loc5,ObjectiveText4_loc5," - "Title_loc6,Details_loc6,Objectives_loc6,OfferRewardText_loc6,RequestItemsText_loc6,EndText_loc6,ObjectiveText1_loc6,ObjectiveText2_loc6,ObjectiveText3_loc6,ObjectiveText4_loc6," - "Title_loc7,Details_loc7,Objectives_loc7,OfferRewardText_loc7,RequestItemsText_loc7,EndText_loc7,ObjectiveText1_loc7,ObjectiveText2_loc7,ObjectiveText3_loc7,ObjectiveText4_loc7," - "Title_loc8,Details_loc8,Objectives_loc8,OfferRewardText_loc8,RequestItemsText_loc8,EndText_loc8,ObjectiveText1_loc8,ObjectiveText2_loc8,ObjectiveText3_loc8,ObjectiveText4_loc8" + "Title_loc1,Details_loc1,Objectives_loc1,OfferRewardText_loc1,RequestItemsText_loc1,EndText_loc1,CompletedText_loc1,ObjectiveText1_loc1,ObjectiveText2_loc1,ObjectiveText3_loc1,ObjectiveText4_loc1," + "Title_loc2,Details_loc2,Objectives_loc2,OfferRewardText_loc2,RequestItemsText_loc2,EndText_loc2,CompletedText_loc2,ObjectiveText1_loc2,ObjectiveText2_loc2,ObjectiveText3_loc2,ObjectiveText4_loc2," + "Title_loc3,Details_loc3,Objectives_loc3,OfferRewardText_loc3,RequestItemsText_loc3,EndText_loc3,CompletedText_loc3,ObjectiveText1_loc3,ObjectiveText2_loc3,ObjectiveText3_loc3,ObjectiveText4_loc3," + "Title_loc4,Details_loc4,Objectives_loc4,OfferRewardText_loc4,RequestItemsText_loc4,EndText_loc4,CompletedText_loc4,ObjectiveText1_loc4,ObjectiveText2_loc4,ObjectiveText3_loc4,ObjectiveText4_loc4," + "Title_loc5,Details_loc5,Objectives_loc5,OfferRewardText_loc5,RequestItemsText_loc5,EndText_loc5,CompletedText_loc5,ObjectiveText1_loc5,ObjectiveText2_loc5,ObjectiveText3_loc5,ObjectiveText4_loc5," + "Title_loc6,Details_loc6,Objectives_loc6,OfferRewardText_loc6,RequestItemsText_loc6,EndText_loc6,CompletedText_loc6,ObjectiveText1_loc6,ObjectiveText2_loc6,ObjectiveText3_loc6,ObjectiveText4_loc6," + "Title_loc7,Details_loc7,Objectives_loc7,OfferRewardText_loc7,RequestItemsText_loc7,EndText_loc7,CompletedText_loc7,ObjectiveText1_loc7,ObjectiveText2_loc7,ObjectiveText3_loc7,ObjectiveText4_loc7," + "Title_loc8,Details_loc8,Objectives_loc8,OfferRewardText_loc8,RequestItemsText_loc8,EndText_loc8,CompletedText_loc8,ObjectiveText1_loc8,ObjectiveText2_loc8,ObjectiveText3_loc8,ObjectiveText4_loc8" " FROM locales_quest" ); @@ -4219,7 +4220,7 @@ void ObjectMgr::LoadQuestLocales() for (uint8 i = 1; i < MAX_LOCALE; ++i) { - std::string str = fields[1+10*(i-1)].GetCppString(); + std::string str = fields[1+11*(i-1)].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4231,7 +4232,7 @@ void ObjectMgr::LoadQuestLocales() data.Title[idx] = str; } } - str = fields[1+10*(i-1)+1].GetCppString(); + str = fields[1+11*(i-1)+1].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4243,7 +4244,7 @@ void ObjectMgr::LoadQuestLocales() data.Details[idx] = str; } } - str = fields[1+10*(i-1)+2].GetCppString(); + str = fields[1+11*(i-1)+2].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4255,7 +4256,7 @@ void ObjectMgr::LoadQuestLocales() data.Objectives[idx] = str; } } - str = fields[1+10*(i-1)+3].GetCppString(); + str = fields[1+11*(i-1)+3].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4267,7 +4268,7 @@ void ObjectMgr::LoadQuestLocales() data.OfferRewardText[idx] = str; } } - str = fields[1+10*(i-1)+4].GetCppString(); + str = fields[1+11*(i-1)+4].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4279,7 +4280,7 @@ void ObjectMgr::LoadQuestLocales() data.RequestItemsText[idx] = str; } } - str = fields[1+10*(i-1)+5].GetCppString(); + str = fields[1+11*(i-1)+5].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -4291,9 +4292,22 @@ void ObjectMgr::LoadQuestLocales() data.EndText[idx] = str; } } + str = fields[1+11*(i-1)+6].GetCppString(); + if(!str.empty()) + { + int idx = GetOrNewIndexForLocale(LocaleConstant(i)); + if(idx >= 0) + { + if(data.CompletedText.size() <= idx) + data.CompletedText.resize(idx+1); + + data.CompletedText[idx] = str; + } + } + for (uint8 k = 0; k < 4; ++k) { - str = fields[1+10*(i-1)+6+k].GetCppString(); + str = fields[1+11*(i-1)+7+k].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); |