aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/GossipDef.cpp7
-rw-r--r--src/game/ObjectMgr.cpp78
-rw-r--r--src/game/QuestDef.cpp73
-rw-r--r--src/game/QuestDef.h3
4 files changed, 91 insertions, 70 deletions
diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp
index f35205a8c09..ae82c8b1a79 100644
--- a/src/game/GossipDef.cpp
+++ b/src/game/GossipDef.cpp
@@ -541,12 +541,13 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
{
- std::string Title,Details,Objectives,EndText;
+ std::string Title, Details, Objectives, EndText, CompletedText;
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
Title = pQuest->GetTitle();
Details = pQuest->GetDetails();
Objectives = pQuest->GetObjectives();
EndText = pQuest->GetEndText();
+ CompletedText = pQuest->GetCompletedText();
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i]=pQuest->ObjectiveText[i];
@@ -564,6 +565,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
Objectives=ql->Objectives[loc_idx];
if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty())
EndText=ql->EndText[loc_idx];
+ if (ql->CompletedText.size() > (size_t)loc_idx && !ql->CompletedText[loc_idx].empty())
+ CompletedText=ql->CompletedText[loc_idx];
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
if (ql->ObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty())
@@ -652,7 +655,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << Objectives;
data << Details;
data << EndText;
- data << uint8(0); // some string
+ data << CompletedText; // display in quest objectives window once all objectives are completed
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
{
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));
diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp
index 9057f7930fb..9ec3d21f99e 100644
--- a/src/game/QuestDef.cpp
+++ b/src/game/QuestDef.cpp
@@ -62,82 +62,83 @@ Quest::Quest(Field * questRecord)
OfferRewardText = questRecord[35].GetCppString();
RequestItemsText = questRecord[36].GetCppString();
EndText = questRecord[37].GetCppString();
+ CompletedText = questRecord[38].GetCppString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ObjectiveText[i] = questRecord[38+i].GetCppString();
+ ObjectiveText[i] = questRecord[39+i].GetCppString();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
- ReqItemId[i] = questRecord[42+i].GetUInt32();
+ ReqItemId[i] = questRecord[43+i].GetUInt32();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
- ReqItemCount[i] = questRecord[48+i].GetUInt32();
+ ReqItemCount[i] = questRecord[49+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- ReqSourceId[i] = questRecord[54+i].GetUInt32();
+ ReqSourceId[i] = questRecord[55+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- ReqSourceCount[i] = questRecord[58+i].GetUInt32();
+ ReqSourceCount[i] = questRecord[59+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqCreatureOrGOId[i] = questRecord[62+i].GetInt32();
+ ReqCreatureOrGOId[i] = questRecord[63+i].GetInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqCreatureOrGOCount[i] = questRecord[66+i].GetUInt32();
+ ReqCreatureOrGOCount[i] = questRecord[67+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqSpell[i] = questRecord[70+i].GetUInt32();
+ ReqSpell[i] = questRecord[71+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- RewChoiceItemId[i] = questRecord[74+i].GetUInt32();
+ RewChoiceItemId[i] = questRecord[75+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- RewChoiceItemCount[i] = questRecord[80+i].GetUInt32();
+ RewChoiceItemCount[i] = questRecord[81+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
- RewItemId[i] = questRecord[86+i].GetUInt32();
+ RewItemId[i] = questRecord[87+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
- RewItemCount[i] = questRecord[90+i].GetUInt32();
+ RewItemCount[i] = questRecord[91+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
- RewRepFaction[i] = questRecord[94+i].GetUInt32();
+ RewRepFaction[i] = questRecord[95+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
- RewRepValueId[i] = questRecord[99+i].GetInt32();
+ RewRepValueId[i] = questRecord[100+i].GetInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
- RewRepValue[i] = questRecord[104+i].GetInt32();
-
- RewHonorableKills = questRecord[109].GetUInt32();
- RewHonorMultiplier = questRecord[110].GetFloat();
- RewOrReqMoney = questRecord[111].GetInt32();
- RewMoneyMaxLevel = questRecord[112].GetUInt32();
- RewSpell = questRecord[113].GetUInt32();
- RewSpellCast = questRecord[114].GetInt32();
- RewMailTemplateId = questRecord[115].GetUInt32();
- RewMailDelaySecs = questRecord[116].GetUInt32();
- PointMapId = questRecord[117].GetUInt32();
- PointX = questRecord[118].GetFloat();
- PointY = questRecord[119].GetFloat();
- PointOpt = questRecord[120].GetUInt32();
+ RewRepValue[i] = questRecord[105+i].GetInt32();
+
+ RewHonorableKills = questRecord[110].GetUInt32();
+ RewHonorMultiplier = questRecord[111].GetFloat();
+ RewOrReqMoney = questRecord[112].GetInt32();
+ RewMoneyMaxLevel = questRecord[113].GetUInt32();
+ RewSpell = questRecord[114].GetUInt32();
+ RewSpellCast = questRecord[115].GetInt32();
+ RewMailTemplateId = questRecord[116].GetUInt32();
+ RewMailDelaySecs = questRecord[117].GetUInt32();
+ PointMapId = questRecord[118].GetUInt32();
+ PointX = questRecord[119].GetFloat();
+ PointY = questRecord[120].GetFloat();
+ PointOpt = questRecord[121].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- DetailsEmote[i] = questRecord[121+i].GetUInt32();
+ DetailsEmote[i] = questRecord[122+i].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- DetailsEmoteDelay[i] = questRecord[125+i].GetUInt32();
+ DetailsEmoteDelay[i] = questRecord[126+i].GetUInt32();
- IncompleteEmote = questRecord[129].GetUInt32();
- CompleteEmote = questRecord[130].GetUInt32();
+ IncompleteEmote = questRecord[130].GetUInt32();
+ CompleteEmote = questRecord[131].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- OfferRewardEmote[i] = questRecord[131+i].GetInt32();
+ OfferRewardEmote[i] = questRecord[132+i].GetInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- OfferRewardEmoteDelay[i] = questRecord[135+i].GetInt32();
+ OfferRewardEmoteDelay[i] = questRecord[136+i].GetInt32();
- QuestStartScript = questRecord[139].GetUInt32();
- QuestCompleteScript = questRecord[140].GetUInt32();
+ QuestStartScript = questRecord[140].GetUInt32();
+ QuestCompleteScript = questRecord[141].GetUInt32();
QuestFlags |= SpecialFlags << 16;
diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h
index 74a2087ad37..a0aa4433ac6 100644
--- a/src/game/QuestDef.h
+++ b/src/game/QuestDef.h
@@ -164,6 +164,7 @@ struct QuestLocale
std::vector<std::string> OfferRewardText;
std::vector<std::string> RequestItemsText;
std::vector<std::string> EndText;
+ std::vector<std::string> CompletedText;
std::vector< std::vector<std::string> > ObjectiveText;
};
@@ -216,6 +217,7 @@ class Quest
std::string GetOfferRewardText() const { return OfferRewardText; }
std::string GetRequestItemsText() const { return RequestItemsText; }
std::string GetEndText() const { return EndText; }
+ std::string GetCompletedText() const { return CompletedText; }
int32 GetRewOrReqMoney() const;
uint32 GetRewHonorableKills() const { return RewHonorableKills; }
uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; }
@@ -314,6 +316,7 @@ class Quest
std::string OfferRewardText;
std::string RequestItemsText;
std::string EndText;
+ std::string CompletedText;
uint32 RewHonorableKills;
float RewHonorMultiplier;
int32 RewOrReqMoney;