Core/AI: UnitAI trimming part two. WaypointX methods kicked upstairs to CreatureAI

Port From (https://github.com/TrinityCore/TrinityCore/commit/e0afca513a9bfbd82134942e1266e46811707cbb)
This commit is contained in:
hondacrx
2021-04-28 10:58:26 -04:00
parent cb471274e8
commit 5b0391b1d9
4 changed files with 15 additions and 12 deletions
+10
View File
@@ -500,6 +500,16 @@ namespace Game.AI
} }
public virtual void QuestReward(Player player, Quest quest, LootItemType type, uint opt) { } public virtual void QuestReward(Player player, Quest quest, LootItemType type, uint opt) { }
/// == Waypoints system =============================
public virtual void WaypointPathStarted(uint pathId) { }
public virtual void WaypointStarted(uint nodeId, uint pathId) { }
public virtual void WaypointReached(uint nodeId, uint pathId) { }
public virtual void WaypointPathEnded(uint nodeId, uint pathId) { }
public virtual void PassengerBoarded(Unit passenger, sbyte seatId, bool apply) { } public virtual void PassengerBoarded(Unit passenger, sbyte seatId, bool apply) { }
public virtual void OnSpellClick(Unit clicker, ref bool result) { } public virtual void OnSpellClick(Unit clicker, ref bool result) { }
-8
View File
@@ -496,14 +496,6 @@ namespace Game.AI
/// </summary> /// </summary>
public virtual void OnGameEvent(bool start, ushort eventId) { } public virtual void OnGameEvent(bool start, ushort eventId) { }
public virtual void WaypointPathStarted(uint nodeId, uint pathId) { }
public virtual void WaypointStarted(uint nodeId, uint pathId) { }
public virtual void WaypointReached(uint nodeId, uint pathId) { }
public virtual void WaypointPathEnded(uint nodeId, uint pathId) { }
public static AISpellInfoType GetAISpellInfo(uint spellId, Difficulty difficulty) public static AISpellInfoType GetAISpellInfo(uint spellId, Difficulty difficulty)
{ {
return _aiSpellInfo.LookupByKey((spellId, difficulty)); return _aiSpellInfo.LookupByKey((spellId, difficulty));
+3 -2
View File
@@ -390,11 +390,12 @@ namespace Game.AI
return true; return true;
} }
public override void WaypointPathStarted(uint nodeId, uint pathId) public override void WaypointPathStarted(uint pathId)
{ {
if (!HasEscortState(SmartEscortState.Escorting)) if (!HasEscortState(SmartEscortState.Escorting))
{ {
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, nodeId, pathId); // @todo remove the constant 1 at some point, it's never anything different
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, 1, pathId);
return; return;
} }
} }
@@ -59,8 +59,8 @@ namespace Game.Movement
_nextMoveTime.Reset(1000); _nextMoveTime.Reset(1000);
// inform AI // inform AI
if (creature.GetAI() != null) if (creature.IsAIEnabled)
creature.GetAI().WaypointPathStarted(1, _path.id); creature.GetAI().WaypointPathStarted(_path.id);
} }
public override void DoInitialize(Creature creature) public override void DoInitialize(Creature creature)