Skip to content

Commit

Permalink
MT: add instance file and worldstate handling for multiple groups (#702)
Browse files Browse the repository at this point in the history
* MT: add instance file and worldstate handling for multiple groups

* update mana tombs

* fix typo
  • Loading branch information
miraco authored Oct 20, 2024
1 parent 9d29b59 commit 8be3aaf
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/scriptdev2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<instance_mana_tombs>;
pNewScript->RegisterSelf();
}
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/system/ScriptLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions src/game/World/WorldStateDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 8be3aaf

Please sign in to comment.