From 8be3aaf39d11ed4668dd00253f260b7fd81e8f03 Mon Sep 17 00:00:00 2001 From: _daanieL Date: Sun, 20 Oct 2024 19:42:38 +0200 Subject: [PATCH] MT: add instance file and worldstate handling for multiple groups (#702) * MT: add instance file and worldstate handling for multiple groups * update mana tombs * fix typo --- sql/scriptdev2/scriptdev2.sql | 1 + .../auchindoun/mana_tombs/mana_tombs.cpp | 50 +++++++++++++++++++ .../auchindoun/mana_tombs/mana_tombs.h | 17 +++++++ .../AI/ScriptDevAI/system/ScriptLoader.cpp | 2 + src/game/World/WorldStateDefines.h | 8 +++ 5 files changed, 78 insertions(+) create mode 100644 src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp create mode 100644 src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.h diff --git a/sql/scriptdev2/scriptdev2.sql b/sql/scriptdev2/scriptdev2.sql index b1e2731dc0a..d9918cf35d0 100644 --- a/sql/scriptdev2/scriptdev2.sql +++ b/sql/scriptdev2/scriptdev2.sql @@ -317,6 +317,7 @@ UPDATE creature_template SET ScriptName='npc_shaheen' WHERE entry=19671; UPDATE creature_template SET ScriptName='npc_ethereum_prisoner_dungeon' WHERE entry IN(22927); UPDATE gameobject_template SET ScriptName='go_stasis_chamber_mana_tombs' WHERE entry IN(185519); UPDATE gameobject_template SET ScriptName='go_stasis_chamber_shaffar' WHERE entry IN(185522); +UPDATE instance_template SET ScriptName='instance_mana_tombs' WHERE map=557; /* AUCHENAI CRYPTS */ UPDATE creature_template SET ScriptName='boss_exarch_maladaar' WHERE entry=18373; diff --git a/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp b/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp new file mode 100644 index 00000000000..60b37090f1c --- /dev/null +++ b/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp @@ -0,0 +1,50 @@ +/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 60 +SDComment: Summoning event for Anzu NYI +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "AI/ScriptDevAI/include/sc_common.h" +#include "mana_tombs.h" +#include "World/WorldStateDefines.h" + +instance_mana_tombs::instance_mana_tombs(Map* pMap) : ScriptedInstance(pMap) +{ + Initialize(); +} + +void instance_mana_tombs::Initialize() +{ + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_18, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_20, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_27, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_32, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_34, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_MANA_TOMBS_GROUP_35, urand(0, 1)); +} + + +void AddSC_instance_mana_tombs() +{ + Script* pNewScript = new Script; + pNewScript->Name = "instance_mana_tombs"; + pNewScript->GetInstanceData = &GetNewInstanceScript; + pNewScript->RegisterSelf(); +} diff --git a/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.h b/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.h new file mode 100644 index 00000000000..a6b98ba237b --- /dev/null +++ b/src/game/AI/ScriptDevAI/scripts/outland/auchindoun/mana_tombs/mana_tombs.h @@ -0,0 +1,17 @@ +/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MANA_TOMBS_H +#define DEF_MANA_TOMBS_H + +class instance_mana_tombs : public ScriptedInstance +{ + public: + instance_mana_tombs(Map* pMap); + ~instance_mana_tombs() {} + + void Initialize() override; +}; + +#endif diff --git a/src/game/AI/ScriptDevAI/system/ScriptLoader.cpp b/src/game/AI/ScriptDevAI/system/ScriptLoader.cpp index 5de11baa907..865199f12ed 100644 --- a/src/game/AI/ScriptDevAI/system/ScriptLoader.cpp +++ b/src/game/AI/ScriptDevAI/system/ScriptLoader.cpp @@ -277,6 +277,7 @@ extern void AddSC_boss_nexusprince_shaffar(); // auchindoun, mana_ extern void AddSC_boss_pandemonius(); extern void AddSC_mana_tombs(); extern void AddSC_boss_yor(); +extern void AddSC_instance_mana_tombs(); extern void AddSC_boss_anzu(); // auchindoun, sethekk_halls extern void AddSC_boss_darkweaver_syth(); extern void AddSC_boss_talon_king_ikiss(); @@ -641,6 +642,7 @@ void AddScripts() AddSC_boss_pandemonius(); AddSC_mana_tombs(); AddSC_boss_yor(); + AddSC_instance_mana_tombs(); AddSC_boss_anzu(); // auchindoun, sethekk_halls AddSC_boss_darkweaver_syth(); AddSC_boss_talon_king_ikiss(); diff --git a/src/game/World/WorldStateDefines.h b/src/game/World/WorldStateDefines.h index c51b8407f4a..30f06dbb7b9 100644 --- a/src/game/World/WorldStateDefines.h +++ b/src/game/World/WorldStateDefines.h @@ -367,6 +367,14 @@ enum WorldStateID : int32 WORLD_STATE_SETHEKK_GROUP_20 = 5560005, // 2 Possible group versions WORLD_STATE_SETHEKK_GROUP_21 = 5560006, // 2 Possible group versions + // Mana Tombs + WORLD_STATE_MANA_TOMBS_GROUP_18 = 5570001, // 2 Possible group versions + WORLD_STATE_MANA_TOMBS_GROUP_20 = 5570002, // 2 Possible group versions + WORLD_STATE_MANA_TOMBS_GROUP_27 = 5570003, // 2 Possible group versions + WORLD_STATE_MANA_TOMBS_GROUP_32 = 5570004, // 2 Possible group versions + WORLD_STATE_MANA_TOMBS_GROUP_34 = 5570005, // 2 Possible group versions + WORLD_STATE_MANA_TOMBS_GROUP_35 = 5570006, // 2 Possible group versions + // Wotlk };