mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 23:38:54 -04:00
*Update to Mangos 7100.
--HG-- branch : trunk
This commit is contained in:
+27
-9
@@ -624,15 +624,19 @@ void Spell::prepareDataForTriggerSystem()
|
||||
// Ñ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
|
||||
if (!m_IsTriggeredSpell)
|
||||
// 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
|
||||
else // Exceptions (some periodic triggers)
|
||||
|
||||
if (!m_canTrigger) // Exceptions (some periodic triggers)
|
||||
{
|
||||
m_canTrigger = false; // Triggered spells can`t trigger another
|
||||
switch (m_spellInfo->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
|
||||
@@ -644,17 +648,17 @@ void Spell::prepareDataForTriggerSystem()
|
||||
case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0001800000000000LL) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER: // Hunter Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0000200000000014LL) m_canTrigger = true;
|
||||
case SPELLFAMILY_ROGUE: // For poisons need do it
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x000000101001E000LL) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0100200000000014LL) m_canTrigger = true;
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN: // For Holy Shock triggers need do it
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0001000000200000LL) m_canTrigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Do not trigger from item cast spell
|
||||
if (m_CastItem)
|
||||
m_canTrigger = false;
|
||||
|
||||
// Get data for type of attack and fill base info for trigger
|
||||
switch (m_spellInfo->DmgClass)
|
||||
@@ -3626,6 +3630,20 @@ uint8 Spell::CanCast(bool strict)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_caster->GetTypeId()==TYPEID_PLAYER) // Target - is player caster
|
||||
{
|
||||
// Additional check for some spells
|
||||
// If 0 spell effect empty - client not send target data (need use selection)
|
||||
// TODO: check it on next client version
|
||||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->Effect[0] == 0 && m_spellInfo->EffectImplicitTargetA[1] != TARGET_SELF)
|
||||
{
|
||||
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
}
|
||||
|
||||
// check pet presents
|
||||
for(int j=0;j<3;j++)
|
||||
|
||||
Reference in New Issue
Block a user