aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-15 17:15:19 +0200
committerQAston <none@none>2009-06-15 17:15:19 +0200
commit425863abd9e59b55bfaf75fa61ebf9bec69acbc1 (patch)
tree469e677d3ecafec52adf985b8b5a5be3e57ea627
parentf53b049759b052bf3903ea1daa1893a3b68331a8 (diff)
*Fix dead loop in proc system.
*Fix curse of doom. --HG-- branch : trunk
-rw-r--r--src/game/Spell.h1
-rw-r--r--src/game/SpellAuras.cpp38
-rw-r--r--src/game/SpellEffects.cpp4
-rw-r--r--src/game/SpellMgr.cpp8
-rw-r--r--src/game/Unit.cpp2
5 files changed, 33 insertions, 20 deletions
diff --git a/src/game/Spell.h b/src/game/Spell.h
index 5309d881990..9f666ecf47b 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -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);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2cba7a7344c..bc7c07768d6 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -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;
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 5506ec0dab1..f29c883a5f4 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -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);
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index cc9dcfb14e4..7ab580e3042 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -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;
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 408bf62f224..38963dc51d5 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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