Core/Quests: Implemented proper calculation of quest honor reward using DBC
Signed-off-by: Shauren <[email protected]>
This commit is contained in:
@@ -212,3 +212,23 @@ bool Quest::IsAllowedInRaid() const
|
||||
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID);
|
||||
}
|
||||
|
||||
uint32 Quest::CalculateHonorGain(uint8 level) const
|
||||
{
|
||||
if (level > GT_MAX_LEVEL)
|
||||
level = GT_MAX_LEVEL;
|
||||
|
||||
uint32 honor = 0;
|
||||
|
||||
if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f)
|
||||
{
|
||||
// values stored from 0.. for 1...
|
||||
TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1);
|
||||
if (!tc)
|
||||
return 0;
|
||||
honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161);
|
||||
honor += GetRewHonorAddition();
|
||||
}
|
||||
|
||||
return honor;
|
||||
}
|
||||
|
||||
@@ -253,6 +253,7 @@ class Quest
|
||||
bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
|
||||
bool IsAllowedInRaid() const;
|
||||
bool IsDFQuest() const { return QuestFlags & QUEST_TRINITY_FLAGS_DF_QUEST; }
|
||||
uint32 CalculateHonorGain(uint8 level) const;
|
||||
|
||||
// multiple values
|
||||
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
|
||||
|
||||
Reference in New Issue
Block a user