*Fix dead loop in proc system.
*Fix curse of doom. --HG-- branch : trunk
This commit is contained in:
@@ -274,7 +274,6 @@ class Spell
|
||||
void EffectDualWield(uint32 i);
|
||||
void EffectPickPocket(uint32 i);
|
||||
void EffectAddFarsight(uint32 i);
|
||||
void EffectSummonWild(uint32 i);
|
||||
void EffectHealMechanical(uint32 i);
|
||||
void EffectJump(uint32 i);
|
||||
void EffectJump2(uint32 i);
|
||||
|
||||
+26
-12
@@ -4593,6 +4593,20 @@ void AuraEffect::HandlePeriodicDamage(bool apply, bool Real, bool changeAmount)
|
||||
// For prevent double apply bonuses
|
||||
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
|
||||
|
||||
// Curse of Doom
|
||||
// This is a hack - this aura should be handled by passive aura and proc doomguard spawn on kill, however there is no such aura in dbcs
|
||||
if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags.IsEqual(0,0x02,0))
|
||||
{
|
||||
if (Real && !apply && GetParentAura()->GetRemoveMode()==AURA_REMOVE_BY_DEATH)
|
||||
{
|
||||
if (Unit * caster = GetCaster())
|
||||
{
|
||||
if (caster->GetTypeId()==TYPEID_PLAYER && ((Player*)caster)->isHonorOrXPTarget(m_target))
|
||||
caster->CastSpell(m_target, 18662, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Custom damage calculation after
|
||||
if (!apply || loading)
|
||||
return;
|
||||
@@ -5994,9 +6008,9 @@ void AuraEffect::PeriodicTick()
|
||||
SpellEntry const* spellProto = GetSpellProto();
|
||||
|
||||
// Set trigger flag
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT;
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_DOT;
|
||||
pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist);
|
||||
if (pdamage)
|
||||
procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||
@@ -6059,9 +6073,9 @@ void AuraEffect::PeriodicTick()
|
||||
int32 stackAmount = GetParentAura()->GetStackAmount();
|
||||
|
||||
// Set trigger flag
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT;
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_DOT;
|
||||
pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist);
|
||||
if (pdamage)
|
||||
procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||
@@ -6184,9 +6198,9 @@ void AuraEffect::PeriodicTick()
|
||||
}
|
||||
}
|
||||
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_HEALING_SPELL;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEALING_SPELL;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT;
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC;
|
||||
uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_HOT;
|
||||
// ignore item heals
|
||||
if(!haveCastItem)
|
||||
pCaster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, pdamage, BASE_ATTACK, spellProto);
|
||||
@@ -6381,9 +6395,9 @@ void AuraEffect::PeriodicTick()
|
||||
pCaster->SendSpellNonMeleeDamageLog(&damageInfo);
|
||||
|
||||
// Set trigger flag
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT;
|
||||
uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE);
|
||||
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;
|
||||
uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC;
|
||||
uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE) | PROC_EX_INTERNAL_DOT;
|
||||
if (damageInfo.damage)
|
||||
procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||
|
||||
|
||||
@@ -3364,6 +3364,8 @@ void Spell::EffectSummonType(uint32 i)
|
||||
float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
int32 amount = damage > 0 ? damage : 1;
|
||||
if (m_spellInfo->Id == 18662) // Curse of Doom
|
||||
amount = 1;
|
||||
|
||||
for(int32 count = 0; count < amount; ++count)
|
||||
{
|
||||
@@ -6655,8 +6657,6 @@ void Spell::SummonGuardian(uint32 entry, SummonPropertiesEntry const *properties
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 1122: // Inferno
|
||||
case 18662: // Curse of Doom
|
||||
amount = 1;
|
||||
break;
|
||||
}
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
|
||||
@@ -1275,11 +1275,11 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
|
||||
{
|
||||
if (EventProcFlag & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT)
|
||||
{
|
||||
if (!(procFlags & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT))
|
||||
if (!(procEx & PROC_EX_INTERNAL_DOT))
|
||||
return false;
|
||||
}
|
||||
else if (EventProcFlag & PROC_FLAG_SUCCESSFUL_HEALING_SPELL
|
||||
&& !(procFlags & PROC_FLAG_SUCCESSFUL_HEALING_SPELL))
|
||||
&& !(procEx & PROC_EX_INTERNAL_HOT))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1287,11 +1287,11 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
|
||||
{
|
||||
if (EventProcFlag & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT)
|
||||
{
|
||||
if (!(procFlags & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT))
|
||||
if (!(procEx & PROC_EX_INTERNAL_DOT))
|
||||
return false;
|
||||
}
|
||||
else if (EventProcFlag & PROC_FLAG_TAKEN_HEALING_SPELL
|
||||
&& !(procFlags & PROC_FLAG_TAKEN_HEALING_SPELL))
|
||||
&& !(procEx & PROC_EX_INTERNAL_HOT))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13368,7 +13368,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
|
||||
// Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
|
||||
// But except periodic and kill triggers (can triggered from self)
|
||||
if(procSpell && procSpell->Id == spellProto->Id
|
||||
&& !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_KILL))
|
||||
&& !(spellProto->procFlags&(PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_KILL)))
|
||||
return false;
|
||||
|
||||
// Check if current equipment allows aura to proc
|
||||
|
||||
Reference in New Issue
Block a user