From b0e266c3dc3a3f65d637b1fb10f8abd19dae7e73 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 5 Aug 2018 22:39:03 +0200 Subject: [PATCH] Scripts/TotT: prepare instance for future implementations --- .../custom/custom_2018_08_05_01_world.sql | 11 ++ .../boss_commander_ulthok.cpp | 20 ++++ .../ThroneOfTheTides/boss_lady_nazjar.cpp | 20 ++++ .../boss_mindbender_gursha.cpp | 20 ++++ .../ThroneOfTheTides/boss_ozumat.cpp | 20 ++++ .../instance_throne_of_the_todes.cpp | 105 ++++++++++++++++++ .../ThroneOfTheTides/throne_of_the_tides.cpp | 20 ++++ .../ThroneOfTheTides/throne_of_the_tides.h | 58 ++++++++++ .../eastern_kingdoms_script_loader.cpp | 12 ++ 9 files changed, 286 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_08_05_01_world.sql create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_commander_ulthok.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_mindbender_gursha.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp create mode 100644 src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h diff --git a/sql/updates/world/custom/custom_2018_08_05_01_world.sql b/sql/updates/world/custom/custom_2018_08_05_01_world.sql new file mode 100644 index 00000000000..359f9326c0e --- /dev/null +++ b/sql/updates/world/custom/custom_2018_08_05_01_world.sql @@ -0,0 +1,11 @@ +UPDATE `creature_addon` SET `auras`= '' WHERE `guid`= 255068; +UPDATE `creature_addon` SET `auras`= '' WHERE `guid` IN +(254870, 254871, 254872, 254873, 254875, 254877, 254878, 254879, 254881, 254884, 254885, 254888, 254892, 254893, 254894, 254895, 254896, 254897, 254898, 254899, 254900, 254901, 254902, 254903, 254904, 254905, 254906, 254907, 254908, 254909, 254910, 254911, 254912, 254913, 254916, 254919, 254886, 254891, 255406); + +UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry` IN (44581, 49100, 49101, 45030, 44566, 49097, 45672, 45621, 40655, 49096); + +DELETE FROM `creature` WHERE `guid`= 255406; +DELETE FROM `creature_addon` WHERE `guid`= 255406; + +UPDATE `instance_template` SET `script`= 'instance_throne_of_the_tides' WHERE `map`= 643; +UPDATE `creature_template` SET `flags_extra`= 128 WHERE `entry` IN (45030, 49101, 44581, 49100); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_commander_ulthok.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_commander_ulthok.cpp new file mode 100644 index 00000000000..5e3aa1e83ca --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_commander_ulthok.cpp @@ -0,0 +1,20 @@ +/* +* Copyright (C) 2008-2018 TrinityCore +* +* 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, see . +*/ + +void AddSC_boss_commander_ulthok() +{ +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp new file mode 100644 index 00000000000..9ec216311c1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp @@ -0,0 +1,20 @@ +/* +* Copyright (C) 2008-2018 TrinityCore +* +* 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, see . +*/ + +void AddSC_boss_lady_nazjar() +{ +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_mindbender_gursha.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_mindbender_gursha.cpp new file mode 100644 index 00000000000..aa5454f220d --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_mindbender_gursha.cpp @@ -0,0 +1,20 @@ +/* +* Copyright (C) 2008-2018 TrinityCore +* +* 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, see . +*/ + +void AddSC_boss_mindbender_gursha() +{ +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp new file mode 100644 index 00000000000..1cf5b951a1a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp @@ -0,0 +1,20 @@ +/* +* Copyright (C) 2008-2018 TrinityCore +* +* 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, see . +*/ + +void AddSC_boss_ozumat() +{ +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp new file mode 100644 index 00000000000..a9561cbe3a7 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2008-2018 TrinityCore + * + * 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, see . + */ + +#include "ScriptMgr.h" +#include "throne_of_the_tides.h" +#include "InstanceScript.h" +#include "Vehicle.h" + +ObjectData const creatureData[] = +{ + { BOSS_LADY_NAZJAR, DATA_LADY_NAZJAR }, + { BOSS_COMMANDER_ULTHOK, DATA_COMMANDER_ULTHOK }, + { BOSS_MINDBENDER_GURSHA, DATA_MINDBENDER_GURSHA }, + { BOSS_OZUMAT, DATA_OZUMAT }, + { 0, 0 } // END +}; + +class instance_throne_of_the_tides : public InstanceMapScript +{ + public: + instance_throne_of_the_tides(): InstanceMapScript(TotTScriptName, 643) { } + + struct instance_throne_of_the_tides_InstanceMapScript : public InstanceScript + { + instance_throne_of_the_tides_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + { + Initialize(); + SetHeaders(DataHeader); + SetBossNumber(EncounterCount); + LoadObjectData(creatureData, nullptr); + } + + void Initialize() + { + } + + bool SetBossState(uint32 type, EncounterState state) override + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + return true; + } + + void OnCreatureCreate(Creature* creature) override + { + InstanceScript::OnCreatureCreate(creature); + + switch (creature->GetEntry()) + { + case BOSS_OZUMAT: + case NPC_OZUMAT_VEHICLE: + case NPC_OZUMAT_VEHICLE_BIG: + creature->setActive(true); + creature->SetFarVisible(true); + break; + default: + break; + } + } + + uint32 GetData(uint32 type) const override + { + return 0; + } + + void SetData(uint32 type, uint32 data) override + { + } + + void WriteSaveDataMore(std::ostringstream& data) override + { + } + + void ReadSaveDataMore(std::istringstream& data) override + { + } + + private: + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const override + { + return new instance_throne_of_the_tides_InstanceMapScript(map); + } +}; + +void AddSC_instance_throne_of_the_tides() +{ + new instance_throne_of_the_tides(); +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp new file mode 100644 index 00000000000..2989354918a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp @@ -0,0 +1,20 @@ +/* +* Copyright (C) 2008-2018 TrinityCore +* +* 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, see . +*/ + +void AddSC_throne_of_the_tides() +{ +} diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h new file mode 100644 index 00000000000..e4762234b56 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2008-2018 TrinityCore + * + * 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, see . + */ + +#ifndef THRONEOFTHETIDES_H_ +#define THRONEOFTHETIDES_H_ + +#include "CreatureAIImpl.h" + +#define TotTScriptName "instance_throne_of_the_tides" +#define DataHeader "TOTT" + +uint32 const EncounterCount = 4; + +enum TotTDataTypes +{ + // Encounters + DATA_LADY_NAZJAR = 0, + DATA_COMMANDER_ULTHOK = 1, + DATA_MINDBENDER_GURSHA = 2, + DATA_OZUMAT = 3 +}; + +enum TotTCreatureIds +{ + // Bosses + BOSS_LADY_NAZJAR = 40586, + BOSS_COMMANDER_ULTHOK = 40765, + BOSS_MINDBENDER_GURSHA = 40788, + BOSS_OZUMAT = 40655, + + // Event Creatures + NPC_OZUMAT_VEHICLE_BIG = 45030, + NPC_OZUMAT_VEHICLE = 44581 +}; + +template +inline AI* GetThroneOfTheTodesAI(T* obj) +{ + return GetInstanceAI(obj, TotTScriptName); +} + +#define RegisterThroneOfTheTidesCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetThroneOfTheTodesAI) + +#endif // THRONEOFTHETIDES_H_ diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index 761eaba8982..a0efec1b1d9 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -179,6 +179,12 @@ void AddSC_boss_eredar_twins(); void AddSC_boss_muru(); void AddSC_boss_kiljaeden(); void AddSC_sunwell_plateau(); +void AddSC_throne_of_the_tides(); // Throne of the Tides +void AddSC_instance_throne_of_the_tides(); +void AddSC_boss_lady_nazjar(); +void AddSC_boss_commander_ulthok(); +void AddSC_boss_mindbender_gursha(); +void AddSC_boss_ozumat(); void AddSC_boss_archaedas(); //Uldaman void AddSC_boss_ironaya(); void AddSC_uldaman(); @@ -398,6 +404,12 @@ void AddEasternKingdomsScripts() AddSC_boss_hogger(); AddSC_boss_randolph_moloch(); AddSC_boss_lord_overheat(); + AddSC_throne_of_the_tides(); // Throne of the Tides + AddSC_instance_throne_of_the_tides(); + AddSC_boss_lady_nazjar(); + AddSC_boss_commander_ulthok(); + AddSC_boss_mindbender_gursha(); + AddSC_boss_ozumat(); AddSC_boss_archaedas(); //Uldaman AddSC_boss_ironaya(); AddSC_uldaman();