diff options
author | Kinzcool <kinzzcool@hotmail.com> | 2015-07-01 17:57:09 -0400 |
---|---|---|
committer | Kinzcool <kinzzcool@hotmail.com> | 2015-07-01 17:57:09 -0400 |
commit | 4bbbd9540a25845edb0d424199bab196b5e6bea1 (patch) | |
tree | 39aa0b8c6c76390a70e5e513131cb4a777ce32e5 /src/server/game/Quests/QuestDef.cpp | |
parent | 97b693343586be8ec01178b6b0a02f52bee4d723 (diff) |
Core/Quests: Calculate the RewardMoney value with QuestMoneyReward.dbc and defined an unknown field
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 148cdeab68e..93930cdba54 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -37,7 +37,7 @@ Quest::Quest(Field* questRecord) RewardXPMultiplier = questRecord[10].GetFloat(); RewardMoney = questRecord[11].GetUInt32(); RewardMoneyDifficulty = questRecord[12].GetUInt32(); - Float13 = questRecord[13].GetFloat(); + RewardMoneyMultiplier = questRecord[13].GetFloat(); RewardBonusMoney = questRecord[14].GetUInt32(); RewardDisplaySpell = questRecord[15].GetUInt32(); RewardSpell = questRecord[16].GetUInt32(); @@ -241,10 +241,14 @@ uint32 Quest::XPValue(uint32 playerLevel) const return 0; } -uint32 Quest::GetRewMoney() const +uint32 Quest::MoneyValue(uint8 playerLevel) const { - if (RewardMoney > 0) - return RewardMoney * sWorld->getRate(RATE_MONEY_QUEST); + uint8 level; + if (playerLevel) + level = Level == -1 ? playerLevel : Level; + + if (QuestMoneyRewardEntry const* money = sQuestMoneyRewardStore.LookupEntry(level)) + return money->Money[GetRewMoneyDifficulty()] * GetMoneyMultiplier(); else return 0; } @@ -253,7 +257,7 @@ void Quest::BuildQuestRewards(WorldPackets::Quest::QuestRewards& rewards, Player { rewards.ChoiceItemCount = GetRewChoiceItemsCount(); rewards.ItemCount = GetRewItemsCount(); - rewards.Money = GetRewMoney(); + rewards.Money = player->GetQuestMoneyReward(this); rewards.XP = player->GetQuestXPReward(this); rewards.Title = GetRewTitle(); rewards.Talents = GetBonusTalents(); |