*Allow SPELL_AURA_ABILITY_PERIODIC_CRIT to make PERIODIC_LEECH auras crit.
--HG-- branch : trunk
This commit is contained in:
+22
-29
@@ -5775,20 +5775,9 @@ void AuraEffect::PeriodicTick()
|
|||||||
else
|
else
|
||||||
pdamage = uint32(m_target->GetMaxHealth()*pdamage/100);
|
pdamage = uint32(m_target->GetMaxHealth()*pdamage/100);
|
||||||
|
|
||||||
bool crit = false;
|
bool crit = IsPeriodicTickCrit(pCaster);
|
||||||
Unit::AuraEffectList const& mPeriodicCritAuras= pCaster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
|
if (crit)
|
||||||
for(Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
|
pdamage = pCaster->SpellCriticalDamageBonus(m_spellProto, pdamage, m_target);
|
||||||
{
|
|
||||||
if (!(*itr)->isAffectedOnSpell(m_spellProto))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (pCaster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
|
|
||||||
{
|
|
||||||
crit = true;
|
|
||||||
pdamage = pCaster->SpellCriticalDamageBonus(m_spellProto, pdamage, m_target);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
|
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
|
||||||
// Reduce dot damage from resilience for players
|
// Reduce dot damage from resilience for players
|
||||||
@@ -5845,6 +5834,10 @@ void AuraEffect::PeriodicTick()
|
|||||||
uint32 pdamage = GetAmount() > 0 ? GetAmount() : 0;
|
uint32 pdamage = GetAmount() > 0 ? GetAmount() : 0;
|
||||||
pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
|
pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
|
||||||
|
|
||||||
|
bool crit = IsPeriodicTickCrit(pCaster);
|
||||||
|
if (crit)
|
||||||
|
pdamage = pCaster->SpellCriticalDamageBonus(m_spellProto, pdamage, m_target);
|
||||||
|
|
||||||
//Calculate armor mitigation if it is a physical spell
|
//Calculate armor mitigation if it is a physical spell
|
||||||
if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL)
|
if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL)
|
||||||
{
|
{
|
||||||
@@ -5866,7 +5859,7 @@ void AuraEffect::PeriodicTick()
|
|||||||
sLog.outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
|
sLog.outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
|
||||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId(),absorb);
|
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId(),absorb);
|
||||||
|
|
||||||
pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0);
|
pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0, crit);
|
||||||
|
|
||||||
Unit* target = m_target; // aura can be deleted in DealDamage
|
Unit* target = m_target; // aura can be deleted in DealDamage
|
||||||
SpellEntry const* spellProto = GetSpellProto();
|
SpellEntry const* spellProto = GetSpellProto();
|
||||||
@@ -5955,20 +5948,9 @@ void AuraEffect::PeriodicTick()
|
|||||||
pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
|
pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool crit = false;
|
bool crit = IsPeriodicTickCrit(pCaster);
|
||||||
Unit::AuraEffectList const& mPeriodicCritAuras= pCaster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
|
if (crit)
|
||||||
for(Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
|
pdamage = pCaster->SpellCriticalHealingBonus(m_spellProto, pdamage, m_target);
|
||||||
{
|
|
||||||
if (!(*itr)->isAffectedOnSpell(m_spellProto))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (pCaster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
|
|
||||||
{
|
|
||||||
crit = true;
|
|
||||||
pdamage = pCaster->SpellCriticalHealingBonus(m_spellProto, pdamage, m_target);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
|
sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
|
||||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
|
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
|
||||||
@@ -7006,3 +6988,14 @@ int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster)
|
|||||||
return damageCap;
|
return damageCap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32 AuraEffect::IsPeriodicTickCrit(Unit const * pCaster) const
|
||||||
|
{
|
||||||
|
Unit::AuraEffectList const& mPeriodicCritAuras= pCaster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
|
||||||
|
for(Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
|
||||||
|
{
|
||||||
|
if ((*itr)->isAffectedOnSpell(m_spellProto) && pCaster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -402,6 +402,8 @@ class TRINITY_DLL_SPEC AuraEffect
|
|||||||
bool m_isAreaAura:1;
|
bool m_isAreaAura:1;
|
||||||
bool m_isPersistent:1;
|
bool m_isPersistent:1;
|
||||||
bool m_isApplied:1;
|
bool m_isApplied:1;
|
||||||
|
private:
|
||||||
|
int32 IsPeriodicTickCrit(Unit const * pCaster) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
|
class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
|
||||||
|
|||||||
+2
-2
@@ -8478,7 +8478,7 @@ uint32 Unit::BuildAuraStateUpdateForTarget(Unit * target) const
|
|||||||
return auraStates;
|
return auraStates;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Caster) const
|
bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit const * Caster) const
|
||||||
{
|
{
|
||||||
if (Caster)
|
if (Caster)
|
||||||
{
|
{
|
||||||
@@ -9492,7 +9492,7 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic
|
|||||||
return TakenAdvertisedBenefit;
|
return TakenAdvertisedBenefit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType)
|
bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) const
|
||||||
{
|
{
|
||||||
// not critting spell
|
// not critting spell
|
||||||
if((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT))
|
if((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT))
|
||||||
|
|||||||
+2
-2
@@ -1704,7 +1704,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
|
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
|
||||||
void ModifyAuraState(AuraState flag, bool apply);
|
void ModifyAuraState(AuraState flag, bool apply);
|
||||||
uint32 BuildAuraStateUpdateForTarget(Unit * target) const;
|
uint32 BuildAuraStateUpdateForTarget(Unit * target) const;
|
||||||
bool HasAuraState(AuraState flag, SpellEntry const *spellProto = NULL, Unit * Caster = NULL) const ;
|
bool HasAuraState(AuraState flag, SpellEntry const *spellProto = NULL, Unit const * Caster = NULL) const ;
|
||||||
void UnsummonAllTotems();
|
void UnsummonAllTotems();
|
||||||
Unit* SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo = NULL);
|
Unit* SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo = NULL);
|
||||||
int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask);
|
int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask);
|
||||||
@@ -1715,7 +1715,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
uint32 SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
|
uint32 SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
|
||||||
bool isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAttackType attackType = BASE_ATTACK);
|
bool isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAttackType attackType = BASE_ATTACK);
|
||||||
bool isBlockCritical();
|
bool isBlockCritical();
|
||||||
bool isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK);
|
bool isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
|
||||||
uint32 SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
uint32 SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
||||||
uint32 SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
uint32 SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user