diff options
author | QAston <none@none> | 2009-02-06 23:01:07 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-02-06 23:01:07 +0100 |
commit | a38297f28f8a8341967fa8fe5b0919b6d6aa04fc (patch) | |
tree | fe4a7bbce25ede3bc40dcbd937e1c975989d5906 | |
parent | 5bdb0560ba6caa93829b838c93b6d4042c71b75d (diff) |
*Handle aura SPELL_AURA_MECHANIC_IMMUNITY_MASK.
*Fix a typo in ap bonus from stat calculation-thanks to megamage for pointing this.
--HG--
branch : trunk
-rw-r--r-- | src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp | 4 | ||||
-rw-r--r-- | src/game/SpellAuraDefines.h | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 13 | ||||
-rw-r--r-- | src/game/StatSystem.cpp | 21 | ||||
-rw-r--r-- | src/game/Unit.cpp | 6 |
5 files changed, 32 insertions, 14 deletions
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index e4e0e12a0cd..adb892e6624 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -277,7 +277,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI m_creature->RemoveAurasDueToSpell(AURA_BANISH); // Leotheras is getting immune again - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, 1<<MECHANIC_BANISH, true); // changing model to bloodelf m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); @@ -298,7 +298,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI { // channelers != 0 apply banish aura // removing Leotheras banish immune to apply AURA_BANISH - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, 1<<MECHANIC_BANISH, false); DoCast(m_creature, AURA_BANISH); // changing model 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; } |