Core/SmartScripts: implement SMART_ACTION_PLAY_SPELL_VISUAL_KIT

Port From (https://github.com/TrinityCore/TrinityCore/commit/7d999b70a1640b5dbe3042f59463814f13cdc834)
This commit is contained in:
hondacrx
2019-09-05 12:01:18 -04:00
parent 588d7135b2
commit 981e1e04c1
6 changed files with 60 additions and 1 deletions
@@ -2640,6 +2640,23 @@ namespace Game.AI
break;
}
case SmartActions.PlaySpellVisualKit:
{
var targets = GetTargets(e, unit);
if (targets.Empty())
break;
foreach (var obj in targets)
{
if (IsUnit(obj))
{
obj.ToUnit().SendPlaySpellVisualKit(e.Action.spellVisualKit.spellVisualKitId, e.Action.spellVisualKit.kitType, e.Action.spellVisualKit.duration);
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction:: SMART_ACTION_PLAY_SPELL_VISUAL_KIT: target: {obj.GetName()} ({obj.GetGUID().ToString()}), SpellVisualKit: {e.Action.spellVisualKit.spellVisualKitId}");
}
}
break;
}
default:
Log.outError(LogFilter.Sql, "SmartScript.ProcessAction: Entry {0} SourceType {1}, Event {2}, Unhandled Action type {3}", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;