Implement usage of RewardArenaPoints field in quest_template

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-03-27 15:10:26 +01:00
parent 9ce6094dce
commit b9927ca559
5 changed files with 80 additions and 74 deletions
+6 -6
View File
@@ -511,13 +511,13 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
data << uint32(0);
// rewarded honor points. Multiply with 10 to satisfy client
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
data << float(0); // new 3.3.0
data << float(0); // new 3.3.0, honor multiplier?
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
data << int32(pQuest->GetRewSpellCast()); // casted spell
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
data << uint32(pQuest->GetBonusTalents()); // bonus talents
data << uint32(0);
data << uint32(0);
data << uint32(pQuest->GetRewArenaPoints()); // reward arena points
data << uint32(0); // unk
for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
data << uint32(pQuest->RewRepFaction[i]);
@@ -611,7 +611,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
data << uint32(pQuest->GetPlayersSlain()); // players slain
data << uint32(pQuest->GetBonusTalents()); // bonus talents
data << uint32(0); // bonus arena points
data << uint32(pQuest->GetRewArenaPoints()); // bonus arena points
data << uint32(0); // unknown
int iI;
@@ -763,13 +763,13 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
// rewarded honor points. Multiply with 10 to satisfy client
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
data << float(0);
data << float(0); // unk, honor multiplier?
data << uint32(0x08); // unused by client?
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
data << int32(pQuest->GetRewSpellCast()); // casted spell
data << uint32(0); // unknown
data << uint32(pQuest->GetBonusTalents()); // bonus talents
data << uint32(0);
data << uint32(pQuest->GetRewArenaPoints()); // arena points
data << uint32(0);
for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids
+17 -17
View File
@@ -3582,37 +3582,37 @@ void ObjectMgr::LoadQuests()
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClass, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue,"
// 10 11 12 13 14 15 16 17 18 19
"RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime,"
// 20 21 22 23 24 25 26 27 28 29 30 31 32
"QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell,"
// 33 34 35 36 37 38 39 40 41 42 43
// 20 21 22 23 24 25 26 27 28 29 30 31 32 33
"QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell,"
// 34 35 36 37 38 39 40 41 42 43 44
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4,"
// 44 45 46 47 48 49 50 51 52 53 54 55
// 45 46 47 48 49 50 51 52 53 54 55 56
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6,"
// 56 57 58 59 60 61 62 63
// 57 58 59 60 61 62 63 64
"ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4,"
// 64 65 66 67 68 69 70 71
// 65 66 67 68 69 70 71 72
"ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4,"
// 72 73 74 75
// 73 74 75 76
"ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4,"
// 76 77 78 79 80 81
// 77 78 79 80 81 82
"RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6,"
// 82 83 84 85 86 87
// 83 84 85 86 87 88
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6,"
// 88 89 90 91 92 93 94 95
// 89 90 91 92 93 94 95 96
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4,"
// 96 97 98 99 100 101 102 103 104 105
// 97 98 99 100 101 102 103 104 105 106
"RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5,"
// 106 107 108 109 110
// 107 108 109 110 111
"RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5,"
// 111 112 113 114 115 116 117 118 119 120 121 122
// 112 113 114 115 116 117 118 119 120 121 122 123
"RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt,"
// 123 124 125 126 127 128 129 130
// 124 125 126 127 128 129 130 131
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4,"
// 131 132 135 134 135 136
// 132 133 134 135 136 137
"IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4,"
// 137 138 139 140
// 138 139 140 141
"OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4,"
// 141 142
// 142 143
"StartScript, CompleteScript"
" FROM quest_template");
if(result == NULL)
+4 -1
View File
@@ -14073,6 +14073,9 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
InitTalentForLevel();
}
if (pQuest->GetRewArenaPoints())
ModifyArenaPoints(pQuest->GetRewArenaPoints());
// Send reward mail
if (uint32 mail_template_id = pQuest->GetRewMailTemplateId())
MailDraft(mail_template_id).SendMailTo(this, questGiver, MAIL_CHECK_MASK_NONE, pQuest->GetRewMailDelaySecs());
@@ -15190,7 +15193,7 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
data << uint32(10*Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills()));
data << uint32(pQuest->GetBonusTalents()); // bonus talents
data << uint32(0);
data << uint32(pQuest->GetRewArenaPoints());
GetSession()->SendPacket( &data );
if (pQuest->GetQuestCompleteScript() != 0)
+51 -50
View File
@@ -49,97 +49,98 @@ Quest::Quest(Field * questRecord)
CharTitleId = questRecord[22].GetUInt32();
PlayersSlain = questRecord[23].GetUInt32();
BonusTalents = questRecord[24].GetUInt32();
PrevQuestId = questRecord[25].GetInt32();
NextQuestId = questRecord[26].GetInt32();
ExclusiveGroup = questRecord[27].GetInt32();
NextQuestInChain = questRecord[28].GetUInt32();
XPId = questRecord[29].GetUInt32();
SrcItemId = questRecord[30].GetUInt32();
SrcItemCount = questRecord[31].GetUInt32();
SrcSpell = questRecord[32].GetUInt32();
Title = questRecord[33].GetCppString();
Details = questRecord[34].GetCppString();
Objectives = questRecord[35].GetCppString();
OfferRewardText = questRecord[36].GetCppString();
RequestItemsText = questRecord[37].GetCppString();
EndText = questRecord[38].GetCppString();
CompletedText = questRecord[39].GetCppString();
RewArenaPoints = questRecord[25].GetInt32();
PrevQuestId = questRecord[26].GetInt32();
NextQuestId = questRecord[27].GetInt32();
ExclusiveGroup = questRecord[28].GetInt32();
NextQuestInChain = questRecord[29].GetUInt32();
XPId = questRecord[30].GetUInt32();
SrcItemId = questRecord[31].GetUInt32();
SrcItemCount = questRecord[32].GetUInt32();
SrcSpell = questRecord[33].GetUInt32();
Title = questRecord[34].GetCppString();
Details = questRecord[35].GetCppString();
Objectives = questRecord[36].GetCppString();
OfferRewardText = questRecord[37].GetCppString();
RequestItemsText = questRecord[38].GetCppString();
EndText = questRecord[39].GetCppString();
CompletedText = questRecord[40].GetCppString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i] = questRecord[40+i].GetCppString();
ObjectiveText[i] = questRecord[41+i].GetCppString();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
ReqItemId[i] = questRecord[44+i].GetUInt32();
ReqItemId[i] = questRecord[45+i].GetUInt32();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
ReqItemCount[i] = questRecord[50+i].GetUInt32();
ReqItemCount[i] = questRecord[51+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
ReqSourceId[i] = questRecord[56+i].GetUInt32();
ReqSourceId[i] = questRecord[57+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
ReqSourceCount[i] = questRecord[60+i].GetUInt32();
ReqSourceCount[i] = questRecord[61+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ReqCreatureOrGOId[i] = questRecord[64+i].GetInt32();
ReqCreatureOrGOId[i] = questRecord[65+i].GetInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ReqCreatureOrGOCount[i] = questRecord[68+i].GetUInt32();
ReqCreatureOrGOCount[i] = questRecord[69+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ReqSpell[i] = questRecord[72+i].GetUInt32();
ReqSpell[i] = questRecord[73+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
RewChoiceItemId[i] = questRecord[76+i].GetUInt32();
RewChoiceItemId[i] = questRecord[77+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
RewChoiceItemCount[i] = questRecord[82+i].GetUInt32();
RewChoiceItemCount[i] = questRecord[83+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
RewItemId[i] = questRecord[88+i].GetUInt32();
RewItemId[i] = questRecord[89+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
RewItemCount[i] = questRecord[92+i].GetUInt32();
RewItemCount[i] = questRecord[93+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewRepFaction[i] = questRecord[96+i].GetUInt32();
RewRepFaction[i] = questRecord[97+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewRepValueId[i] = questRecord[101+i].GetInt32();
RewRepValueId[i] = questRecord[102+i].GetInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewRepValue[i] = questRecord[106+i].GetInt32();
RewRepValue[i] = questRecord[107+i].GetInt32();
RewHonorableKills = questRecord[111].GetUInt32();
RewHonorMultiplier = questRecord[112].GetFloat();
RewOrReqMoney = questRecord[113].GetInt32();
RewMoneyMaxLevel = questRecord[114].GetUInt32();
RewSpell = questRecord[115].GetUInt32();
RewSpellCast = questRecord[116].GetInt32();
RewMailTemplateId = questRecord[117].GetUInt32();
RewMailDelaySecs = questRecord[118].GetUInt32();
PointMapId = questRecord[119].GetUInt32();
PointX = questRecord[120].GetFloat();
PointY = questRecord[121].GetFloat();
PointOpt = questRecord[122].GetUInt32();
RewHonorableKills = questRecord[112].GetUInt32();
RewHonorMultiplier = questRecord[113].GetFloat();
RewOrReqMoney = questRecord[114].GetInt32();
RewMoneyMaxLevel = questRecord[115].GetUInt32();
RewSpell = questRecord[116].GetUInt32();
RewSpellCast = questRecord[117].GetInt32();
RewMailTemplateId = questRecord[118].GetUInt32();
RewMailDelaySecs = questRecord[119].GetUInt32();
PointMapId = questRecord[120].GetUInt32();
PointX = questRecord[121].GetFloat();
PointY = questRecord[122].GetFloat();
PointOpt = questRecord[123].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmote[i] = questRecord[123+i].GetUInt32();
DetailsEmote[i] = questRecord[124+i].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmoteDelay[i] = questRecord[127+i].GetUInt32();
DetailsEmoteDelay[i] = questRecord[128+i].GetUInt32();
IncompleteEmote = questRecord[131].GetUInt32();
CompleteEmote = questRecord[132].GetUInt32();
IncompleteEmote = questRecord[132].GetUInt32();
CompleteEmote = questRecord[133].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmote[i] = questRecord[133+i].GetInt32();
OfferRewardEmote[i] = questRecord[134+i].GetInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = questRecord[137+i].GetInt32();
OfferRewardEmoteDelay[i] = questRecord[138+i].GetInt32();
QuestStartScript = questRecord[141].GetUInt32();
QuestCompleteScript = questRecord[142].GetUInt32();
QuestStartScript = questRecord[142].GetUInt32();
QuestCompleteScript = questRecord[143].GetUInt32();
QuestFlags |= SpecialFlags << 16;
+2
View File
@@ -209,6 +209,7 @@ class Quest
uint32 GetCharTitleId() const { return CharTitleId; }
uint32 GetPlayersSlain() const { return PlayersSlain; }
uint32 GetBonusTalents() const { return BonusTalents; }
int32 GetRewArenaPoints() const {return RewArenaPoints; }
uint32 GetSrcItemId() const { return SrcItemId; }
uint32 GetSrcItemCount() const { return SrcItemCount; }
uint32 GetSrcSpell() const { return SrcSpell; }
@@ -304,6 +305,7 @@ class Quest
uint32 CharTitleId;
uint32 PlayersSlain;
uint32 BonusTalents;
int32 RewArenaPoints;
int32 PrevQuestId;
int32 NextQuestId;
int32 ExclusiveGroup;