diff options
author | offl <11556157+offl@users.noreply.github.com> | 2025-07-24 15:25:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-24 14:25:16 +0200 |
commit | e899b2aeea3ef2718beefb59ab0fb170cee80fc4 (patch) | |
tree | 26e7a450547b040cd7d09ceb18dc3dfb9d3f3cee | |
parent | fd42b894f35e5950ac97ddd0b63d2eddf43e9000 (diff) |
Scripts/Steam Vault & Underbog: Minor updates (#31090)
* Kalithresh now forces all distillers to cast SPELL_QUIET_SUICIDE when encounter is finished
* Move go_main_chambers_access_panel script from instance file to instance scripts file
* Add comments for script names for Hungarfen and Black Stalker
* Remove redundant SetBossState for Musel'ek (currently is handled in BossAI)
9 files changed, 69 insertions, 30 deletions
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index 1447281a9c7..3374106e8be 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -15,9 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* Timers requires update +/* + * Timers requires update * Distillers should respawn at some point, probably in case of wipe - * All distillers should cast SPELL_QUIET_SUICIDE when encounter is finished */ + */ #include "ScriptMgr.h" #include "InstanceScript.h" @@ -99,6 +100,7 @@ struct boss_warlord_kalithresh : public BossAI events.ScheduleEvent(EVENT_RAGE, 10s, 20s); } + /// @todo: Handle this with GameObject 184106 (Coilfang Steamvaults - Kalithresh Event - Trigger 000) void MoveInLineOfSight(Unit* who) override { if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 50.0f)) @@ -145,6 +147,12 @@ struct boss_warlord_kalithresh : public BossAI { Talk(SAY_DEATH); _JustDied(); + + std::vector<Creature*> distillers; + GetCreatureListWithEntryInGrid(distillers, me, NPC_NAGA_DISTILLER, 250.0f); + for (Creature* distiller : distillers) + if (distiller->IsAlive()) + distiller->CastSpell(distiller, SPELL_QUIET_SUICIDE, true); } void UpdateAI(uint32 diff) override @@ -221,7 +229,7 @@ struct npc_naga_distiller : public ScriptedAI void JustDied(Unit* /*killer*/) override { - if (Creature* kalithresh = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_WARLORD_KALITHRESH))) + if (Creature* kalithresh = _instance->GetCreature(DATA_WARLORD_KALITHRESH)) kalithresh->AI()->DoAction(ACTION_DISTILLER_DEAD); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp index 57341990c17..b24a927de1f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -19,29 +19,10 @@ #include "Creature.h" #include "CreatureAI.h" #include "GameObject.h" -#include "GameObjectAI.h" #include "InstanceScript.h" #include "Log.h" #include "steam_vault.h" -struct go_main_chambers_access_panel : public GameObjectAI -{ - go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { } - - bool OnGossipHello(Player* /*player*/) override - { - if (Creature* controller = _instance->GetCreature(DATA_DOOR_CONTROLLER)) - controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED); - _instance->SetData(ACTION_OPEN_DOOR, 0); - me->SetFlag(GO_FLAG_NOT_SELECTABLE); - me->SetGoState(GO_STATE_ACTIVE); - return true; - } - -private: - InstanceScript* _instance; -}; - ObjectData const gameObjectData[] = { { GO_ACCESS_PANEL_HYDRO, DATA_ACCESS_PANEL_HYDRO }, @@ -134,6 +115,5 @@ class instance_steam_vault : public InstanceMapScript void AddSC_instance_steam_vault() { - RegisterGameObjectAI(go_main_chambers_access_panel); new instance_steam_vault(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.cpp new file mode 100644 index 00000000000..a5e61d933a8 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.cpp @@ -0,0 +1,49 @@ +/* + * This file is part of the TrinityCore 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, see <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "Creature.h" +#include "CreatureAI.h" +#include "GameObject.h" +#include "GameObjectAI.h" +#include "InstanceScript.h" +#include "steam_vault.h" + +// 184125, 184126 - Main Chambers Access Panel +struct go_main_chambers_access_panel : public GameObjectAI +{ + go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { } + + bool OnGossipHello(Player* /*player*/) override + { + if (Creature* controller = _instance->GetCreature(DATA_DOOR_CONTROLLER)) + controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED); + + _instance->SetData(ACTION_OPEN_DOOR, 0); + me->SetFlag(GO_FLAG_NOT_SELECTABLE); + me->SetGoState(GO_STATE_ACTIVE); + return true; + } + +private: + InstanceScript* _instance; +}; + +void AddSC_steam_vault() +{ + RegisterSteamVaultGameObjectAI(go_main_chambers_access_panel); +} diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h index 4de2ada719c..127919c605a 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h @@ -68,5 +68,6 @@ inline AI* GetSteamVaultAI(T* obj) } #define RegisterSteamVaultCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetSteamVaultAI) +#define RegisterSteamVaultGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetSteamVaultAI) #endif diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp index be90b9a2bec..8c092899938 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp @@ -41,6 +41,7 @@ enum HungarfenSpells SPELL_GROW = 31698 }; +// 17770 - Hungarfen struct boss_hungarfen : public BossAI { boss_hungarfen(Creature* creature) : BossAI(creature, DATA_HUNGARFEN), _roared(false) { } @@ -112,6 +113,7 @@ private: bool _roared; }; +// 17990 - Underbog Mushroom struct npc_underbog_mushroom : public ScriptedAI { npc_underbog_mushroom(Creature* creature) : ScriptedAI(creature), _counter(0) { } diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp index 4640f9e00ff..912dc7997e6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp @@ -35,7 +35,7 @@ like lack of delays between packets makes it work differently too. Of course as was said above player can be pulled towards 2 times in a row but that looks like a rare case. */ -enum Spells +enum BlackStalkerSpells { SPELL_LEVITATE = 31704, SPELL_CHAIN_LIGHTNING = 31717, @@ -52,7 +52,7 @@ enum Spells SPELL_SUMMON_SPORE_STRIDER = 38755 }; -enum Events +enum BlackStalkerEvents { EVENT_LEASH_CHECK = 1, EVENT_LEVITATE, @@ -61,6 +61,7 @@ enum Events EVENT_SUMMON_SPORE_STRIDER }; +// 17882 - The Black Stalker struct boss_the_black_stalker : public BossAI { boss_the_black_stalker(Creature* creature) : BossAI(creature, DATA_THE_BLACK_STALKER) { } diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp index a40681ca32a..624b4ec34cf 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp @@ -47,9 +47,6 @@ public: case NPC_GHAZAN: SetBossState(DATA_GHAZAN, DONE); break; - case NPC_SWAMPLORD_MUSELEK: - SetBossState(DATA_SWAMPLORD_MUSELEK, DONE); - break; default: break; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h index 4b28702f046..851e408e331 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h +++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h @@ -35,8 +35,7 @@ enum TheUnderbogDataId enum TheUnderbogCreatureId { - NPC_GHAZAN = 18105, - NPC_SWAMPLORD_MUSELEK = 17826 + NPC_GHAZAN = 18105 }; template <class AI, class T> diff --git a/src/server/scripts/Outland/outland_script_loader.cpp b/src/server/scripts/Outland/outland_script_loader.cpp index e553333465f..605d0e383c5 100644 --- a/src/server/scripts/Outland/outland_script_loader.cpp +++ b/src/server/scripts/Outland/outland_script_loader.cpp @@ -68,6 +68,7 @@ void AddSC_boss_hydromancer_thespia(); void AddSC_boss_mekgineer_steamrigger(); void AddSC_boss_warlord_kalithresh(); void AddSC_instance_steam_vault(); +void AddSC_steam_vault(); // Coilfang Reservoir - The Slave Pens void AddSC_instance_the_slave_pens(); @@ -193,6 +194,7 @@ void AddOutlandScripts() AddSC_boss_hydromancer_thespia(); AddSC_boss_mekgineer_steamrigger(); AddSC_boss_warlord_kalithresh(); + AddSC_steam_vault(); // Coilfang Reservoir - The Slave Pens AddSC_instance_the_slave_pens(); |