aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_spell_full.sql10
-rw-r--r--sql/updates/4428_world_spell_proc_event.sql6
-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
6 files changed, 47 insertions, 35 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql
index 31dc21bce19..eee91a80ba1 100644
--- a/sql/FULL/world_spell_full.sql
+++ b/sql/FULL/world_spell_full.sql
@@ -1326,9 +1326,6 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 55776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Swordguard Embroidery
( 56218, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Corruption
( 56249, 0x00, 5, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Felhunter
-( 56342, 0x00, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load (Rank 1)
-( 56343, 0x00, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load (Rank 2)
-( 56344, 0x00, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load (Rank 3)
( 56355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Titanium Shield Spike
( 56364, 0x00, 3, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Remove Curse
( 56372, 0x00, 3, 0x00000000, 0x00000080, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Glyph of Ice Block
@@ -1508,7 +1505,12 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 49655, 0x00, 15, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0, 0, 1), -- Wandering Plague
( 49137, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Endless Winter
( 49657, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Endless Winter
-( 58620, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Glyph of Chains of Ice
+( 58620, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Chains of Ice
+( 59725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Improved Spell Reflection
+( 56342, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load
+( 56343, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load
+( 56344, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0); -- Lock and Load
+
-- --------
-- ENCHANT PROC
diff --git a/sql/updates/4428_world_spell_proc_event.sql b/sql/updates/4428_world_spell_proc_event.sql
new file mode 100644
index 00000000000..bedb7cabe28
--- /dev/null
+++ b/sql/updates/4428_world_spell_proc_event.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (56342, 56343, 56344, 59725);
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+( 59725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Improved Spell Reflection
+( 56342, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load
+( 56343, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load
+( 56344, 0x00, 9, 0x00000018, 0x08000000, 0x00020000, 0x00000000, 0x00000000, 0, 0, 0); -- Lock and Load
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 )