From abf85fb44f66344064bc12b20228652c26b33395 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:04:47 -0300 Subject: [PATCH] fix(Scripts/Quest): Correct respawn logic for Isla Starmane and Rin'ji (#17874) * Create rev_1694739263824086500.sql * init * 2 --- src/server/scripts/EasternKingdoms/zone_hinterlands.cpp | 5 +++-- src/server/scripts/Outland/zone_terokkar_forest.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 6ea8a812d..c4e1eabed 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -77,7 +77,7 @@ public: { _IsByOutrunner = false; spawnId = 0; - me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); + me->SetImmuneToAll(true); } void Reset() override @@ -90,6 +90,7 @@ public: { _IsByOutrunner = false; spawnId = 0; + me->SetImmuneToAll(true); npc_escortAI::JustRespawned(); } @@ -136,7 +137,7 @@ public: void sQuestAccept(Player* player, Quest const* quest) override { - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); + me->SetImmuneToAll(false); if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) { if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index b71a018b8..9cef1070b 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -472,7 +472,7 @@ public: { case 0: if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10)) - Cage->SetGoState(GO_STATE_ACTIVE); + Cage->UseDoorOrButton(); break; case 2: Talk(SAY_PROGRESS_1, player); @@ -501,9 +501,10 @@ public: } } - void Reset() override + void JustRespawned() override { - me->RestoreFaction(); + me->SetImmuneToAll(true); + npc_escortAI::JustRespawned(); } void JustDied(Unit* /*killer*/) override