diff options
author | megamage <none@none> | 2009-03-10 15:28:51 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-10 15:28:51 -0600 |
commit | 0a8d58c3ff0df0f749f07c9aa6b335a23abd8968 (patch) | |
tree | 67736a752d2440cc79e70fcd95eaea14b8b64899 /src/game/SpellEffects.cpp | |
parent | 167ca565d044915f01ead4b189754ab1c44cc981 (diff) |
[7435] Fixed Spell::EffectAddHonor to corrcetly add honor based on player's level Author: Triply
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r-- | src/game/SpellEffects.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index aac198d088e..73aea9761b4 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -59,6 +59,7 @@ #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "SkillDiscovery.h" +#include "Formulas.h" pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= { @@ -3872,13 +3873,18 @@ void Spell::EffectAddHonor(uint32 /*i*/) if(unitTarget->GetTypeId() != TYPEID_PLAYER) return; - sLog.outDebug("SpellEffect::AddHonor called for spell_id %u , that rewards %d honor points to player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow()); + uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage); + sLog.outDebug("SpellEffect::AddHonor called for spell_id %u, that rewards %u honor points to player: %u", m_spellInfo->Id, honor_reward, ((Player*)unitTarget)->GetGUIDLow()); - // TODO: find formula for honor reward based on player's level! - - // now fixed only for level 70 players: - if (((Player*)unitTarget)->getLevel() == 70) + // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80 + if( damage <= 50 ) + ((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward); + else + { + //maybe we have correct honor_gain in damage already ((Player*)unitTarget)->RewardHonor(NULL, 1, damage); + sLog.outError("SpellEffect::AddHonor called for spell_id %u, that rewards %d * honor for one honorable kill and it is too much (%u of honor) for player: %u", m_spellInfo->Id, damage, honor_reward, ((Player*)unitTarget)->GetGUIDLow()); + } } void Spell::EffectTradeSkill(uint32 /*i*/) |