Core/Quests: Implemented proper calculation of quest honor reward using DBC

Signed-off-by: Shauren <[email protected]>
This commit is contained in:
TOM_RUS
2011-01-31 16:27:23 +01:00
committed by Shauren
parent 82b7f30271
commit c006f1b904
7 changed files with 34 additions and 6 deletions
+20
View File
@@ -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;
}
+1
View File
@@ -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];