*Update of procflag system:
-Improved holy concentration, Second wind and other spells which can trigger from triggered spells should work correctly now -Allow potions to trigger --HG-- branch : trunk
This commit is contained in:
1 parent
db65f3c111
commit
a731f9a3c0
4 files changed
+31
-43
No files matched your search
+6
-40
@@ -663,47 +663,13 @@ void Spell::FillTargetMap()
|
||||
void Spell::prepareDataForTriggerSystem()
|
||||
{
|
||||
//==========================================================================================
|
||||
// Now fill data for trigger system, need know:
|
||||
// Ñan spell trigger another or not ( m_canTrigger )
|
||||
// Create base triggers flags for Attacker and Victim ( m_procAttacker and m_procVictim)
|
||||
//==========================================================================================
|
||||
// Fill flag can spell trigger or not
|
||||
// TODO: possible exist spell attribute for this
|
||||
m_canTrigger = false;
|
||||
|
||||
if (m_CastItem)
|
||||
m_canTrigger = false; // Do not trigger from item cast spell
|
||||
else if (!m_IsTriggeredSpell)
|
||||
m_canTrigger = true; // Normal cast - can trigger
|
||||
else if (!m_triggeredByAuraSpell)
|
||||
m_canTrigger = true; // Triggered from SPELL_EFFECT_TRIGGER_SPELL - can trigger
|
||||
m_canTrigger = true;
|
||||
|
||||
if (!m_canTrigger) // Exceptions (some periodic triggers)
|
||||
{
|
||||
switch (m_spellInfo->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags[0] & 0x200080) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00008000 || m_spellInfo->SpellFamilyFlags[0] & 0x00000060) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00018000) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE: // For poisons need do it
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00000010 || m_spellInfo->SpellFamilyFlags[0] & 0x1001E000) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot/Freezing Trap Effect
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x01002000
|
||||
|| m_spellInfo->SpellFamilyFlags[0] & 0x0000021C ||
|
||||
m_spellInfo->SpellFamilyFlags[2] & 0x200) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x00010009 || m_spellInfo->SpellFamilyFlags[0] & 0x00B80400) m_canTrigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m_CastItem && m_spellInfo->SpellFamilyName != SPELLFAMILY_POTION)
|
||||
m_canTrigger = false; // Do not trigger from item cast spell(except potions)
|
||||
|
||||
// Get data for type of attack and fill base info for trigger
|
||||
switch (m_spellInfo->DmgClass)
|
||||
@@ -944,7 +910,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
// Fill base trigger info
|
||||
uint32 procAttacker = m_procAttacker;
|
||||
uint32 procVictim = m_procVictim;
|
||||
uint32 procEx = PROC_EX_NONE;
|
||||
uint32 procEx = m_triggeredByAuraSpell || m_CastItem ? PROC_EX_INTERNAL_TRIGGERED : PROC_EX_NONE;
|
||||
m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
|
||||
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
@@ -1011,7 +977,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
// Send log damage message to client
|
||||
caster->SendSpellNonMeleeDamageLog(&damageInfo);
|
||||
|
||||
procEx = createProcExtendMask(&damageInfo, missInfo);
|
||||
procEx |= createProcExtendMask(&damageInfo, missInfo);
|
||||
procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||
|
||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
@@ -1035,7 +1001,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
{
|
||||
// Fill base damage struct (unitTarget - is real spell target)
|
||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||
procEx = createProcExtendMask(&damageInfo, missInfo);
|
||||
procEx |= createProcExtendMask(&damageInfo, missInfo);
|
||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo);
|
||||
|
||||
Reference in new issue
Block a user