*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
This commit is contained in:
QAston
2009-07-11 20:06:02 +02:00
parent bf5447b469
commit 84644b7644
6 changed files with 47 additions and 35 deletions
+6 -4
View File
@@ -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 ( 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 ( 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 ( 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 ( 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 ( 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 ( 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 ( 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 ( 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 ( 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 -- ENCHANT PROC
@@ -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
-3
View File
@@ -798,8 +798,6 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura)
{ {
m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION; m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION;
} }
else
{
/* /*
Effects which are result of aura proc from triggered spell cannot proc Effects which are result of aura proc from triggered spell cannot proc
to prevent chain proc of these spells to prevent chain proc of these spells
@@ -825,7 +823,6 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura)
m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY; m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
} }
} }
}
void Spell::CleanupTargetList() void Spell::CleanupTargetList()
{ {
+5 -1
View File
@@ -1324,10 +1324,14 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
&& !(procExtra & PROC_EX_INTERNAL_HOT)) && !(procExtra & PROC_EX_INTERNAL_HOT))
return false; return false;
} }
// Trap casts are active by default
if (procFlags & PROC_FLAG_ON_TRAP_ACTIVATION)
active = true;
// Always trigger for this // 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; return true;
if (spellProcEvent) // Exist event data if (spellProcEvent) // Exist event data
{ {
// Store extra req // Store extra req
+1 -1
View File
@@ -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_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_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_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 ) PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000, // 23 Successful off-hand melee attacks ( this is probably wrong )
+8 -5
View File
@@ -2960,7 +2960,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
if (reflectchance > 0 && roll_chance_i(reflectchance)) if (reflectchance > 0 && roll_chance_i(reflectchance))
{ {
// Start triggers for remove charges if need (trigger only for victim, and mark as active spell) // 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; return SPELL_MISS_REFLECT;
} }
} }
@@ -7818,7 +7818,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
case 56453: case 56453:
{ {
// Proc only from trap activation (from periodic proc another aura of this spell) // 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; return false;
break; break;
} }
@@ -13443,8 +13443,8 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
if (!EventProcFlag) if (!EventProcFlag)
return false; return false;
// Additional checks for triggered spells // Additional checks for triggered spells (ignore trap casts)
if (procExtra & PROC_EX_INTERNAL_TRIGGERED) if (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_ON_TRAP_ACTIVATION))
{ {
if (!(spellProto->AttributesEx3 & SPELL_ATTR_EX3_CAN_PROC_TRIGGERED)) if (!(spellProto->AttributesEx3 & SPELL_ATTR_EX3_CAN_PROC_TRIGGERED))
return false; return false;
@@ -13463,7 +13463,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
if (!allow) if (!allow)
return false; 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) // But except periodic and kill triggers (can triggered from self)
if(procSpell && procSpell->Id == spellProto->Id 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)))
@@ -13662,6 +13662,9 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED,PROC_EX_NONE, 0); 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) // if talent known but not triggered (check priest class for speedup check)
bool SpiritOfRedemption = false; bool SpiritOfRedemption = false;
if(pVictim->GetTypeId()==TYPEID_PLAYER && pVictim->getClass()==CLASS_PRIEST ) if(pVictim->GetTypeId()==TYPEID_PLAYER && pVictim->getClass()==CLASS_PRIEST )