Core/SAI: Support gameobject targets for SMART_ACTION_PLAY_ANIMKIT
Port From (https://github.com/TrinityCore/TrinityCore/commit/b8246d1ba76cabcd034b60b806505f1a5a87465f)
This commit is contained in:
@@ -2231,14 +2231,24 @@ namespace Game.AI
|
|||||||
target.ToCreature().SetMeleeAnimKitId((ushort)e.Action.animKit.animKit);
|
target.ToCreature().SetMeleeAnimKitId((ushort)e.Action.animKit.animKit);
|
||||||
else if (e.Action.animKit.type == 3)
|
else if (e.Action.animKit.type == 3)
|
||||||
target.ToCreature().SetMovementAnimKitId((ushort)e.Action.animKit.animKit);
|
target.ToCreature().SetMovementAnimKitId((ushort)e.Action.animKit.animKit);
|
||||||
else
|
|
||||||
|
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript::ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: {target.GetName()} ({target.GetGUID()}), AnimKit: {e.Action.animKit.animKit}, Type: {e.Action.animKit.type}");
|
||||||
|
}
|
||||||
|
else if(IsGameObject(target))
|
||||||
|
{
|
||||||
|
switch (e.Action.animKit.type)
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Sql, "SmartScript: Invalid type for SMART_ACTION_PLAY_ANIMKIT, skipping");
|
case 0:
|
||||||
break;
|
target.ToGameObject().SetAnimKitId((ushort)e.Action.animKit.animKit, true);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
target.ToGameObject().SetAnimKitId((ushort)e.Action.animKit.animKit, false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: {0} ({1}), AnimKit: {2}, Type: {3}",
|
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: {0} ({1}), AnimKit: {2}, Type: {3}", target.GetName(), target.GetGUID().ToString(), e.Action.animKit.animKit, e.Action.animKit.type);
|
||||||
target.GetName(), target.GetGUID().ToString(), e.Action.animKit.animKit, e.Action.animKit.type);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user