Core/Spells: Implement SPELL_EFFECT_TRIGGER_SPELL delay (stored in MiscValue)

Port From (https://github.com/TrinityCore/TrinityCore/commit/c65340e76143f1a160f0eed83062e74b47e7b3f2)
This commit is contained in:
hondacrx
2022-03-10 13:43:20 -05:00
parent b9caad7455
commit a66b74cfa2
+9 -2
View File
@@ -299,6 +299,10 @@ namespace Game.Spells
}
}
TimeSpan delay = TimeSpan.Zero;
if (effectInfo.Effect == SpellEffectName.TriggerSpell)
delay = TimeSpan.FromMilliseconds(effectInfo.MiscValue);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SetOriginalCaster(m_originalCasterGUID);
args.SetOriginalCastId(m_castId);
@@ -307,8 +311,11 @@ namespace Game.Spells
for (int i = 0; i < SpellConst.MaxEffects; ++i)
args.AddSpellMod(SpellValueMod.BasePoint0 + i, damage);
// original caster guid only for GO cast
m_caster.CastSpell(targets, spellInfo.Id, args);
m_caster.m_Events.AddEventAtOffset(() =>
{
// original caster guid only for GO cast
m_caster.CastSpell(targets, triggered_spell_id, args);
}, delay);
}
[SpellEffectHandler(SpellEffectName.TriggerMissile)]