mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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 )
|
if(!spellProto || !pCaster || damagetype==DIRECT_DAMAGE )
|
||||||
return pdamage;
|
return pdamage;
|
||||||
|
|
||||||
|
uint32 schoolMask = spellProto->SchoolMask;
|
||||||
|
|
||||||
// Taken total percent damage auras
|
// Taken total percent damage auras
|
||||||
float TakenTotalMod = 1.0f;
|
float TakenTotalMod = 1.0f;
|
||||||
int32 TakenTotal = 0;
|
int32 TakenTotal = 0;
|
||||||
|
|
||||||
// ..taken
|
// ..taken
|
||||||
AuraList const& mModDamagePercentTaken = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
|
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// .. taken pct: dummy auras
|
// .. taken pct: dummy auras
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
|
|
@ -6436,9 +6433,9 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
|
||||||
// Mod damage taken from AoE spells
|
// Mod damage taken from AoE spells
|
||||||
if(IsAreaOfEffectSpell(spellProto))
|
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())
|
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
|
// Taken fixed damage bonus auras
|
||||||
|
|
@ -7363,9 +7360,9 @@ uint32 Unit::MeleeDamageBonusTaken(Unit *pCaster, uint32 pdamage,WeaponAttackTyp
|
||||||
// ..taken pct (aoe avoidance)
|
// ..taken pct (aoe avoidance)
|
||||||
if(spellProto && IsAreaOfEffectSpell(spellProto))
|
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())
|
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
|
// special dummys/class scripts and other effects
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10484"
|
#define REVISION_NR "10485"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue