[7435] Fixed Spell::EffectAddHonor to corrcetly add honor based on player's level Author: Triply
--HG-- branch : trunk
This commit is contained in:
@@ -59,6 +59,7 @@
|
|||||||
#include "GridNotifiers.h"
|
#include "GridNotifiers.h"
|
||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "SkillDiscovery.h"
|
#include "SkillDiscovery.h"
|
||||||
|
#include "Formulas.h"
|
||||||
|
|
||||||
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||||
{
|
{
|
||||||
@@ -3872,13 +3873,18 @@ void Spell::EffectAddHonor(uint32 /*i*/)
|
|||||||
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
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!
|
// 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 )
|
||||||
// now fixed only for level 70 players:
|
((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward);
|
||||||
if (((Player*)unitTarget)->getLevel() == 70)
|
else
|
||||||
|
{
|
||||||
|
//maybe we have correct honor_gain in damage already
|
||||||
((Player*)unitTarget)->RewardHonor(NULL, 1, damage);
|
((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*/)
|
void Spell::EffectTradeSkill(uint32 /*i*/)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7434"
|
#define REVISION_NR "7435"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|||||||
Reference in New Issue
Block a user