diff options
| author | TOM_RUS <tomrus88@gmail.com> | 2011-01-31 16:27:23 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2011-01-31 16:27:23 +0100 |
| commit | c006f1b9048eb72ffacbd694db817beaec9df453 (patch) | |
| tree | a965bd4e677241dbc31b98babce563dc79eb693d /src/server/game/Quests/QuestDef.cpp | |
| parent | 82b7f302718dc3e339c90da970a1a760fcb2431a (diff) | |
Core/Quests: Implemented proper calculation of quest honor reward using DBC
Signed-off-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
| -rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 62739212ab9..50fb0e452fb 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -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; +} |
