mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[8665] Correctly implement XP bonus auras.
Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
c0ffd1b48c
commit
ec10a5bf3c
4 changed files with 39 additions and 28 deletions
|
|
@ -2357,10 +2357,21 @@ void Player::GiveXP(uint32 xp, Unit* victim)
|
|||
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
return;
|
||||
|
||||
// handle SPELL_AURA_MOD_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
if(victim)
|
||||
{
|
||||
// handle SPELL_AURA_MOD_KILL_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_KILL_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
// handle SPELL_AURA_MOD_QUEST_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_QUEST_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
}
|
||||
|
||||
|
||||
// XP resting bonus for kill
|
||||
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue