fix(Core/Unit): rework Walk/Run mode (#22988)

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
killerwife
2025-10-14 22:54:19 +02:00
committed by GitHub
parent c28f635408
commit 10d5a3c553
104 changed files with 373 additions and 362 deletions

View File

@@ -507,7 +507,7 @@ struct boss_illidan_stormrage : public BossAI
Talk(SAY_ILLIDAN_EYE_BLAST);
me->SummonCreature(NPC_ILLIDAN_DB_TARGET, eyeBeamPos[beamPosId], TEMPSUMMON_TIMED_DESPAWN, 30000);
if (Creature* trigger = summons.GetCreatureWithEntry(NPC_ILLIDAN_DB_TARGET))
trigger->GetMotionMaster()->MovePoint(0, eyeBeamPos[beamPosId + MAX_EYE_BEAM_POS], false, true);
trigger->GetMotionMaster()->MovePoint(0, eyeBeamPos[beamPosId + MAX_EYE_BEAM_POS], FORCED_MOVEMENT_NONE, 0.f, false, true);
// Reposition
me->m_Events.AddEventAtOffset([&] {
@@ -515,7 +515,7 @@ struct boss_illidan_stormrage : public BossAI
me->InterruptNonMeleeSpells(false);
me->SetControlled(false, UNIT_STATE_ROOT);
CycleBeamPos(beamPosId);
me->GetMotionMaster()->MovePoint(POINT_ILLIDAN_HOVER, airHoverPos[beamPosId], false, true);
me->GetMotionMaster()->MovePoint(POINT_ILLIDAN_HOVER, airHoverPos[beamPosId], FORCED_MOVEMENT_NONE, 0.f, false, true);
}, 20s, GROUP_PHASE_FLYING);
});
// Check for Phase Transition

View File

@@ -301,7 +301,7 @@ public:
Talk(SUFF_SAY_RECAP);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false);
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, false);
scheduler.CancelAll();
}
}
@@ -408,7 +408,7 @@ public:
Talk(DESI_SAY_RECAP);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false);
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, false);
scheduler.CancelAll();
}
}

View File

@@ -139,7 +139,7 @@ struct boss_fathomlord_karathress : public BossAI
if (Creature* olum = instance->GetCreature(DATA_SEER_OLUM))
{
olum->SetWalk(true);
olum->GetMotionMaster()->MovePoint(0, olumWalk, false);
olum->GetMotionMaster()->MovePoint(0, olumWalk, FORCED_MOVEMENT_NONE, 0.f, false);
olum->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
olum->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
}

View File

@@ -93,7 +93,7 @@ struct boss_lady_vashj : public BossAI
scheduler.CancelAll();
me->CastStop();
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true);
me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, true, true);
});
}

View File

@@ -102,7 +102,7 @@ struct boss_vazruden_the_herald : public BossAI
if (summon->GetEntry() == NPC_HELLFIRE_SENTRY && summons.size() == 0)
{
Talk(SAY_INTRO);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 85.0f, false);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 85.0f, FORCED_MOVEMENT_NONE, 0.f, false);
_JustEngagedWith();
}
else if (summons.size() == 0)
@@ -163,7 +163,7 @@ struct boss_nazan : public ScriptedAI
_scheduler.CancelAll();
_scheduler.Schedule(5ms, GROUP_PHASE_1, [this](TaskContext context)
{
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, NazanPos[urand(0, 2)], false);
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, NazanPos[urand(0, 2)], FORCED_MOVEMENT_NONE, 0.f, false);
_scheduler.DelayAll(7s);
context.Repeat(30s);
}).Schedule(5s, GROUP_PHASE_1, [this](TaskContext context)
@@ -193,7 +193,7 @@ struct boss_nazan : public ScriptedAI
Talk(EMOTE_NAZAN);
me->SetReactState(REACT_PASSIVE);
me->InterruptNonMeleeSpells(true);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, false);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, FORCED_MOVEMENT_NONE, 0.f, false);
}
}

View File

@@ -140,7 +140,7 @@ struct boss_alar : public BossAI
_noQuillTimes = 0;
_platformRoll = RAND(0, 1);
_platform = _platformRoll ? 0 : 3;
me->GetMotionMaster()->MovePoint(POINT_QUILL, alarPoints[POINT_QUILL], false, true);
me->GetMotionMaster()->MovePoint(POINT_QUILL, alarPoints[POINT_QUILL], FORCED_MOVEMENT_NONE, 0.f, false, true);
_platformMoveRepeatTimer = 16s;
}
else
@@ -150,7 +150,7 @@ struct boss_alar : public BossAI
me->SetOrientation(alarPoints[_platform].GetOrientation());
SpawnPhoenixes(1, me);
}
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], false, true);
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], FORCED_MOVEMENT_NONE, 0.f, false, true);
_platform = (_platform+1)%4;
_platformMoveRepeatTimer = 30s;
}
@@ -258,7 +258,7 @@ struct boss_alar : public BossAI
}, 30s);
ScheduleTimedEvent(34s, [&]
{
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true);
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], FORCED_MOVEMENT_NONE, 0.f, false, true);
scheduler.DelayAll(15s);
}, 57s);

View File

@@ -655,7 +655,7 @@ struct boss_kaelthas : public BossAI
me->AttackStop();
me->CastStop();
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), true, true);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, true, true);
}
});
ScheduleTimedEvent(1s, [&]

View File

@@ -171,7 +171,7 @@ public:
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
{
if (creature->GetOwner() && creature->GetOwner()->IsPlayer())
Start(false, false, creature->GetOwner()->GetGUID());
Start(false, creature->GetOwner()->GetGUID());
creature->SetSpeed(MOVE_WALK, 1.5f);
DoCast(SPELL_GUIDED_BY_THE_SPIRITS);
Reset();
@@ -209,7 +209,7 @@ public:
{
ryga->SetWalk(true);
ryga->SetSpeed(MOVE_WALK, 1.0f);
ryga->GetMotionMaster()->MovePoint(0, 515.877991f, 3885.67627f, 190.470535f, true);
ryga->GetMotionMaster()->MovePoint(0, 515.877991f, 3885.67627f, 190.470535f, FORCED_MOVEMENT_NONE, 0.f, true);
Reset();
}
}
@@ -234,7 +234,7 @@ public:
ryga->SetStandState(UNIT_STAND_STATE_STAND);
ryga->SetWalk(true);
ryga->SetSpeed(MOVE_WALK, 1.0f);
ryga->GetMotionMaster()->MovePoint(0, 504.59201f, 3882.12988f, 192.156006f, true);
ryga->GetMotionMaster()->MovePoint(0, 504.59201f, 3882.12988f, 192.156006f, FORCED_MOVEMENT_NONE, 0.f, true);
Reset();
}
}
@@ -312,7 +312,7 @@ public:
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
npc_escortAI::Start(true, false, player->GetGUID());
npc_escortAI::Start(true, player->GetGUID());
}
}

View File

@@ -65,7 +65,7 @@ public:
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE);
EscortAI->Start(true, false, player->GetGUID(), quest);
EscortAI->Start(true, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START);
creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0] + 2.5f, m_afAmbushA[1] - 2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -133,7 +133,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun();
SetRun(true);
break;
}
}
@@ -306,7 +306,7 @@ public:
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{
me->SetStandState(UNIT_STAND_STATE_STAND);
Start(true, false, guid);
Start(true, guid);
Talk(SAY_KUR_START);
me->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0] + 2.5f, kurenaiAmbushA[1] - 2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
@@ -361,7 +361,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun();
SetRun(true);
break;
}
}

View File

@@ -103,7 +103,8 @@ public:
{
if (type == DATA_START_ENCOUNTER)
{
Start(true, true, playerGUID);
me->SetWalk(false);
Start(true, playerGUID);
SetEscortPaused(true);
started = true;
@@ -605,7 +606,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->AI()->Talk(SAY_BESSY_0);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
}
@@ -771,7 +772,7 @@ public:
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
{
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
pEscortAI->Start(false, false, player->GetGUID());
pEscortAI->Start(false, player->GetGUID());
}
}
return true;

View File

@@ -617,7 +617,7 @@ public:
{
case EVENT_WALK_TO_MUTTON:
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(1, x, y, z, true);
me->GetMotionMaster()->MovePoint(1, x, y, z);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
break;

View File

@@ -246,7 +246,7 @@ public:
Player* player = summoner->ToPlayer();
if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
Start(false, false, summoner->GetGUID());
Start(false, summoner->GetGUID());
}
void Reset() override { }

View File

@@ -473,7 +473,7 @@ public:
{
if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
{
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
}
return true;