26
26
#include " SpellAuraEffects.h"
27
27
#include " SpellScript.h"
28
28
29
- enum Yells
29
+ enum BroggokTexts
30
30
{
31
- SAY_AGGRO = 0
31
+ SAY_AGGRO = 0
32
32
};
33
33
34
- enum Spells
34
+ enum BroggokSpells
35
35
{
36
36
SPELL_SLIME_SPRAY = 30913 ,
37
37
SPELL_POISON_CLOUD = 30916 ,
@@ -46,107 +46,98 @@ enum Spells
46
46
SPELL_CHARGE = 22120
47
47
};
48
48
49
- enum Events
49
+ enum BroggokEvents
50
50
{
51
- EVENT_SLIME_SPRAY = 1 ,
51
+ EVENT_SLIME_SPRAY = 1 ,
52
52
EVENT_POISON_BOLT,
53
53
EVENT_POISON_CLOUD,
54
54
};
55
55
56
- class boss_broggok : public CreatureScript
56
+ // 17380 - Broggok
57
+ struct boss_broggok : public BossAI
57
58
{
58
- public:
59
- boss_broggok () : CreatureScript(" boss_broggok" ) { }
59
+ boss_broggok (Creature* creature) : BossAI(creature, DATA_BROGGOK) { }
60
60
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
+ }
92
66
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
+ }
113
76
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))
117
111
{
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);
142
114
}
143
- }
144
- };
115
+ break ;
116
+ default :
117
+ break ;
118
+ }
119
+ }
145
120
146
- CreatureAI* GetAI (Creature* creature) const override
121
+ void ExecuteEvent (uint32 eventId) override
122
+ {
123
+ switch (eventId)
147
124
{
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 ;
149
139
}
140
+ }
150
141
};
151
142
152
143
static Emote const PrisionersEmotes[] =
@@ -204,6 +195,7 @@ struct BroggokPrisionersAI : public ScriptedAI
204
195
TaskScheduler scheduler;
205
196
};
206
197
198
+ // 17398 - Nascent Fel Orc
207
199
struct npc_nascent_fel_orc : public BroggokPrisionersAI
208
200
{
209
201
npc_nascent_fel_orc (Creature* creature) : BroggokPrisionersAI(creature) { }
@@ -223,6 +215,7 @@ struct npc_nascent_fel_orc : public BroggokPrisionersAI
223
215
224
216
};
225
217
218
+ // 17429 - Fel Orc Neophyte
226
219
struct npc_fel_orc_neophyte : public BroggokPrisionersAI
227
220
{
228
221
npc_fel_orc_neophyte (Creature* creature) : BroggokPrisionersAI(creature) { }
@@ -242,82 +235,61 @@ struct npc_fel_orc_neophyte : public BroggokPrisionersAI
242
235
243
236
};
244
237
245
- class go_broggok_lever : public GameObjectScript
238
+ // 181982 - Cell Door Lever
239
+ struct go_broggok_lever : public GameObjectAI
246
240
{
247
- public:
248
- go_broggok_lever () : GameObjectScript(" go_broggok_lever" ) { }
241
+ go_broggok_lever (GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript ()) { }
249
242
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;
271
244
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)
273
248
{
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);
275
252
}
253
+
254
+ me->SetFlag (GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
255
+ me->SetGoState (GO_STATE_ACTIVE);
256
+
257
+ return true ;
258
+ }
276
259
};
277
260
278
261
// 30914, 38462 - Poison
279
- class spell_broggok_poison_cloud : public SpellScriptLoader
262
+ class spell_broggok_poison_cloud : public AuraScript
280
263
{
281
- public:
282
- spell_broggok_poison_cloud () : SpellScriptLoader(" spell_broggok_poison_cloud" ) { }
264
+ PrepareAuraScript (spell_broggok_poison_cloud);
283
265
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
+ }
314
286
};
315
287
316
288
void AddSC_boss_broggok ()
317
289
{
318
- new boss_broggok ( );
290
+ RegisterBloodFurnaceCreatureAI (boss_broggok );
319
291
RegisterBloodFurnaceCreatureAI (npc_nascent_fel_orc);
320
292
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 );
323
295
}
0 commit comments