mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[7461] Give proper honor amount at item based AddHonor spells cast.
This commit is contained in:
parent
991376067d
commit
afe5eb3e1d
2 changed files with 14 additions and 5 deletions
|
|
@ -3809,17 +3809,26 @@ void Spell::EffectAddHonor(uint32 /*i*/)
|
||||||
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage);
|
// not scale value for item based reward (/10 value expected)
|
||||||
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());
|
if(m_CastItem)
|
||||||
|
{
|
||||||
|
((Player*)unitTarget)->RewardHonor(NULL, 1, damage/10);
|
||||||
|
sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),((Player*)unitTarget)->GetGUIDLow());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80
|
// 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 )
|
if( damage <= 50)
|
||||||
|
{
|
||||||
|
uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage);
|
||||||
((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward);
|
((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward);
|
||||||
|
sLog.outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, ((Player*)unitTarget)->GetGUIDLow());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//maybe we have correct honor_gain in damage already
|
//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());
|
sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7460"
|
#define REVISION_NR "7461"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue