Game/AI: Implement option to move a creature back to Homeposition on Evade.

Port From (https://github.com/TrinityCore/TrinityCore/commit/dfeb8c267f94f6a2b2ebe717fd43c5d4fd36a549)
This commit is contained in:
hondacrx
2022-05-04 09:29:44 -04:00
parent 52ce6b2700
commit ecb3f5f857
2 changed files with 14 additions and 0 deletions
@@ -711,6 +711,13 @@ namespace Game.AI
if (_me == null)
break;
// Reset home position to respawn position if specified in the parameters
if (e.Action.evade.toRespawnPosition == 0)
{
_me.GetRespawnPosition(out float homeX, out float homeY, out float homeZ, out float homeO);
_me.SetHomePosition(homeX, homeY, homeZ, homeO);
}
_me.GetAI().EnterEvadeMode();
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_EVADE: Creature {0} EnterEvadeMode", _me.GetGUID().ToString());
break;