fix(Core/Scripts): Fix the wrong run in npc_escortAI (#23293)

Co-authored-by: 天鹭 <18535853+PkllonG@users.noreply.github.com>
This commit is contained in:
killerwife 2025-10-24 08:43:18 +02:00 committed by GitHub
parent 0779ece252
commit a8d07b669d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 120 additions and 75 deletions

View file

@ -552,11 +552,6 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO
}
}
void ScriptedAI::SetRun(bool run)
{
me->SetWalk(!run);
}
enum eNPCs
{
NPC_BROODLORD = 12017,

View file

@ -227,8 +227,6 @@ struct ScriptedAI : public CreatureAI
// Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool /*apply*/) {}
void SetRun(bool run);
enum class Axis
{
AXIS_X,

View file

@ -49,6 +49,8 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mForcedPaused = false;
mForcedMovement = FORCED_MOVEMENT_NONE;
mEscortQuestID = 0;
mDespawnTime = 0;
@ -205,6 +207,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
{
AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat;
mForcedMovement = forcedMovement;
if (invoker && invoker->IsPlayer())
{
@ -215,7 +218,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
}
}
@ -373,7 +376,7 @@ void SmartAI::ResumePath()
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
}
}

View file

@ -241,6 +241,7 @@ private:
bool mCanAutoAttack;
bool mForcedPaused;
uint32 mInvincibilityHpLevel;
ForcedMovement mForcedMovement;
bool AssistPlayerInCombatAgainst(Unit* who);

View file

@ -359,6 +359,7 @@ public:
case 0:
Talk(SAY_TEXT5);
HandleGameObject(DATA_ARENA4, false);
me->SetWalk(true);
Start(false);
eventTimer = 0;
break;
@ -604,7 +605,10 @@ public:
creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false);
}
}
}

View file

@ -170,6 +170,7 @@ public:
if (m_uiEventId == EVENT_OZ)
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
me->SetWalk(true);
Start(false);
}

View file

@ -980,6 +980,7 @@ public:
{
carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint();
me->SetWalk(true);
Start(false, who->GetGUID());
SetDespawnAtFar(false);
}
@ -998,7 +999,7 @@ public:
car->SetFaction(FACTION_FRIENDLY);
}
Talk(SAY_SCARLET_MINER_0);
SetRun(true);
me->SetWalk(false);
IntroTimer = 4000;
IntroPhase = 1;
break;

View file

@ -78,7 +78,7 @@ public:
break;
case 11:
Talk(SAY_PROGRESS_6, player);
SetRun(true);
me->SetWalk(false);
break;
case 19:
Talk(SAY_PROGRESS_7, player);
@ -106,7 +106,8 @@ public:
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, player->GetGUID(), quest);
me->SetWalk(true);
Start(false, player->GetGUID(), quest);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
}
}

View file

@ -113,7 +113,8 @@ struct npc_ranger_lilatha : public npc_escortAI
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}
};

View file

@ -132,7 +132,8 @@ public:
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
go->UseDoorOrButton();
npc_escortAI::Start(false, player->GetGUID(), quest);
me->SetWalk(true);
Start(false, player->GetGUID(), quest);
}
}
@ -156,7 +157,7 @@ public:
case 17:
Talk(SAY_RIN_COMPLETE, player);
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun(true);
me->SetWalk(false);
postEventCount = 1;
break;
}

View file

@ -61,7 +61,8 @@ public:
if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
{
Talk(SAY_CORPORAL_1, player);
npc_escortAI::Start(true, player->GetGUID(), quest);
me->SetWalk(true);
Start(true, player->GetGUID(), quest);
me->SetImmuneToNPC(false);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
}

View file

@ -111,7 +111,10 @@ public:
creature->AI()->Talk(SAY_QUESTACCEPT, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
}
return true;

View file

@ -406,6 +406,7 @@ public:
{
if (Player* player = GetPlayerForEscort())
{
pLescovar->SetWalk(true);
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, player->GetGUID());
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
}
@ -448,6 +449,7 @@ public:
{
if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
{
pSpybot->SetWalk(true);
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, player->GetGUID());
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
}

View file

@ -916,7 +916,6 @@ public:
if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI()))
{
creature->SetWalk(false);
ai->Start(true, player->GetGUID());
if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f))
ai->jainaGUID = jaina->GetGUID();

View file

@ -56,7 +56,6 @@ public:
if (quest->GetQuestId() == QUEST_TOME_VALOR)
{
creature->AI()->Talk(SAY_DS_START);
creature->SetWalk(false);
if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI()))
pEscortAI->Start(true, player->GetGUID());
}
@ -117,7 +116,7 @@ public:
me->SummonCreature(NPC_DEFIAS_RAIDER, -11438.14f, 1607.6f, 70.94f, 4.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break;
case 10:
SetRun(false);
me->SetWalk(true);
break;
case 11:
Talk(SAY_DS_PROLOGUE);

View file

@ -138,7 +138,10 @@ public:
pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
{
pSlim->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return false;
}

View file

@ -424,7 +424,7 @@ public:
{
Talk(SAY_PHASE201);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2, 12s);
SetRun(false);
me->SetWalk(true);
eventInRun = true;
me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_TOWN_CITYMAN1]);
@ -434,14 +434,14 @@ public:
{
waveGroupId = 10;
eventInRun = true;
SetRun(true);
me->SetWalk(false);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2 + 9, 10s);
}
else if (param == ACTION_START_TOWN_HALL)
{
Talk(SAY_PHASE301);
SetEscortPaused(false);
SetRun(false);
me->SetWalk(true);
if (Creature* cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1]))
{
@ -460,13 +460,13 @@ public:
{
Talk(SAY_PHASE401);
SetEscortPaused(false);
SetRun(false);
me->SetWalk(true);
}
else if (param == ACTION_START_LAST_CITY)
{
Talk(SAY_PHASE404);
SetEscortPaused(false);
SetRun(true);
me->SetWalk(false);
}
else if (param == ACTION_START_MALGANIS)
{
@ -480,7 +480,7 @@ public:
}
Talk(SAY_PHASE501);
SetEscortPaused(false);
SetRun(true);
me->SetWalk(false);
}
else if (param == ACTION_KILLED_MALGANIS)
{
@ -533,7 +533,7 @@ public:
break;
// After intro, in front of bridge
case 3:
SetRun(true);
me->SetWalk(false);
Talk(SAY_PHASE118);
summons.DespawnAll(); // uther, jaina and horses
break;
@ -574,7 +574,7 @@ public:
if (pInstance)
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_REACHED_TOWN_HALL);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
me->SetWalk(true);
SetEscortPaused(true);
break;
// Inside Town Hall first scene pos
@ -600,7 +600,7 @@ public:
break;
// Town Hall, upper floor third fight
case 31:
SetRun(false);
me->SetWalk(true);
SpawnTimeRift();
SpawnTimeRift();
Talk(SAY_PHASE312);
@ -616,14 +616,14 @@ public:
break;
// Reached book shelf
case 36:
SetRun(true);
me->SetWalk(false);
if (pInstance)
if (GameObject* pGate = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_SHKAF_GATE)))
pGate->SetGoState(GO_STATE_ACTIVE);
break;
// Behind secred passage
case 45:
SetRun(true);
me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(true);
if (pInstance)
@ -631,11 +631,11 @@ public:
break;
// Some walk talk
case 47:
SetRun(false);
me->SetWalk(true);
Talk(SAY_PHASE405);
break;
case 48:
SetRun(true);
me->SetWalk(false);
Talk(SAY_PHASE406);
break;
case 53:
@ -674,7 +674,7 @@ public:
switch (uint32 currentEvent = actionEvents.ExecuteEvent())
{
case EVENT_ACTION_PHASE1:
SetRun(false);
me->SetWalk(true);
me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000);
if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000))
{
@ -690,6 +690,7 @@ public:
break;
case EVENT_ACTION_PHASE1+1:
// Start Event
me->SetWalk(true);
Start(true);
SetDespawnAtEnd(false);
SetDespawnAtFar(false);
@ -958,7 +959,7 @@ public:
break;
// After waypoint 23
case EVENT_ACTION_PHASE3+3:
SetRun(true);
me->SetWalk(false);
if (Creature* cr = GetEventNpc(NPC_CITY_MAN3))
me->CastSpell(cr, SPELL_ARTHAS_CRUSADER_STRIKE, true);
ScheduleNextEvent(currentEvent, 2s);

View file

@ -316,12 +316,12 @@ public:
events.ScheduleEvent(EVENT_THRALL_EMOTE, 1300ms);
break;
case 9:
SetRun(false);
me->SetWalk(true);
events.ScheduleEvent(EVENT_KILL_ARMORER, 500ms);
events.ScheduleEvent(EVENT_TALK_KILL_ARMORER, 3s);
break;
case 10:
SetRun(true);
me->SetWalk(false);
events.ScheduleEvent(EVENT_DRESSING_KNEEL, 500ms);
events.ScheduleEvent(EVENT_DRESSING_ARMOR, 3s);
events.ScheduleEvent(EVENT_DRESSING_STAND, 4s);
@ -374,7 +374,7 @@ public:
}
UnMountSelf();
_mounted = false;
SetRun(false);
me->SetWalk(true);
me->SetFacingTo(6.0388f);
break;
case 60:
@ -386,12 +386,12 @@ public:
}
Talk(SAY_EMOTE_HORSE);
SetEscortPaused(true);
SetRun(true);
me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->SetFacingTo(4.1364f);
break;
case 64:
SetRun(false);
me->SetWalk(true);
break;
case 67:
events.ScheduleEvent(EVENT_LOOK_1, 1200ms);
@ -418,12 +418,12 @@ public:
summon->AI()->Talk(SAY_LOOKOUT_INN);
break;
case 92:
SetRun(false);
me->SetWalk(true);
break;
case 94:
summons.DespawnAll();
SetEscortPaused(true);
SetRun(true);
me->SetWalk(false);
instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_TARETHA_MEET);
if (Creature* Taretha = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TARETHA_GUID)))
{
@ -664,7 +664,7 @@ public:
me->SetFacingTo(2.0071f);
break;
case EVENT_SUMMON_GUARDS:
SetRun(true);
me->SetWalk(false);
me->SummonCreature(NPC_TM_PROTECTOR, 2501.5708f, 699.38086f, 55.64138f, 3.8571f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
me->SummonCreature(NPC_TM_LOOKOUT, 2500.7002f, 698.26746f, 55.618248f, 3.7350f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
if (Creature* guardsman = me->SummonCreature(NPC_TM_GUARDSMAN, 2500.0908f, 699.9389f, 55.629555f, 4.2935f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS))
@ -1018,7 +1018,7 @@ public:
{
if (waypointId == 7)
{
SetRun(false);
me->SetWalk(true);
Talk(SAY_TARETHA_FREE);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
if (Creature* thrall = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL_GUID)))

View file

@ -209,7 +209,6 @@ struct npc_general_andorov : public npc_escortAI
_initialAttackTimer = 5 * IN_MILLISECONDS;
_paused = false;
me->SetWalk(false);
Start(false);
me->SetImmuneToNPC(true);

View file

@ -121,7 +121,8 @@ public:
{
Talk(SAY_MUG_START1);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}

View file

@ -258,7 +258,7 @@ public:
case 28:
player->GroupEventHappens(QUEST_A_CRY_FOR_HELP, me);
_events.ScheduleEvent(EVENT_TALK_END, 2s);
SetRun(true);
me->SetWalk(false);
break;
case 29:
if (Creature* cowlen = me->FindNearestCreature(NPC_COWLEN, 50.0f, true))
@ -289,7 +289,8 @@ public:
case EVENT_START_ESCORT:
if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
{
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
_events.ScheduleEvent(EVENT_STAND, 2s);
break;

View file

@ -397,7 +397,10 @@ public:
if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
}
creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
}

View file

@ -396,7 +396,6 @@ public:
case EVENT_RESTART_ESCORT:
CheckCaravan();
SetDespawnAtEnd(false);
SetRun(true);
Start(true, ObjectGuid::Empty, 0, false, false, true);
break;
}

View file

@ -384,6 +384,7 @@ public:
AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
}
PlayerGUID = player->GetGUID();
me->SetWalk(true);
Start(true, PlayerGUID);
}
return;

View file

@ -137,7 +137,10 @@ public:
if (quest->GetQuestId() == QUEST_PROTECT_KAYA)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
creature->AI()->Talk(SAY_START);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);

View file

@ -260,6 +260,7 @@ public:
float Radius = 10.0f;
if (me->IsWithinDistInMap(who, Radius))
{
me->SetWalk(true);
Start(false, who->GetGUID());
}
}

View file

@ -55,7 +55,10 @@ public:
creature->AI()->Talk(SAY_GIL_START, player);
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}
@ -499,7 +502,7 @@ public:
Talk(SAY_STARTUP1);
break;
case 9:
SetRun(false);
me->SetWalk(true);
break;
case 17:
if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
@ -528,7 +531,7 @@ public:
break;
case 18:
Talk(SAY_PROGRESS_1, player);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -594,7 +597,10 @@ public:
creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
}
return true;
}

View file

@ -66,7 +66,10 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed
if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}
@ -148,7 +151,10 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed
if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}

View file

@ -48,6 +48,7 @@ public:
{
if (quest->GetQuestId() == QUEST_CHASING_AME)
{
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);

View file

@ -286,7 +286,10 @@ public:
creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false, player->GetGUID(), quest);
}
return true;
}

View file

@ -339,7 +339,6 @@ public:
void Reset() override
{
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr);
SetDespawnAtEnd(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);

View file

@ -549,7 +549,6 @@ public:
return;
}
me->SetWalk(false);
Start(false);
}

View file

@ -934,7 +934,6 @@ public:
case EVENT_START_PATHING:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
me->SetWalk(false);
Start(true);
break;
case EVENT_SCOURGE_STRIKE:

View file

@ -128,6 +128,7 @@ struct boss_bjarngrim : public npc_escortAI
AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
me->SetWalk(true);
Start(true, ObjectGuid::Empty, nullptr, false, true);
}

View file

@ -391,7 +391,6 @@ public:
switch (action)
{
case ACTION_START_ESCORT_EVENT:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
Talk(SAY_BRANN_ESCORT_START);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
@ -457,7 +456,6 @@ public:
door->SetGoState(GO_STATE_READY);
break;
case ACTION_OPEN_DOOR:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
SetNextWaypoint(34, false);
SetEscortPaused(false);

View file

@ -1089,6 +1089,7 @@ public:
{
summons.DespawnAll();
_spellTimer = 0;
me->SetWalk(true);
Start(false, ObjectGuid::Empty, nullptr, false, true);
if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me))
{

View file

@ -934,7 +934,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false);
}
@ -1021,7 +1020,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false);
SetDespawnAtEnd(false);
}

View file

@ -937,7 +937,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr, false, true);
}

View file

@ -372,7 +372,6 @@ struct violet_hold_trashAI : public npc_escortAI
break;
}
SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true);
}
@ -1112,7 +1111,6 @@ public:
break;
}
SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true);
}

View file

@ -464,7 +464,10 @@ public:
go->UseDoorOrButton();
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
return true;
@ -914,6 +917,7 @@ public:
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_1, player);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -959,7 +963,7 @@ public:
Talk(SAY_5);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -995,7 +999,6 @@ public:
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_BONKER_2, player);
creature->SetWalk(false);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;

View file

@ -191,6 +191,7 @@ public:
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
{
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -238,7 +239,7 @@ public:
{
case 1:
me->SetReactState(REACT_AGGRESSIVE);
SetRun(true);
me->SetWalk(false);
break;
case 23:
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
@ -247,32 +248,32 @@ public:
case 5:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
me->SetWalk(true);
break;
case 6:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
me->SetWalk(false);
break;
case 8:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
me->SetWalk(true);
break;
case 9:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
break;
case 10:
SetRun(true);
me->SetWalk(false);
break;
case 13:
SetRun(false);
me->SetWalk(true);
break;
case 14:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
me->SetWalk(false);
break;
}
}

View file

@ -715,6 +715,7 @@ public:
Talk(0);
events.Reset();
summons.DespawnAll();
me->SetWalk(true);
Start(false);
int8 i = -1;

View file

@ -605,6 +605,7 @@ public:
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1);
}

View file

@ -57,7 +57,6 @@ struct npc_frosthound : public npc_escortAI
{
me->SetFaction(who->GetFaction());
me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true);
me->SetWalk(false);
Start(false, who->GetGUID());
Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me);
}
@ -247,7 +246,6 @@ public:
void RollPath()
{
me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE);
me->SetWalk(false);
Start(true, ObjectGuid::Empty, 0, false, true, true);
SetNextWaypoint(urand(0, 250), true);
me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false);

View file

@ -171,7 +171,10 @@ public:
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
{
if (creature->GetOwner() && creature->GetOwner()->IsPlayer())
{
creature->SetWalk(true);
Start(false, creature->GetOwner()->GetGUID());
}
creature->SetSpeed(MOVE_WALK, 1.5f);
DoCast(SPELL_GUIDED_BY_THE_SPIRITS);
Reset();
@ -312,7 +315,8 @@ public:
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}

View file

@ -65,6 +65,7 @@ public:
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE);
creature->SetWalk(true);
EscortAI->Start(true, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START);
@ -133,7 +134,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -306,6 +307,7 @@ public:
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetWalk(true);
Start(true, guid);
Talk(SAY_KUR_START);
@ -361,7 +363,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun(true);
me->SetWalk(false);
break;
}
}

View file

@ -103,7 +103,6 @@ public:
{
if (type == DATA_START_ENCOUNTER)
{
me->SetWalk(false);
Start(true, playerGUID);
SetEscortPaused(true);
started = true;
@ -606,6 +605,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->AI()->Talk(SAY_BESSY_0);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -772,6 +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);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
}
}

View file

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

View file

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