Core/SAI: Allow update of disable gravity/root applied via static flags (using related action type)

Port From (https://github.com/TrinityCore/TrinityCore/commit/2cf2535cd637b5b8966f7990f6826bdac94d77ce)
This commit is contained in:
Hondacrx
2025-02-23 14:26:44 -05:00
parent 73f414fc90
commit 6a24e9ce29
2 changed files with 4 additions and 10 deletions
-5
View File
@@ -770,11 +770,6 @@ namespace Game.AI
_run = run;
}
public void SetDisableGravity(bool disable = true)
{
me.SetDisableGravity(disable);
}
public void SetEvadeDisabled(bool disable)
{
_evadeDisabled = disable;
+4 -5
View File
@@ -1228,10 +1228,9 @@ namespace Game.AI
}
case SmartActions.SetDisableGravity:
{
if (!IsSmart())
break;
((SmartAI)_me.GetAI()).SetDisableGravity(e.Action.setDisableGravity.disable != 0);
foreach (WorldObject target in targets)
if (IsCreature(target))
target.ToCreature().SetFloating(e.Action.setDisableGravity.disable != 0);
break;
}
case SmartActions.SetRun:
@@ -1980,7 +1979,7 @@ namespace Game.AI
{
foreach (var target in targets)
if (IsCreature(target))
target.ToCreature().SetControlled(e.Action.setRoot.root != 0, UnitState.Root);
target.ToCreature().SetSessile(e.Action.setRoot.root != 0);
break;
}
case SmartActions.SummonCreatureGroup: