[11761] change conditions for default cast end proc

This commit is contained in:
Laise 2011-07-30 09:37:50 +03:00
parent 98bd7918f4
commit 43e45c2b35
4 changed files with 44 additions and 13 deletions

View file

@ -860,6 +860,18 @@ bool Aura::CanProcFrom(SpellEntry const *spell, uint32 procFlag, uint32 EventPro
// Check EffectClassMask // Check EffectClassMask
ClassFamilyMask const& mask = GetAuraSpellClassMask(); ClassFamilyMask const& mask = GetAuraSpellClassMask();
// allow proc for modifier auras with charges
if (IsCastEndProcModifierAura(GetSpellProto(), GetEffIndex(), spell))
{
if (GetHolder()->GetAuraCharges() > 0)
{
if (procEx != PROC_EX_CAST_END && EventProcEx == PROC_EX_NONE)
return false;
}
}
else if (EventProcEx == PROC_EX_NONE && procEx == PROC_EX_CAST_END)
return false;
// if no class mask defined, or spell_proc_event has SpellFamilyName=0 - allow proc // if no class mask defined, or spell_proc_event has SpellFamilyName=0 - allow proc
if (!useClassMask || !mask) if (!useClassMask || !mask)
{ {
@ -868,14 +880,8 @@ bool Aura::CanProcFrom(SpellEntry const *spell, uint32 procFlag, uint32 EventPro
// Check for extra req (if none) and hit/crit // Check for extra req (if none) and hit/crit
if (EventProcEx == PROC_EX_NONE) if (EventProcEx == PROC_EX_NONE)
{ {
// allow proc for modifier auras with charges
if (procEx == PROC_EX_CAST_END
&& IsModifierAura(GetSpellProto(), GetEffIndex())
&& GetHolder()->GetAuraCharges() > 0)
return true;
// No extra req, so can trigger only for active (damage/healing present) and hit/crit // No extra req, so can trigger only for active (damage/healing present) and hit/crit
if((procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && active) if(((procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && active) || procEx == PROC_EX_CAST_END)
return true; return true;
else else
return false; return false;

View file

@ -164,15 +164,36 @@ inline bool IsPeriodicRegenerateEffect(SpellEntry const *spellInfo, SpellEffectI
} }
} }
inline bool IsModifierAura(SpellEntry const *spellInfo, SpellEffectIndex effecIdx) inline bool IsCastEndProcModifierAura(SpellEntry const *spellInfo, SpellEffectIndex effecIdx, SpellEntry const *procSpell)
{ {
// modifier auras that can proc on cast end // modifier auras that can proc on cast end
switch (AuraType(spellInfo->EffectApplyAuraName[effecIdx])) switch (AuraType(spellInfo->EffectApplyAuraName[effecIdx]))
{ {
case SPELL_AURA_ADD_FLAT_MODIFIER: case SPELL_AURA_ADD_FLAT_MODIFIER:
case SPELL_AURA_ADD_PCT_MODIFIER: case SPELL_AURA_ADD_PCT_MODIFIER:
{
switch (spellInfo->EffectMiscValue[effecIdx])
{
case SPELLMOD_RANGE:
case SPELLMOD_RADIUS:
case SPELLMOD_NOT_LOSE_CASTING_TIME:
case SPELLMOD_CASTING_TIME:
case SPELLMOD_COOLDOWN:
case SPELLMOD_COST:
case SPELLMOD_GLOBAL_COOLDOWN:
return true;
default:
break;
}
}
case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE:
return true; {
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
if (IsEffectHandledOnDelayedSpellLaunch(procSpell, SpellEffectIndex(i)))
return true;
return false;
}
default: default:
return false; return false;
} }

View file

@ -9752,10 +9752,14 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
// don't allow proc from cast end for non modifier spells // don't allow proc from cast end for non modifier spells
// unless they have proc ex defined for that // unless they have proc ex defined for that
if (spellProcEvent->procEx == PROC_EX_NONE if (IsCastEndProcModifierAura(triggeredByHolder->GetSpellProto(), SpellEffectIndex(i), procSpell))
&& procExtra == PROC_EX_CAST_END {
&& (!IsModifierAura(triggeredByHolder->GetSpellProto(), SpellEffectIndex(i)) || !useCharges)) if (useCharges && procExtra != PROC_EX_CAST_END && spellProcEvent->procEx == PROC_EX_NONE)
continue;
}
else if (spellProcEvent->procEx == PROC_EX_NONE && procExtra == PROC_EX_CAST_END)
continue; continue;
} }
// don't check dbc FamilyFlags if schoolMask exists // don't check dbc FamilyFlags if schoolMask exists
else if (!triggeredByAura->CanProcFrom(procSpell, procFlag, spellProcEvent->procEx, procExtra, damage != 0, !spellProcEvent->schoolMask)) else if (!triggeredByAura->CanProcFrom(procSpell, procFlag, spellProcEvent->procEx, procExtra, damage != 0, !spellProcEvent->schoolMask))

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11760" #define REVISION_NR "11761"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__