Core/Spells: SPELL_AURA_48 implementation

Port From (https://github.com/TrinityCore/TrinityCore/commit/37178ff311af95c4a2035a38839b5e8a9afe2af5)
This commit is contained in:
hondacrx
2022-01-06 00:17:58 -05:00
parent a4ace1e181
commit e89a36a232
6 changed files with 162 additions and 117 deletions
+22 -5
View File
@@ -677,13 +677,30 @@ namespace Game
return;
}
// do not cast not learned spells
if (!caster.HasSpell(spellInfo.Id) || spellInfo.IsPassive())
return;
SpellCastTargets targets = new(caster, petCastSpell.Cast);
Spell spell = new(caster, spellInfo, TriggerCastFlags.None);
TriggerCastFlags triggerCastFlags = TriggerCastFlags.None;
if (spellInfo.IsPassive())
return;
// cast only learned spells
if (!caster.HasSpell(spellInfo.Id))
{
bool allow = false;
// allow casting of spells triggered by clientside periodic trigger auras
if (caster.HasAuraTypeWithTriggerSpell(AuraType.PeriodicTriggerSpellFromClient, spellInfo.Id))
{
allow = true;
triggerCastFlags = TriggerCastFlags.FullMask;
}
if (!allow)
return;
}
Spell spell = new(caster, spellInfo, triggerCastFlags);
spell.m_fromClient = true;
spell.m_misc.Data0 = petCastSpell.Cast.Misc[0];
spell.m_misc.Data1 = petCastSpell.Cast.Misc[1];