mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10485] Check school mask for SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
* Some spells expect this. * Check SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE just for similarity, currently no spels with aura 310 with special school masks. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
f0956e258c
commit
63cdd66bcb
2 changed files with 8 additions and 11 deletions
|
|
@ -6397,17 +6397,14 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
|
|||
if(!spellProto || !pCaster || damagetype==DIRECT_DAMAGE )
|
||||
return pdamage;
|
||||
|
||||
uint32 schoolMask = spellProto->SchoolMask;
|
||||
|
||||
// Taken total percent damage auras
|
||||
float TakenTotalMod = 1.0f;
|
||||
int32 TakenTotal = 0;
|
||||
|
||||
// ..taken
|
||||
AuraList const& mModDamagePercentTaken = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
|
||||
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto))
|
||||
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
|
||||
}
|
||||
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);
|
||||
|
||||
// .. taken pct: dummy auras
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
|
|
@ -6436,9 +6433,9 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
|
|||
// Mod damage taken from AoE spells
|
||||
if(IsAreaOfEffectSpell(spellProto))
|
||||
{
|
||||
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE);
|
||||
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, schoolMask);
|
||||
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
|
||||
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE);
|
||||
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE, schoolMask);
|
||||
}
|
||||
|
||||
// Taken fixed damage bonus auras
|
||||
|
|
@ -7363,9 +7360,9 @@ uint32 Unit::MeleeDamageBonusTaken(Unit *pCaster, uint32 pdamage,WeaponAttackTyp
|
|||
// ..taken pct (aoe avoidance)
|
||||
if(spellProto && IsAreaOfEffectSpell(spellProto))
|
||||
{
|
||||
TakenPercent *= GetTotalAuraMultiplier(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE);
|
||||
TakenPercent *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, schoolMask);
|
||||
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
|
||||
TakenPercent *= GetTotalAuraMultiplier(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE);
|
||||
TakenPercent *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE, schoolMask);
|
||||
}
|
||||
|
||||
// special dummys/class scripts and other effects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue