Core/SmartAI: allow AreaTrigger SAI scripts to use the player triggering it as base object for actions and targeting

Port From (https://github.com/TrinityCore/TrinityCore/commit/1ddde5ca3cac8ac03239882778af3702b59d582d)
This commit is contained in:
hondacrx
2022-02-23 16:28:32 -05:00
parent 475600daa9
commit bbc0c07697
5 changed files with 60 additions and 107 deletions
+2 -2
View File
@@ -706,7 +706,7 @@ namespace Game.AI
void _JustEngagedWith()
{
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 0.0f, true);
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 0.0f, true);
if (target)
AttackStart(target);
}
@@ -714,7 +714,7 @@ namespace Game.AI
public override void JustSummoned(Creature summon)
{
summons.Summon(summon);
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 0.0f, true);
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 0.0f, true);
if (target)
summon.GetAI().AttackStart(target);
}