aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-11 20:06:02 +0200
committerQAston <none@none>2009-07-11 20:06:02 +0200
commit84644b764412fcf36bd3014fc290b7de5f22f863 (patch)
tree36c3aa239f7c02816aa29563502232a906c9fdc1 /src
parentbf5447b469fe957cb9ba27583d5d7f3b4df5f5b6 (diff)
*Some improvements in procflags:
-handle proc_flag_death -allow trap selection in spell proc event entry for proc_flag_on_trap *Add spell_proc_event entry for Lock and Load - by Bengan *Add spell_proc_event entry for Improved Spell Reflection. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp45
-rw-r--r--src/game/SpellMgr.cpp6
-rw-r--r--src/game/SpellMgr.h2
-rw-r--r--src/game/Unit.cpp13
4 files changed, 35 insertions, 31 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 6cba36d3af1..e946ac80322 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -798,32 +798,29 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura)
{
m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION;
}
- else
+ /*
+ Effects which are result of aura proc from triggered spell cannot proc
+ to prevent chain proc of these spells
+ */
+ if ((triggeredByAura && !triggeredByAura->GetParentAura()->GetTarget()->CanProc()))
{
- /*
- Effects which are result of aura proc from triggered spell cannot proc
- to prevent chain proc of these spells
- */
- if ((triggeredByAura && !triggeredByAura->GetParentAura()->GetTarget()->CanProc()))
- {
- m_canTrigger=false;
- }
+ m_canTrigger=false;
+ }
- // Ranged autorepeat attack is set as triggered spell - ignore it
- if (!(m_procAttacker & PROC_FLAG_SUCCESSFUL_RANGED_HIT))
- {
- if (m_IsTriggeredSpell &&
- (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER ||
- m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2))
- m_procEx |= PROC_EX_INTERNAL_CANT_PROC;
- else if (m_IsTriggeredSpell)
- m_procEx |= PROC_EX_INTERNAL_TRIGGERED;
- }
- // Totem casts require spellfamilymask defined in spell_proc_event to proc
- if (m_originalCaster && m_caster != m_originalCaster && m_caster->GetTypeId()==TYPEID_UNIT && ((Creature*)m_caster)->isTotem() && m_caster->IsControlledByPlayer())
- {
- m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
- }
+ // Ranged autorepeat attack is set as triggered spell - ignore it
+ if (!(m_procAttacker & PROC_FLAG_SUCCESSFUL_RANGED_HIT))
+ {
+ if (m_IsTriggeredSpell &&
+ (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER ||
+ m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2))
+ m_procEx |= PROC_EX_INTERNAL_CANT_PROC;
+ else if (m_IsTriggeredSpell)
+ m_procEx |= PROC_EX_INTERNAL_TRIGGERED;
+ }
+ // Totem casts require spellfamilymask defined in spell_proc_event to proc
+ if (m_originalCaster && m_caster != m_originalCaster && m_caster->GetTypeId()==TYPEID_UNIT && ((Creature*)m_caster)->isTotem() && m_caster->IsControlledByPlayer())
+ {
+ m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
}
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index b5911954ce7..7c71198d3cd 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1324,10 +1324,14 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
&& !(procExtra & PROC_EX_INTERNAL_HOT))
return false;
}
+ // Trap casts are active by default
+ if (procFlags & PROC_FLAG_ON_TRAP_ACTIVATION)
+ active = true;
// Always trigger for this
- if (procFlags & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_ON_TRAP_ACTIVATION))
+ if (procFlags & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_DEATH))
return true;
+
if (spellProcEvent) // Exist event data
{
// Store extra req
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 19ec48bea68..0f2e352fdcd 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -421,7 +421,7 @@ enum ProcFlags
PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 15,17 flags)
PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage
- PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation
+ PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation (possibly needs name change to ON_GAMEOBJECT_CAST or USE)
PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks ( this is probably wrong )
PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000, // 23 Successful off-hand melee attacks ( this is probably wrong )
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4db0b95774d..1be089e66bc 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -2960,7 +2960,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
if (reflectchance > 0 && roll_chance_i(reflectchance))
{
// Start triggers for remove charges if need (trigger only for victim, and mark as active spell)
- ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_SUCCESSFUL_NEGATIVE_MAGIC_SPELL, PROC_EX_REFLECT, 1, BASE_ATTACK, spell);
+ ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_NEGATIVE_MAGIC_SPELL, PROC_EX_REFLECT , 1, BASE_ATTACK, spell);
return SPELL_MISS_REFLECT;
}
}
@@ -7818,7 +7818,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
case 56453:
{
// Proc only from trap activation (from periodic proc another aura of this spell)
- if (!(procFlags & PROC_FLAG_ON_TRAP_ACTIVATION))
+ if (!(procFlags & PROC_FLAG_ON_TRAP_ACTIVATION) || !roll_chance_i(triggerAmount))
return false;
break;
}
@@ -13443,8 +13443,8 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
if (!EventProcFlag)
return false;
- // Additional checks for triggered spells
- if (procExtra & PROC_EX_INTERNAL_TRIGGERED)
+ // Additional checks for triggered spells (ignore trap casts)
+ if (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_ON_TRAP_ACTIVATION))
{
if (!(spellProto->AttributesEx3 & SPELL_ATTR_EX3_CAN_PROC_TRIGGERED))
return false;
@@ -13463,7 +13463,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
if (!allow)
return false;
}
- // Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
+ // Aura added by spell can`t trigger 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)))
@@ -13662,6 +13662,9 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED,PROC_EX_NONE, 0);
}
+ // Proc auras on death - must be before aura/combat remove
+ pVictim->ProcDamageAndSpell(NULL, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, BASE_ATTACK, 0);
+
// if talent known but not triggered (check priest class for speedup check)
bool SpiritOfRedemption = false;
if(pVictim->GetTypeId()==TYPEID_PLAYER && pVictim->getClass()==CLASS_PRIEST )