aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/SpellAuraDefines.h2
-rw-r--r--src/game/SpellAuras.cpp13
-rw-r--r--src/game/StatSystem.cpp21
-rw-r--r--src/game/Unit.cpp6
4 files changed, 30 insertions, 12 deletions
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 604a634953d..8b8760e6ed1 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -191,7 +191,7 @@ enum AuraType
SPELL_AURA_SAFE_FALL = 144,
SPELL_AURA_MOD_PET_TALENT_POINTS = 145,
SPELL_AURA_ALLOW_TAME_PET_TYPE = 146,
- SPELL_AURA_ADD_CREATURE_IMMUNITY = 147,
+ SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147,
SPELL_AURA_RETAIN_COMBO_POINTS = 148,
SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback
SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 8eeaf564145..e4f9ed67c1a 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -201,7 +201,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes
&Aura::HandleAuraModPetTalentsPoints, //145 SPELL_AURA_MOD_PET_TALENT_POINTS
&Aura::HandleNoImmediateEffect, //146 SPELL_AURA_ALLOW_TAME_PET_TYPE
- &Aura::HandleNULL, //147 SPELL_AURA_ADD_CREATURE_IMMUNITY
+ &Aura::HandleModMechanicImmunity, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK
&Aura::HandleAuraRetainComboPoints, //148 SPELL_AURA_RETAIN_COMBO_POINTS
&Aura::HandleNoImmediateEffect, //149 SPELL_AURA_REDUCE_PUSHBACK
&Aura::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
@@ -3611,7 +3611,7 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
//Players on flying mounts must be immune to polymorph
if (m_target->GetTypeId()==TYPEID_PLAYER)
- m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,MECHANIC_POLYMORPH,apply);
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,1<<MECHANIC_POLYMORPH,apply);
// Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
if( apply && m_target->HasAura(42016,0) && m_target->GetMountID())
@@ -3658,8 +3658,11 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
void Aura::HandleModMechanicImmunity(bool apply, bool Real)
{
- uint32 mechanic = 1 << m_modifier.m_miscvalue;
-
+ uint32 mechanic;
+ if (GetSpellProto()->EffectApplyAuraName[GetEffIndex()]==SPELL_AURA_MECHANIC_IMMUNITY)
+ mechanic = 1 << m_modifier.m_miscvalue;
+ else //SPELL_AURA_MECHANIC_IMMUNITY_MASK
+ mechanic = m_modifier.m_miscvalue;
//immune movement impairment and loss of control
if(GetId()==42292)
mechanic=IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
@@ -3688,7 +3691,7 @@ void Aura::HandleModMechanicImmunity(bool apply, bool Real)
}
}
- m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,m_modifier.m_miscvalue,apply);
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,mechanic,apply);
// Bestial Wrath
if ( GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->Id == 19574)
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index df0e677f0c2..3a98e215da7 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -72,12 +72,25 @@ bool Player::UpdateStats(Stats stat)
break;
}
-
- // Need update (exist AP from stat auras)
- if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ if (stat == STAT_STRENGTH)
+ {
+ UpdateAttackPowerAndDamage(false);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(true);
+ }
+ else if (stat == STAT_AGILITY)
+ {
UpdateAttackPowerAndDamage(false);
- if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
UpdateAttackPowerAndDamage(true);
+ }
+ else
+ {
+ // Need update (exist AP from stat auras)
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(false);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(true);
+ }
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9d50436d6be..98f66f09711 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8783,7 +8783,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for(SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
{
- if(itr->type == spellInfo->Mechanic)
+ if(itr->type & (1<<spellInfo->Mechanic))
{
return true;
}
@@ -8803,6 +8803,8 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
+ if (!spellInfo)
+ return false;
//If m_immuneToEffect type contain this effect type, IMMUNE effect.
uint32 effect = spellInfo->Effect[index];
SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT];
@@ -8814,7 +8816,7 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
{
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- if(itr->type == mechanic)
+ if(itr->type & 1<<(spellInfo->EffectMechanic[index]))
return true;
}