diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/SpellEffects.cpp | 16 | ||||
| -rw-r--r-- | src/shared/revision_nr.h | 2 | 
2 files changed, 12 insertions, 6 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*/) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index eceadf30029..62782da3d9e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@  #ifndef __REVISION_NR_H__  #define __REVISION_NR_H__ - #define REVISION_NR "7434" + #define REVISION_NR "7435"  #endif // __REVISION_NR_H__  | 
