mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Spells: allow more proc hooks to trigger when a owned unit casts a spell
This commit is contained in:
@@ -2599,6 +2599,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
DamageInfo spellNoDamageInfo(damageInfo, NODAMAGE, m_attackType, hitMask);
|
||||
caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_NO_DMG_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, &spellNoDamageInfo, nullptr);
|
||||
|
||||
// Controlled units should trigger procs for their owner as well
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
owner->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_NO_DMG_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, &spellNoDamageInfo, nullptr);
|
||||
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && !m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS) &&
|
||||
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
|
||||
caster->ToPlayer()->CastItemCombatSpell(spellNoDamageInfo);
|
||||
@@ -3560,6 +3564,10 @@ void Spell::_cast(bool skipCheck)
|
||||
|
||||
m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
|
||||
|
||||
// Controlled units should trigger procs for their owner as well
|
||||
if (Unit* owner = m_originalCaster->GetOwner())
|
||||
owner->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
|
||||
|
||||
// Call CreatureAI hook OnSuccessfulSpellCast
|
||||
if (Creature* caster = m_originalCaster->ToCreature())
|
||||
if (caster->IsAIEnabled)
|
||||
|
||||
Reference in New Issue
Block a user