Core/SmartScripts: implement SMART_ACTION_PLAY_SPELL_VISUAL_KIT
Port From (https://github.com/TrinityCore/TrinityCore/commit/7d999b70a1640b5dbe3042f59463814f13cdc834)
This commit is contained in:
@@ -430,6 +430,16 @@ namespace Game.AI
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsSpellVisualKitValid(SmartScriptHolder e, uint entry)
|
||||
{
|
||||
if (!CliDB.SpellVisualKitStorage.ContainsKey(entry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: Entry {e.entryOrGuid} SourceType {e.GetScriptType()} Event {e.event_id} Action {e.GetActionType()} uses non-existent SpellVisualKit entry {entry}, skipped.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsEventValid(SmartScriptHolder e)
|
||||
{
|
||||
if (e.Event.type >= SmartEvents.End)
|
||||
@@ -862,6 +872,10 @@ namespace Game.AI
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SmartActions.PlaySpellVisualKit:
|
||||
if (e.Action.spellVisualKit.spellVisualKitId != 0 && !IsSpellVisualKitValid(e, e.Action.spellVisualKit.spellVisualKitId))
|
||||
return false;
|
||||
break;
|
||||
case SmartActions.FailQuest:
|
||||
case SmartActions.OfferQuest:
|
||||
if (e.Action.quest.questId == 0 || !IsQuestValid(e, e.Action.quest.questId))
|
||||
@@ -2344,6 +2358,9 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public MovementSpeed movementSpeed;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public SpellVisualKit spellVisualKit;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public Raw raw;
|
||||
|
||||
@@ -2841,6 +2858,12 @@ namespace Game.AI
|
||||
public uint speedInteger;
|
||||
public uint speedFraction;
|
||||
}
|
||||
public struct SpellVisualKit
|
||||
{
|
||||
public uint spellVisualKitId;
|
||||
public uint kitType;
|
||||
public uint duration;
|
||||
}
|
||||
public struct Raw
|
||||
{
|
||||
public uint param1;
|
||||
|
||||
Reference in New Issue
Block a user