diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-08-28 12:03:39 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-08-28 12:03:39 +0200 |
commit | ec527fa172f64f47406d9317b8c3a98e9c46f812 (patch) | |
tree | 5c4be02cbdd2e321284a99c724e7c509bce70e8e /src/server/game/Quests/QuestDef.cpp | |
parent | 154aaa0ad5b673c6d52f6d4c88baa450a82226de (diff) |
Core/Quests: Fixed quest honor rewards properly.
REALLY closes #1356
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
-rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index c8193ec60ad..b58011efe42 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -227,3 +227,24 @@ 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); + if (!tc) + return 0; + + honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f); + honor += GetRewHonorAddition(); + } + + return honor; +} |