aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9450be61f0f..18a5e48e913 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2430,11 +2430,6 @@ void Player::GiveXP(uint32 xp, Unit* victim)
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
return;
- // handle SPELL_AURA_MOD_XP_PCT auras
- Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
- for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- xp = uint32(xp*(1.0f + (*i)->GetAmount() / 100.0f));
-
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -13174,6 +13169,11 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
// Not give XP in case already completed once repeatable quest
uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue( this )*sWorld.getRate(RATE_XP_QUEST));
+ // handle SPELL_AURA_MOD_XP_QUEST_PCT auras
+ Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_QUEST_PCT);
+ for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
+ XP = uint32(XP*(100.0f + (*i)->GetAmount() / 100.0f));
+
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
GiveXP( XP , NULL );
else
@@ -20036,6 +20036,11 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
{
uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1);
+ // handle SPELL_AURA_MOD_XP_PCT auras
+ Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
+ for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
+ itr_xp = uint32(itr_xp*(100.0f + (*i)->GetAmount() / 100.0f));
+
pGroupGuy->GiveXP(itr_xp, pVictim);
if(Pet* pet = pGroupGuy->GetPet())
pet->GivePetXP(itr_xp/2);
@@ -20064,6 +20069,12 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
if(!PvP)
{
RewardReputation(pVictim,1);
+
+ // handle SPELL_AURA_MOD_XP_PCT auras
+ Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
+ for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
+ xp = uint32(xp*(100.0f + (*i)->GetAmount() / 100.0f));
+
GiveXP(xp, pVictim);
if(Pet* pet = GetPet())