*Implement aura type SPELL_AURA_MOD_XP_QUEST_PCT (291) and fix SPELL_AURA_MOD_XP_PCT(200) handler.
*Correct structure stored in world.sql for npc_spellclick_spells and fix world_script_text application. --HG-- branch : trunk
This commit is contained in:
+16
-5
@@ -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())
|
||||
|
||||
@@ -336,7 +336,7 @@ enum AuraType
|
||||
SPELL_AURA_288,
|
||||
SPELL_AURA_289,
|
||||
SPELL_AURA_MOD_CRIT_CHANCE,
|
||||
SPELL_AURA_291,
|
||||
SPELL_AURA_MOD_XP_QUEST_PCT,
|
||||
SPELL_AURA_292,
|
||||
SPELL_AURA_293,
|
||||
SPELL_AURA_294,
|
||||
|
||||
@@ -253,7 +253,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
|
||||
&Aura::HandleUnused, //198 unused (3.0.8a) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
|
||||
&Aura::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult
|
||||
&Aura::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::GiveXP
|
||||
&Aura::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill
|
||||
&Aura::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...
|
||||
&Aura::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst
|
||||
&Aura::HandleNoImmediateEffect, //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
|
||||
@@ -344,7 +344,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleUnused, //288 unused
|
||||
&Aura::HandleUnused, //289 unused
|
||||
&Aura::HandleNULL, //290 mod all critical hit chances?
|
||||
&Aura::HandleNULL, //291 SPELL_AURA_MOD_XP_QUEST_PCT
|
||||
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
|
||||
&Aura::HandleNULL, //292 call stabled pet
|
||||
&Aura::HandleNULL, //293 2 test spells
|
||||
&Aura::HandleNULL //294 2 spells, possible prevent mana regen
|
||||
|
||||
Reference in New Issue
Block a user