feature(SmartAI/Movement) - Unify waypoint systems (#23251)

This commit is contained in:
killerwife
2025-10-26 17:52:59 +01:00
committed by GitHub
parent af2cb8d227
commit 6292f80219
71 changed files with 447 additions and 485 deletions

View File

@@ -97,7 +97,7 @@ public:
Talk(SAY_ONSPAWN, 1200ms);
if (action == DATA_ANETHERON)
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
}
void PathEndReached(uint32 pathId) override
@@ -109,7 +109,7 @@ public:
case ALLIANCE_BASE_CHARGE_3:
me->m_Events.AddEventAtOffset([this]()
{
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
}, 1s);
break;
}

View File

@@ -86,7 +86,7 @@ public:
Talk(SAY_ONSPAWN, 1200ms);
if (action == DATA_AZGALOR)
me->GetMotionMaster()->MovePath(HORDE_BOSS_PATH, false);
me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false);
}
void KilledUnit(Unit * victim) override

View File

@@ -106,7 +106,7 @@ public:
Talk(SAY_ONSPAWN, 1200ms);
if (action == DATA_KAZROGAL)
me->GetMotionMaster()->MovePath(HORDE_BOSS_PATH, false);
me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false);
}
void KilledUnit(Unit * victim) override

View File

@@ -101,7 +101,7 @@ public:
Talk(SAY_ONSPAWN, 1200ms);
if (action == DATA_WINTERCHILL)
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
}
void PathEndReached(uint32 pathId) override
@@ -113,7 +113,7 @@ public:
case ALLIANCE_BASE_CHARGE_3:
me->m_Events.AddEventAtOffset([this]()
{
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
}, 1s);
break;
}

View File

@@ -188,7 +188,7 @@ public:
else
{
creature->AI()->Talk(SAY_SUCCESS);
creature->GetMotionMaster()->MovePath(JAINA_RETREAT_PATH, false);
creature->GetMotionMaster()->MoveWaypoint(JAINA_RETREAT_PATH, false);
}
}
return true;
@@ -493,15 +493,15 @@ struct npc_hyjal_ground_trash : public ScriptedAI
case DATA_WINTERCHILL:
case DATA_ANETHERON:
case DATA_ALLIANCE_RETREAT:
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false);
break;
case DATA_KAZROGAL:
case DATA_AZGALOR:
case DATA_HORDE_RETREAT:
me->GetMotionMaster()->MovePath(urand(HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_3), false);
break;
case DATA_ARCHIMONDE:
me->GetMotionMaster()->MovePath(urand(NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_3), false);
break;
}
}
@@ -517,7 +517,7 @@ struct npc_hyjal_ground_trash : public ScriptedAI
case ALLIANCE_BASE_CHARGE_3:
me->m_Events.AddEventAtOffset([this]()
{
me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true);
}, 1s);
break;
case HORDE_BASE_CHARGE_1:
@@ -525,7 +525,7 @@ struct npc_hyjal_ground_trash : public ScriptedAI
case HORDE_BASE_CHARGE_3:
me->m_Events.AddEventAtOffset([this]()
{
me->GetMotionMaster()->MovePath(urand(HORDE_BASE_PATROL_1, HORDE_BASE_PATROL_3), true);
me->GetMotionMaster()->MoveWaypoint(urand(HORDE_BASE_PATROL_1, HORDE_BASE_PATROL_3), true);
}, 1s);
break;
case NIGHT_ELF_BASE_CHARGE_1:
@@ -616,9 +616,9 @@ struct npc_hyjal_gargoyle : public ScriptedAI
case DATA_AZGALOR:
case DATA_HORDE_RETREAT:
if (me->GetPositionX() < 5500.f)
me->GetMotionMaster()->MovePath(urand(GARGOYLE_PATH_FORTRESS_1, GARGOYLE_PATH_FORTRESS_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(GARGOYLE_PATH_FORTRESS_1, GARGOYLE_PATH_FORTRESS_3), false);
else
me->GetMotionMaster()->MovePath(urand(GARGOYLE_PATH_TROLL_CAMP_1, GARGOYLE_PATH_TROLL_CAMP_3), false);
me->GetMotionMaster()->MoveWaypoint(urand(GARGOYLE_PATH_TROLL_CAMP_1, GARGOYLE_PATH_TROLL_CAMP_3), false);
break;
default:
break;
@@ -687,9 +687,9 @@ struct npc_hyjal_frost_wyrm : public ScriptedAI
case DATA_AZGALOR:
case DATA_HORDE_RETREAT:
if (me->GetPositionX() < 5500.f)
me->GetMotionMaster()->MovePath(FROST_WYRM_FORTRESS, false);
me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_FORTRESS, false);
else
me->GetMotionMaster()->MovePath(FROST_WYRM_TROLL_CAMP, false);
me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_TROLL_CAMP, false);
break;
default:
break;
@@ -702,7 +702,7 @@ struct npc_hyjal_frost_wyrm : public ScriptedAI
{
me->m_Events.AddEventAtOffset([this]()
{
me->GetMotionMaster()->MovePath(FROST_WYRM_FORTRESS_PATROL, true);
me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_FORTRESS_PATROL, true);
}, 1s);
}
}

View File

@@ -48,7 +48,7 @@ struct boss_lieutenant_drake : public BossAI
{
runSecondPath = false;
pathId = me->GetEntry() * 10;
me->GetMotionMaster()->MovePath(pathId, false);
me->GetMotionMaster()->MoveWaypoint(pathId, false);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -132,7 +132,7 @@ struct boss_lieutenant_drake : public BossAI
if (runSecondPath)
{
runSecondPath = false;
me->GetMotionMaster()->MovePath(pathId, true);
me->GetMotionMaster()->MoveWaypoint(pathId, true);
}
if (!UpdateVictim())

View File

@@ -126,7 +126,7 @@ public:
Talk(SAY_QUEST_ACCEPTED);
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
me->GetMotionMaster()->MoveWaypoint(PATH_ESCORT, false);
}
}

View File

@@ -92,7 +92,7 @@ struct boss_ayamiss : public BossAI
me->SetReactState(REACT_PASSIVE);
me->SetCanFly(false);
me->SetDisableGravity(false);
me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false);
me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false);
DoResetThreatList();
scheduler.CancelGroup(GROUP_AIR);
});
@@ -291,7 +291,7 @@ class spell_ayamiss_swarmer_teleport_trigger : public SpellScript
uint32 pathId = data.pathId;
caster->m_Events.AddEventAtOffset([caster, pathId]()
{
caster->GetMotionMaster()->MovePath(pathId, false);
caster->GetMotionMaster()->MoveWaypoint(pathId, false);
}, 1s);
}
@@ -361,7 +361,7 @@ public:
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->ToCreature()->GetMotionMaster()->Clear();
GetCaster()->ToCreature()->GetMotionMaster()->MovePath(_pathId, false);
GetCaster()->ToCreature()->GetMotionMaster()->MoveWaypoint(_pathId, false);
}
void Register() override

View File

@@ -188,7 +188,7 @@ struct boss_ossirian : public BossAI
{
if (Creature* vortex = me->SummonCreature(NPC_SAND_VORTEX, pos))
{
vortex->GetMotionMaster()->MovePath(pathIds.front(), true);
vortex->GetMotionMaster()->MoveWaypoint(pathIds.front(), true);
pathIds.reverse();
}
}

View File

@@ -204,7 +204,7 @@ public:
if (me->GetEntry() == NPC_VEM)
{
me->GetMotionMaster()->MovePath(VEM_WAYPOINT_PATH, true);
me->GetMotionMaster()->MoveWaypoint(VEM_WAYPOINT_PATH, true);
}
}

View File

@@ -437,7 +437,7 @@ public:
{
if (Creature* add = instance->GetCreature(*addsAtBase.begin()))
{
add->GetMotionMaster()->MovePath(PATH_ADDS, false);
add->GetMotionMaster()->MoveWaypoint(PATH_ADDS, false);
movedadds.push_back(add->GetGUID());
}