Skip to content

Commit e899b2a

Browse files
authored
Scripts/Steam Vault & Underbog: Minor updates (TrinityCore#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)
1 parent fd42b89 commit e899b2a

File tree

9 files changed

+69
-30
lines changed

9 files changed

+69
-30
lines changed

src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
* with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
/* Timers requires update
18+
/*
19+
* Timers requires update
1920
* Distillers should respawn at some point, probably in case of wipe
20-
* All distillers should cast SPELL_QUIET_SUICIDE when encounter is finished */
21+
*/
2122

2223
#include "ScriptMgr.h"
2324
#include "InstanceScript.h"
@@ -99,6 +100,7 @@ struct boss_warlord_kalithresh : public BossAI
99100
events.ScheduleEvent(EVENT_RAGE, 10s, 20s);
100101
}
101102

103+
/// @todo: Handle this with GameObject 184106 (Coilfang Steamvaults - Kalithresh Event - Trigger 000)
102104
void MoveInLineOfSight(Unit* who) override
103105
{
104106
if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 50.0f))
@@ -145,6 +147,12 @@ struct boss_warlord_kalithresh : public BossAI
145147
{
146148
Talk(SAY_DEATH);
147149
_JustDied();
150+
151+
std::vector<Creature*> distillers;
152+
GetCreatureListWithEntryInGrid(distillers, me, NPC_NAGA_DISTILLER, 250.0f);
153+
for (Creature* distiller : distillers)
154+
if (distiller->IsAlive())
155+
distiller->CastSpell(distiller, SPELL_QUIET_SUICIDE, true);
148156
}
149157

150158
void UpdateAI(uint32 diff) override
@@ -221,7 +229,7 @@ struct npc_naga_distiller : public ScriptedAI
221229

222230
void JustDied(Unit* /*killer*/) override
223231
{
224-
if (Creature* kalithresh = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_WARLORD_KALITHRESH)))
232+
if (Creature* kalithresh = _instance->GetCreature(DATA_WARLORD_KALITHRESH))
225233
kalithresh->AI()->DoAction(ACTION_DISTILLER_DEAD);
226234
}
227235

src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,10 @@
1919
#include "Creature.h"
2020
#include "CreatureAI.h"
2121
#include "GameObject.h"
22-
#include "GameObjectAI.h"
2322
#include "InstanceScript.h"
2423
#include "Log.h"
2524
#include "steam_vault.h"
2625

27-
struct go_main_chambers_access_panel : public GameObjectAI
28-
{
29-
go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
30-
31-
bool OnGossipHello(Player* /*player*/) override
32-
{
33-
if (Creature* controller = _instance->GetCreature(DATA_DOOR_CONTROLLER))
34-
controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED);
35-
_instance->SetData(ACTION_OPEN_DOOR, 0);
36-
me->SetFlag(GO_FLAG_NOT_SELECTABLE);
37-
me->SetGoState(GO_STATE_ACTIVE);
38-
return true;
39-
}
40-
41-
private:
42-
InstanceScript* _instance;
43-
};
44-
4526
ObjectData const gameObjectData[] =
4627
{
4728
{ GO_ACCESS_PANEL_HYDRO, DATA_ACCESS_PANEL_HYDRO },
@@ -134,6 +115,5 @@ class instance_steam_vault : public InstanceMapScript
134115

135116
void AddSC_instance_steam_vault()
136117
{
137-
RegisterGameObjectAI(go_main_chambers_access_panel);
138118
new instance_steam_vault();
139119
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3+
*
4+
* This program is free software; you can redistribute it and/or modify it
5+
* under the terms of the GNU General Public License as published by the
6+
* Free Software Foundation; either version 2 of the License, or (at your
7+
* option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+
* more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include "ScriptMgr.h"
19+
#include "Creature.h"
20+
#include "CreatureAI.h"
21+
#include "GameObject.h"
22+
#include "GameObjectAI.h"
23+
#include "InstanceScript.h"
24+
#include "steam_vault.h"
25+
26+
// 184125, 184126 - Main Chambers Access Panel
27+
struct go_main_chambers_access_panel : public GameObjectAI
28+
{
29+
go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
30+
31+
bool OnGossipHello(Player* /*player*/) override
32+
{
33+
if (Creature* controller = _instance->GetCreature(DATA_DOOR_CONTROLLER))
34+
controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED);
35+
36+
_instance->SetData(ACTION_OPEN_DOOR, 0);
37+
me->SetFlag(GO_FLAG_NOT_SELECTABLE);
38+
me->SetGoState(GO_STATE_ACTIVE);
39+
return true;
40+
}
41+
42+
private:
43+
InstanceScript* _instance;
44+
};
45+
46+
void AddSC_steam_vault()
47+
{
48+
RegisterSteamVaultGameObjectAI(go_main_chambers_access_panel);
49+
}

src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ inline AI* GetSteamVaultAI(T* obj)
6868
}
6969

7070
#define RegisterSteamVaultCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetSteamVaultAI)
71+
#define RegisterSteamVaultGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetSteamVaultAI)
7172

7273
#endif

src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ enum HungarfenSpells
4141
SPELL_GROW = 31698
4242
};
4343

44+
// 17770 - Hungarfen
4445
struct boss_hungarfen : public BossAI
4546
{
4647
boss_hungarfen(Creature* creature) : BossAI(creature, DATA_HUNGARFEN), _roared(false) { }
@@ -112,6 +113,7 @@ struct boss_hungarfen : public BossAI
112113
bool _roared;
113114
};
114115

116+
// 17990 - Underbog Mushroom
115117
struct npc_underbog_mushroom : public ScriptedAI
116118
{
117119
npc_underbog_mushroom(Creature* creature) : ScriptedAI(creature), _counter(0) { }

src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ like lack of delays between packets makes it work differently too.
3535
Of course as was said above player can be pulled towards 2 times in a row but that looks like a rare case.
3636
*/
3737

38-
enum Spells
38+
enum BlackStalkerSpells
3939
{
4040
SPELL_LEVITATE = 31704,
4141
SPELL_CHAIN_LIGHTNING = 31717,
@@ -52,7 +52,7 @@ enum Spells
5252
SPELL_SUMMON_SPORE_STRIDER = 38755
5353
};
5454

55-
enum Events
55+
enum BlackStalkerEvents
5656
{
5757
EVENT_LEASH_CHECK = 1,
5858
EVENT_LEVITATE,
@@ -61,6 +61,7 @@ enum Events
6161
EVENT_SUMMON_SPORE_STRIDER
6262
};
6363

64+
// 17882 - The Black Stalker
6465
struct boss_the_black_stalker : public BossAI
6566
{
6667
boss_the_black_stalker(Creature* creature) : BossAI(creature, DATA_THE_BLACK_STALKER) { }

src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class instance_the_underbog : public InstanceMapScript
4747
case NPC_GHAZAN:
4848
SetBossState(DATA_GHAZAN, DONE);
4949
break;
50-
case NPC_SWAMPLORD_MUSELEK:
51-
SetBossState(DATA_SWAMPLORD_MUSELEK, DONE);
52-
break;
5350
default:
5451
break;
5552
}

src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ enum TheUnderbogDataId
3535

3636
enum TheUnderbogCreatureId
3737
{
38-
NPC_GHAZAN = 18105,
39-
NPC_SWAMPLORD_MUSELEK = 17826
38+
NPC_GHAZAN = 18105
4039
};
4140

4241
template <class AI, class T>

src/server/scripts/Outland/outland_script_loader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void AddSC_boss_hydromancer_thespia();
6868
void AddSC_boss_mekgineer_steamrigger();
6969
void AddSC_boss_warlord_kalithresh();
7070
void AddSC_instance_steam_vault();
71+
void AddSC_steam_vault();
7172

7273
// Coilfang Reservoir - The Slave Pens
7374
void AddSC_instance_the_slave_pens();
@@ -193,6 +194,7 @@ void AddOutlandScripts()
193194
AddSC_boss_hydromancer_thespia();
194195
AddSC_boss_mekgineer_steamrigger();
195196
AddSC_boss_warlord_kalithresh();
197+
AddSC_steam_vault();
196198

197199
// Coilfang Reservoir - The Slave Pens
198200
AddSC_instance_the_slave_pens();

0 commit comments

Comments
 (0)