Skip to content

Commit b4e749a

Browse files
authored
Scripts/Blood Furnace: Update scripts (TrinityCore#31012)
1 parent 147d239 commit b4e749a

File tree

5 files changed

+455
-505
lines changed

5 files changed

+455
-505
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--
2+
DELETE FROM `creature_text` WHERE `CreatureID` IN (17377,17653);
3+
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
4+
(17377,0,0,"Who dares interrupt--What is this; what have you done? You'll ruin everything!",14,0,100,0,0,10164,15130,0,"kelidan SAY_WAKE"),
5+
(17377,1,0,"Closer! Come closer... and burn!",14,0,100,0,0,10165,15132,0,"kelidan SAY_NOVA"),
6+
(17377,2,0,"Just as you deserve!",14,0,100,0,0,10169,17670,0,"kelidan SAY_SLAY_1"),
7+
(17377,2,1,"Your friends will soon be joining you!",14,0,100,0,0,10170,17671,0,"kelidan SAY_SLAY_2"),
8+
(17377,3,0,"Good...luck. You'll need it.",14,0,100,0,0,10171,17672,0,"kelidan SAY_DEATH"),
9+
10+
(17653,0,0,"You mustn't let him loose!",14,0,100,0,0,10166,17673,0,"Shadowmoon Channeler SAY_AGGRO_1"),
11+
(17653,0,1,"Ignorant whelps!",14,0,100,0,0,10167,17674,0,"Shadowmoon Channeler SAY_AGGRO_2"),
12+
(17653,0,2,"You fools! He'll kill us all!",14,0,100,0,0,10168,17675,0,"Shadowmoon Channeler SAY_AGGRO_3");

src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,6 @@ inline AI* GetBloodFurnaceAI(T* obj)
9191
}
9292

9393
#define RegisterBloodFurnaceCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBloodFurnaceAI)
94+
#define RegisterBloodFurnaceGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetBloodFurnaceAI)
9495

9596
#endif // BLOOD_FURNACE_H_

src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp

Lines changed: 124 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
#include "SpellAuraEffects.h"
2727
#include "SpellScript.h"
2828

29-
enum Yells
29+
enum BroggokTexts
3030
{
31-
SAY_AGGRO = 0
31+
SAY_AGGRO = 0
3232
};
3333

34-
enum Spells
34+
enum BroggokSpells
3535
{
3636
SPELL_SLIME_SPRAY = 30913,
3737
SPELL_POISON_CLOUD = 30916,
@@ -46,107 +46,98 @@ enum Spells
4646
SPELL_CHARGE = 22120
4747
};
4848

49-
enum Events
49+
enum BroggokEvents
5050
{
51-
EVENT_SLIME_SPRAY = 1,
51+
EVENT_SLIME_SPRAY = 1,
5252
EVENT_POISON_BOLT,
5353
EVENT_POISON_CLOUD,
5454
};
5555

56-
class boss_broggok : public CreatureScript
56+
// 17380 - Broggok
57+
struct boss_broggok : public BossAI
5758
{
58-
public:
59-
boss_broggok() : CreatureScript("boss_broggok") { }
59+
boss_broggok(Creature* creature) : BossAI(creature, DATA_BROGGOK) { }
6060

61-
struct boss_broggokAI : public BossAI
62-
{
63-
boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK) { }
64-
65-
void Reset() override
66-
{
67-
_Reset();
68-
DoAction(ACTION_RESET_BROGGOK);
69-
}
70-
71-
void JustEngagedWith(Unit* who) override
72-
{
73-
BossAI::JustEngagedWith(who);
74-
Talk(SAY_AGGRO);
75-
}
76-
77-
void JustSummoned(Creature* summoned) override
78-
{
79-
if (summoned->GetEntry() == NPC_BROGGOK_POISON_CLOUD)
80-
{
81-
summoned->SetReactState(REACT_PASSIVE);
82-
summoned->CastSpell(summoned, SPELL_POISON_CLOUD_PASSIVE, true);
83-
summons.Summon(summoned);
84-
}
85-
else if (summoned->GetEntry() == NPC_INCOMBAT_TRIGGER)
86-
{
87-
summoned->SetReactState(REACT_PASSIVE);
88-
DoZoneInCombat(summoned);
89-
summons.Summon(summoned);
90-
}
91-
}
61+
void Reset() override
62+
{
63+
_Reset();
64+
DoAction(ACTION_RESET_BROGGOK);
65+
}
9266

93-
void ExecuteEvent(uint32 eventId) override
94-
{
95-
switch (eventId)
96-
{
97-
case EVENT_SLIME_SPRAY:
98-
DoCastVictim(SPELL_SLIME_SPRAY);
99-
events.ScheduleEvent(EVENT_SLIME_SPRAY, 4s, 12s);
100-
break;
101-
case EVENT_POISON_BOLT:
102-
DoCastVictim(SPELL_POISON_BOLT);
103-
events.ScheduleEvent(EVENT_POISON_BOLT, 4s, 12s);
104-
break;
105-
case EVENT_POISON_CLOUD:
106-
DoCast(me, SPELL_POISON_CLOUD);
107-
events.ScheduleEvent(EVENT_POISON_CLOUD, 20s);
108-
break;
109-
default:
110-
break;
111-
}
112-
}
67+
void JustEngagedWith(Unit* who) override
68+
{
69+
BossAI::JustEngagedWith(who);
70+
Talk(SAY_AGGRO);
71+
72+
events.ScheduleEvent(EVENT_SLIME_SPRAY, 10s);
73+
events.ScheduleEvent(EVENT_POISON_BOLT, 7s);
74+
events.ScheduleEvent(EVENT_POISON_CLOUD, 5s);
75+
}
11376

114-
void DoAction(int32 action) override
115-
{
116-
switch (action)
77+
void JustSummoned(Creature* summoned) override
78+
{
79+
if (summoned->GetEntry() == NPC_BROGGOK_POISON_CLOUD)
80+
{
81+
summoned->SetReactState(REACT_PASSIVE);
82+
summoned->CastSpell(summoned, SPELL_POISON_CLOUD_PASSIVE, true);
83+
summons.Summon(summoned);
84+
}
85+
else if (summoned->GetEntry() == NPC_INCOMBAT_TRIGGER)
86+
{
87+
summoned->SetReactState(REACT_PASSIVE);
88+
DoZoneInCombat(summoned);
89+
summons.Summon(summoned);
90+
}
91+
}
92+
93+
void DoAction(int32 action) override
94+
{
95+
switch (action)
96+
{
97+
case ACTION_PREPARE_BROGGOK:
98+
DoCastSelf(SPELL_SUMMON_INCOMBAT_TRIGGER);
99+
break;
100+
case ACTION_ACTIVATE_BROGGOK:
101+
me->SetReactState(REACT_AGGRESSIVE);
102+
me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
103+
DoZoneInCombat();
104+
break;
105+
case ACTION_RESET_BROGGOK:
106+
me->SetReactState(REACT_PASSIVE);
107+
me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
108+
summons.DespawnAll();
109+
instance->SetBossState(DATA_BROGGOK, NOT_STARTED);
110+
if (GameObject * lever = instance->GetGameObject(DATA_BROGGOK_LEVER))
117111
{
118-
case ACTION_PREPARE_BROGGOK:
119-
DoCastSelf(SPELL_SUMMON_INCOMBAT_TRIGGER);
120-
break;
121-
case ACTION_ACTIVATE_BROGGOK:
122-
me->SetReactState(REACT_AGGRESSIVE);
123-
me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
124-
DoZoneInCombat();
125-
events.ScheduleEvent(EVENT_SLIME_SPRAY, 10s);
126-
events.ScheduleEvent(EVENT_POISON_BOLT, 7s);
127-
events.ScheduleEvent(EVENT_POISON_CLOUD, 5s);
128-
break;
129-
case ACTION_RESET_BROGGOK:
130-
me->SetReactState(REACT_PASSIVE);
131-
me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
132-
summons.DespawnAll();
133-
instance->SetBossState(DATA_BROGGOK, NOT_STARTED);
134-
if (GameObject * lever = instance->GetGameObject(DATA_BROGGOK_LEVER))
135-
{
136-
lever->RemoveFlag(GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
137-
lever->SetGoState(GO_STATE_READY);
138-
}
139-
break;
140-
default:
141-
break;
112+
lever->RemoveFlag(GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
113+
lever->SetGoState(GO_STATE_READY);
142114
}
143-
}
144-
};
115+
break;
116+
default:
117+
break;
118+
}
119+
}
145120

146-
CreatureAI* GetAI(Creature* creature) const override
121+
void ExecuteEvent(uint32 eventId) override
122+
{
123+
switch (eventId)
147124
{
148-
return GetBloodFurnaceAI<boss_broggokAI>(creature);
125+
case EVENT_SLIME_SPRAY:
126+
DoCastVictim(SPELL_SLIME_SPRAY);
127+
events.Repeat(4s, 12s);
128+
break;
129+
case EVENT_POISON_BOLT:
130+
DoCastVictim(SPELL_POISON_BOLT);
131+
events.Repeat(4s, 12s);
132+
break;
133+
case EVENT_POISON_CLOUD:
134+
DoCastSelf(SPELL_POISON_CLOUD);
135+
events.Repeat(20s);
136+
break;
137+
default:
138+
break;
149139
}
140+
}
150141
};
151142

152143
static Emote const PrisionersEmotes[] =
@@ -204,6 +195,7 @@ struct BroggokPrisionersAI : public ScriptedAI
204195
TaskScheduler scheduler;
205196
};
206197

198+
// 17398 - Nascent Fel Orc
207199
struct npc_nascent_fel_orc : public BroggokPrisionersAI
208200
{
209201
npc_nascent_fel_orc(Creature* creature) : BroggokPrisionersAI(creature) { }
@@ -223,6 +215,7 @@ struct npc_nascent_fel_orc : public BroggokPrisionersAI
223215

224216
};
225217

218+
// 17429 - Fel Orc Neophyte
226219
struct npc_fel_orc_neophyte : public BroggokPrisionersAI
227220
{
228221
npc_fel_orc_neophyte(Creature* creature) : BroggokPrisionersAI(creature) { }
@@ -242,82 +235,61 @@ struct npc_fel_orc_neophyte : public BroggokPrisionersAI
242235

243236
};
244237

245-
class go_broggok_lever : public GameObjectScript
238+
// 181982 - Cell Door Lever
239+
struct go_broggok_lever : public GameObjectAI
246240
{
247-
public:
248-
go_broggok_lever() : GameObjectScript("go_broggok_lever") { }
241+
go_broggok_lever(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
249242

250-
struct go_broggok_leverAI : public GameObjectAI
251-
{
252-
go_broggok_leverAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
253-
254-
InstanceScript* instance;
255-
256-
bool OnGossipHello(Player* /*player*/) override
257-
{
258-
if (instance->GetBossState(DATA_BROGGOK) != DONE && instance->GetBossState(DATA_BROGGOK) != IN_PROGRESS)
259-
{
260-
instance->SetBossState(DATA_BROGGOK, IN_PROGRESS);
261-
if (Creature* broggok = instance->GetCreature(DATA_BROGGOK))
262-
broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
263-
}
264-
265-
me->SetFlag(GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
266-
me->SetGoState(GO_STATE_ACTIVE);
267-
268-
return true;
269-
}
270-
};
243+
InstanceScript* instance;
271244

272-
GameObjectAI* GetAI(GameObject* go) const override
245+
bool OnGossipHello(Player* /*player*/) override
246+
{
247+
if (instance->GetBossState(DATA_BROGGOK) != DONE && instance->GetBossState(DATA_BROGGOK) != IN_PROGRESS)
273248
{
274-
return GetBloodFurnaceAI<go_broggok_leverAI>(go);
249+
instance->SetBossState(DATA_BROGGOK, IN_PROGRESS);
250+
if (Creature* broggok = instance->GetCreature(DATA_BROGGOK))
251+
broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
275252
}
253+
254+
me->SetFlag(GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
255+
me->SetGoState(GO_STATE_ACTIVE);
256+
257+
return true;
258+
}
276259
};
277260

278261
// 30914, 38462 - Poison
279-
class spell_broggok_poison_cloud : public SpellScriptLoader
262+
class spell_broggok_poison_cloud : public AuraScript
280263
{
281-
public:
282-
spell_broggok_poison_cloud() : SpellScriptLoader("spell_broggok_poison_cloud") { }
264+
PrepareAuraScript(spell_broggok_poison_cloud);
283265

284-
class spell_broggok_poison_cloud_AuraScript : public AuraScript
285-
{
286-
PrepareAuraScript(spell_broggok_poison_cloud_AuraScript);
287-
288-
bool Validate(SpellInfo const* spellInfo) override
289-
{
290-
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
291-
}
292-
293-
void PeriodicTick(AuraEffect const* aurEff)
294-
{
295-
PreventDefaultAction();
296-
if (!aurEff->GetTotalTicks())
297-
return;
298-
299-
uint32 triggerSpell = aurEff->GetSpellEffectInfo().TriggerSpell;
300-
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
301-
GetTarget()->CastSpell(nullptr, triggerSpell, CastSpellExtraArgs(aurEff).AddSpellMod(SPELLVALUE_RADIUS_MOD, mod));
302-
}
303-
304-
void Register() override
305-
{
306-
OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
307-
}
308-
};
309-
310-
AuraScript* GetAuraScript() const override
311-
{
312-
return new spell_broggok_poison_cloud_AuraScript();
313-
}
266+
bool Validate(SpellInfo const* spellInfo) override
267+
{
268+
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
269+
}
270+
271+
void PeriodicTick(AuraEffect const* aurEff)
272+
{
273+
PreventDefaultAction();
274+
if (!aurEff->GetTotalTicks())
275+
return;
276+
277+
uint32 triggerSpell = aurEff->GetSpellEffectInfo().TriggerSpell;
278+
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
279+
GetTarget()->CastSpell(nullptr, triggerSpell, CastSpellExtraArgs(aurEff).AddSpellMod(SPELLVALUE_RADIUS_MOD, mod));
280+
}
281+
282+
void Register() override
283+
{
284+
OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
285+
}
314286
};
315287

316288
void AddSC_boss_broggok()
317289
{
318-
new boss_broggok();
290+
RegisterBloodFurnaceCreatureAI(boss_broggok);
319291
RegisterBloodFurnaceCreatureAI(npc_nascent_fel_orc);
320292
RegisterBloodFurnaceCreatureAI(npc_fel_orc_neophyte);
321-
new go_broggok_lever();
322-
new spell_broggok_poison_cloud();
293+
RegisterBloodFurnaceGameObjectAI(go_broggok_lever);
294+
RegisterSpellScript(spell_broggok_poison_cloud);
323295
}

0 commit comments

Comments
 (0)