Core/SAI: Add new action SMART_ACTION_SET_HEALTH_PCT
Port From (https://github.com/TrinityCore/TrinityCore/commit/4c30b2a1827b81774136d37cb521dbd5823c3423)
This commit is contained in:
@@ -2403,6 +2403,17 @@ namespace Game.AI
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.PlayCinematic:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
if (!IsPlayer(target))
|
||||
continue;
|
||||
|
||||
target.ToPlayer().SendCinematicStart(e.Action.cinematic.entry);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetMovementSpeed:
|
||||
{
|
||||
uint speedInteger = e.Action.movementSpeed.speedInteger;
|
||||
@@ -2415,6 +2426,21 @@ namespace Game.AI
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.PlaySpellVisualKit:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
target.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: {target.GetName()} ({target.GetGUID()}), SpellVisualKit: {e.Action.spellVisualKit.spellVisualKitId}");
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.OverrideLight:
|
||||
{
|
||||
WorldObject obj = GetBaseObject();
|
||||
@@ -2444,16 +2470,15 @@ namespace Game.AI
|
||||
target.ToUnit().SetHover(e.Action.setHover.enable != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.PlaySpellVisualKit:
|
||||
case SmartActions.SetHealthPct:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
target.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: {target.GetName()} ({target.GetGUID()}), SpellVisualKit: {e.Action.spellVisualKit.spellVisualKitId}");
|
||||
}
|
||||
Unit targetUnit = target.ToUnit();
|
||||
if (targetUnit != null)
|
||||
targetUnit.SetHealth(targetUnit.CountPctFromMaxHealth((int)e.Action.setHealthPct.percent));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.CreateConversation:
|
||||
@@ -2474,17 +2499,6 @@ namespace Game.AI
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.PlayCinematic:
|
||||
{
|
||||
foreach (WorldObject target in targets)
|
||||
{
|
||||
if (!IsPlayer(target))
|
||||
continue;
|
||||
|
||||
target.ToPlayer().SendCinematicStart(e.Action.cinematic.entry);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.AddToStoredTargetList:
|
||||
{
|
||||
if (!targets.Empty())
|
||||
|
||||
Reference in New Issue
Block a user