From ea3e6e8f3b7710baeeb7e08a0ddd8053a449e008 Mon Sep 17 00:00:00 2001 From: Johaine <32821455+Johaine@users.noreply.github.com> Date: Sat, 13 May 2023 17:52:44 +0000 Subject: [PATCH] fix(Scripts/Deadmines): Fix Factory Door in Deadmines being closable (#15201) * fix(DB/SAI): Open Factory Door correctly (irreversibly) Activate the Factory Door after the boss' death to open it instead of changing gameobject state only which can be reversed by another activation. * fix(Script/Instance): Prevent Door being closed again after Server Restart * Drop database name from update SQL Other people might not use the standard database names Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> --------- Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> --- data/sql/updates/pending_db_world/DM_FactoryDoor_Fix.sql | 1 + .../scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/DM_FactoryDoor_Fix.sql diff --git a/data/sql/updates/pending_db_world/DM_FactoryDoor_Fix.sql b/data/sql/updates/pending_db_world/DM_FactoryDoor_Fix.sql new file mode 100644 index 000000000..5cc50ac84 --- /dev/null +++ b/data/sql/updates/pending_db_world/DM_FactoryDoor_Fix.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `action_type`=9, `comment`='Rhahk\'Zor - On Just Died - Activate Gameobject' WHERE `entryorguid`=644 AND `source_type`=0 AND `id`=2 AND `link`=3; diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 0d92d33a6..27371a4b5 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -50,8 +50,9 @@ public: break; case GO_FACTORY_DOOR: gameobject->UpdateSaveToDb(true); + // GoState (Door opened) is restored during GO creation, but we need to set LootState to prevent Lever from closing it again if (_encounters[TYPE_RHAHK_ZOR] == DONE) - gameobject->SetGoState(GO_STATE_ACTIVE); + gameobject->SetLootState(GO_ACTIVATED); break; case GO_IRON_CLAD_DOOR: gameobject->UpdateSaveToDb(true);