From e6fb7ff806b8b17cc2a085cee5d1ad1b2d0031cc Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 2 Apr 2023 20:29:56 +0200 Subject: [PATCH] fix(Scripts/Karazhan): Fixed locking Shad of Aran entrance door. (#15450) Fixes #15434 --- .../Karazhan/boss_shade_of_aran.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 11be933e8..063b3937c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -134,7 +134,12 @@ public: // Not in progress instance->SetData(DATA_ARAN, NOT_STARTED); - instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), true); + + if (GameObject* libraryDoor = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR))) + { + libraryDoor->SetGoState(GO_STATE_ACTIVE); + libraryDoor->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); + } } void KilledUnit(Unit* /*victim*/) override @@ -147,7 +152,12 @@ public: Talk(SAY_DEATH); instance->SetData(DATA_ARAN, DONE); - instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), true); + + if (GameObject* libraryDoor = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR))) + { + libraryDoor->SetGoState(GO_STATE_ACTIVE); + libraryDoor->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); + } } void JustEngagedWith(Unit* /*who*/) override @@ -155,7 +165,13 @@ public: Talk(SAY_AGGRO); instance->SetData(DATA_ARAN, IN_PROGRESS); - instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), false); + + if (GameObject* libraryDoor = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR))) + { + libraryDoor->SetGoState(GO_STATE_READY); + libraryDoor->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE); + } + DoZoneInCombat(); } @@ -203,7 +219,11 @@ public: { if (CloseDoorTimer <= diff) { - instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), false); + if (GameObject* libraryDoor = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR))) + { + libraryDoor->SetGoState(GO_STATE_READY); + libraryDoor->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE); + } CloseDoorTimer = 0; } else