15
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
*/
17
17
18
- /* ScriptData
19
- SDName: Boss_NexusPrince_Shaffar
20
- SD%Complete: 80
21
- SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro.
22
- SDCategory: Auchindoun, Mana Tombs
23
- EndScriptData */
18
+ /*
19
+ * Timers requires to be revisited
20
+ * Find a better way to deal with his three initial beacons to make sure all aggro
21
+ * His caster mode requires rechecks
22
+ * Move away after succesful Frost Nova cast (seems like doesn't always triggered)
23
+ */
24
24
25
25
#include " ScriptMgr.h"
26
+ #include " ScriptedCreature.h"
27
+ #include " SpellInfo.h"
26
28
#include " mana_tombs.h"
27
29
#include " MotionMaster.h"
28
- #include " ScriptedCreature.h"
29
30
30
- enum Yells
31
+ enum ShaffarTexts
31
32
{
32
33
SAY_INTRO = 0 ,
33
34
SAY_AGGRO = 1 ,
34
35
SAY_SLAY = 2 ,
35
36
SAY_SUMMON = 3 ,
36
- SAY_DEAD = 4
37
+ SAY_DEATH = 4
37
38
};
38
39
39
- enum Spells
40
+ enum ShaffarSpells
40
41
{
42
+ // Shaffar
41
43
SPELL_BLINK = 34605 ,
42
- SPELL_FROSTBOLT = 32364 ,
43
44
SPELL_FIREBALL = 32363 ,
45
+ SPELL_FROSTBOLT = 32364 ,
44
46
SPELL_FROSTNOVA = 32365 ,
45
47
46
- SPELL_ETHEREAL_BEACON = 32371 , // Summons NPC_BEACON
47
- SPELL_ETHEREAL_BEACON_VISUAL = 32368 ,
48
+ SPELL_ETHEREAL_BEACON = 32371 ,
48
49
49
50
// Ethereal Beacon
51
+ SPELL_ETHEREAL_BEACON_VISUAL = 32368 ,
50
52
SPELL_ARCANE_BOLT = 15254 ,
51
- SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430
53
+ SPELL_ETHEREAL_APPRENTICE = 32372
52
54
};
53
55
54
- enum Creatures
56
+ enum ShaffarEvents
55
57
{
56
- NPC_BEACON = 18431 ,
57
- NPC_SHAFFAR = 18344
58
- };
58
+ EVENT_BLINK = 1 ,
59
+ EVENT_BEACON,
60
+ EVENT_MAIN_SPELL,
61
+ EVENT_FROST_NOVA,
59
62
60
- enum Misc
61
- {
62
- NR_INITIAL_BEACONS = 3
63
+ // Ethereal Beacon
64
+ EVENT_SUMMON_APPRENTICE,
65
+ EVENT_ARCANE_BOLT
63
66
};
64
67
65
- enum Events
68
+ enum ShaffarCreatures
66
69
{
67
- EVENT_BLINK = 1 ,
68
- EVENT_BEACON,
69
- EVENT_FIREBALL,
70
- EVENT_FROSTBOLT,
71
- EVENT_FROST_NOVA
70
+ NPC_BEACON = 18431 ,
71
+ NPC_SHAFFAR = 18344
72
72
};
73
73
74
+ // 18344 - Nexus-Prince Shaffar
74
75
struct boss_nexusprince_shaffar : public BossAI
75
76
{
76
- boss_nexusprince_shaffar (Creature* creature) : BossAI(creature, DATA_NEXUSPRINCE_SHAFFAR)
77
- {
78
- _hasTaunted = false ;
79
- }
77
+ boss_nexusprince_shaffar (Creature* creature) : BossAI(creature, DATA_NEXUSPRINCE_SHAFFAR), _hasTaunted(false ) { }
80
78
81
79
void Reset () override
82
80
{
83
81
_Reset ();
84
82
85
- float dist = 8 .0f ;
86
- float posX, posY, posZ, angle;
87
- me->GetHomePosition (posX, posY, posZ, angle);
88
-
89
- me->SummonCreature (NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2h);
90
- me->SummonCreature (NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2h);
91
- me->SummonCreature (NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2h);
83
+ me->SummonCreature (NPC_BEACON, -191 .116f , 3 .82914f , 16 .7834f , 3 .62003f , TEMPSUMMON_MANUAL_DESPAWN);
84
+ me->SummonCreature (NPC_BEACON, -180 .408f , 10 .9629f , 16 .7025f , 3 .45070f , TEMPSUMMON_MANUAL_DESPAWN);
85
+ me->SummonCreature (NPC_BEACON, -185 .980f , 14 .4201f , 16 .7234f , 1 .31540f , TEMPSUMMON_MANUAL_DESPAWN);
92
86
}
93
87
94
88
void MoveInLineOfSight (Unit* who) override
@@ -105,25 +99,33 @@ struct boss_nexusprince_shaffar : public BossAI
105
99
Talk (SAY_AGGRO);
106
100
BossAI::JustEngagedWith (who);
107
101
108
- events.ScheduleEvent (EVENT_BEACON, 10s );
109
- events.ScheduleEvent (EVENT_FIREBALL, 8s );
110
- events.ScheduleEvent (EVENT_FROSTBOLT, 4s );
111
- events.ScheduleEvent (EVENT_FROST_NOVA, 15s);
102
+ events.ScheduleEvent (EVENT_BLINK, 20s, 30s );
103
+ events.ScheduleEvent (EVENT_BEACON, 10s, 30s );
104
+ events.ScheduleEvent (EVENT_MAIN_SPELL, 0s, 6s );
105
+ events.ScheduleEvent (EVENT_FROST_NOVA, 15s, 35s );
112
106
}
113
107
114
108
void JustSummoned (Creature* summoned) override
115
109
{
116
110
if (summoned->GetEntry () == NPC_BEACON)
117
111
{
118
- summoned->CastSpell (summoned, SPELL_ETHEREAL_BEACON_VISUAL, false );
119
-
120
112
if (Unit* target = SelectTarget (SelectTargetMethod::Random, 0 ))
121
113
summoned->AI ()->AttackStart (target);
114
+
115
+ if (!me->IsInCombat ())
116
+ summoned->GetMotionMaster ()->MoveRandom (5 .0f );
122
117
}
123
118
124
119
summons.Summon (summoned);
125
120
}
126
121
122
+ void OnSpellCast (SpellInfo const * spell) override
123
+ {
124
+ if (spell->Id == SPELL_ETHEREAL_BEACON)
125
+ if (roll_chance_i (50 ))
126
+ Talk (SAY_SUMMON);
127
+ }
128
+
127
129
void KilledUnit (Unit* victim) override
128
130
{
129
131
if (victim->GetTypeId () == TYPEID_PLAYER)
@@ -132,7 +134,7 @@ struct boss_nexusprince_shaffar : public BossAI
132
134
133
135
void JustDied (Unit* /* killer*/ ) override
134
136
{
135
- Talk (SAY_DEAD );
137
+ Talk (SAY_DEATH );
136
138
_JustDied ();
137
139
}
138
140
@@ -141,34 +143,25 @@ struct boss_nexusprince_shaffar : public BossAI
141
143
switch (eventId)
142
144
{
143
145
case EVENT_BLINK:
144
- if (me->IsNonMeleeSpellCast (false ))
145
- me->InterruptNonMeleeSpells (true );
146
-
147
- // expire movement, will prevent from running right back to victim after cast
148
- // (but should MoveChase be used again at a certain time or should he not move?)
149
- me->GetMotionMaster ()->Clear (MOTION_PRIORITY_NORMAL);
150
-
151
- DoCast (me, SPELL_BLINK);
146
+ DoCastSelf (SPELL_BLINK);
147
+ events.Repeat (40s, 60s);
148
+ events.RescheduleEvent (EVENT_MAIN_SPELL, 0s);
152
149
break ;
153
150
case EVENT_BEACON:
154
- if (!urand (0 , 3 ))
155
- Talk (SAY_SUMMON);
156
-
157
- DoCast (me, SPELL_ETHEREAL_BEACON, true );
158
- events.ScheduleEvent (EVENT_BEACON, 10s);
151
+ DoCastSelf (SPELL_ETHEREAL_BEACON);
152
+ events.Repeat (20s);
159
153
break ;
160
- case EVENT_FIREBALL :
161
- DoCastVictim (SPELL_FROSTBOLT);
162
- events. ScheduleEvent (EVENT_FIREBALL, 4500ms, 6s);
163
- break ;
164
- case EVENT_FROSTBOLT:
165
- DoCastVictim (SPELL_FROSTBOLT);
166
- events.ScheduleEvent (EVENT_FROSTBOLT, 4500ms, 6s );
154
+ case EVENT_MAIN_SPELL :
155
+ DoCastVictim (RAND (SPELL_FIREBALL, SPELL_FROSTBOLT) );
156
+
157
+ if (me-> IsWithinMeleeRange (me-> GetVictim ()))
158
+ events. Repeat (1s, 6s);
159
+ else
160
+ events.Repeat (1s );
167
161
break ;
168
162
case EVENT_FROST_NOVA:
169
- DoCast (me, SPELL_FROSTNOVA);
170
- events.ScheduleEvent (EVENT_FROST_NOVA, 17500ms, 25s);
171
- events.ScheduleEvent (EVENT_BLINK, 1500ms);
163
+ DoCastSelf (SPELL_FROSTNOVA);
164
+ events.Repeat (15s, 25s);
172
165
break ;
173
166
default :
174
167
break ;
@@ -179,16 +172,16 @@ struct boss_nexusprince_shaffar : public BossAI
179
172
bool _hasTaunted;
180
173
};
181
174
182
- enum EtherealBeacon
183
- {
184
- EVENT_APPRENTICE = 1 ,
185
- EVENT_ARCANE_BOLT
186
- };
187
-
175
+ // 18431 - Ethereal Beacon
188
176
struct npc_ethereal_beacon : public ScriptedAI
189
177
{
190
178
npc_ethereal_beacon (Creature* creature) : ScriptedAI(creature) { }
191
179
180
+ void JustAppeared () override
181
+ {
182
+ DoCastSelf (SPELL_ETHEREAL_BEACON_VISUAL);
183
+ }
184
+
192
185
void Reset () override
193
186
{
194
187
_events.Reset ();
@@ -200,8 +193,8 @@ struct npc_ethereal_beacon : public ScriptedAI
200
193
if (!shaffar->IsInCombat ())
201
194
shaffar->AI ()->AttackStart (who);
202
195
203
- _events.ScheduleEvent (EVENT_APPRENTICE , DUNGEON_MODE (20s, 10s));
204
- _events.ScheduleEvent (EVENT_ARCANE_BOLT, 1s );
196
+ _events.ScheduleEvent (EVENT_SUMMON_APPRENTICE , DUNGEON_MODE (20s, 10s));
197
+ _events.ScheduleEvent (EVENT_ARCANE_BOLT, 3s, 10s );
205
198
}
206
199
207
200
void JustSummoned (Creature* summoned) override
@@ -223,13 +216,17 @@ struct npc_ethereal_beacon : public ScriptedAI
223
216
{
224
217
switch (eventId)
225
218
{
226
- case EVENT_APPRENTICE:
227
- DoCast (me, SPELL_ETHEREAL_APPRENTICE, true );
228
- me->DespawnOrUnsummon ();
219
+ case EVENT_SUMMON_APPRENTICE:
220
+ DoCastSelf (SPELL_ETHEREAL_APPRENTICE);
221
+ me->AttackStop ();
222
+ me->SetReactState (REACT_PASSIVE);
223
+ me->SetImmuneToPC (true );
224
+ me->SetUnitFlag (UNIT_FLAG_UNINTERACTIBLE);
225
+ me->DespawnOrUnsummon (2s);
229
226
break ;
230
227
case EVENT_ARCANE_BOLT:
231
228
DoCastVictim (SPELL_ARCANE_BOLT);
232
- _events.ScheduleEvent (EVENT_ARCANE_BOLT, 2s, 4500ms );
229
+ _events.Repeat (3s, 10s );
233
230
break ;
234
231
default :
235
232
break ;
@@ -243,24 +240,31 @@ struct npc_ethereal_beacon : public ScriptedAI
243
240
244
241
enum EtherealApprentice
245
242
{
243
+ SPELL_SIMPLE_TELEPORT = 12980 ,
246
244
SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369 ,
247
245
SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 ,
248
246
EVENT_ETHEREAL_APPRENTICE_FIREBOLT = 1 ,
249
247
EVENT_ETHEREAL_APPRENTICE_FROSTBOLT
250
248
};
251
249
250
+ // 18430 - Ethereal Apprentice
252
251
struct npc_ethereal_apprentice : public ScriptedAI
253
252
{
254
253
npc_ethereal_apprentice (Creature* creature) : ScriptedAI(creature) { }
255
254
255
+ void JustAppeared () override
256
+ {
257
+ DoCastSelf (SPELL_SIMPLE_TELEPORT);
258
+ }
259
+
256
260
void Reset () override
257
261
{
258
262
_events.Reset ();
259
263
}
260
264
261
265
void JustEngagedWith (Unit* /* who*/ ) override
262
266
{
263
- _events.ScheduleEvent (EVENT_ETHEREAL_APPRENTICE_FIREBOLT, 3s );
267
+ _events.ScheduleEvent (RAND ( EVENT_ETHEREAL_APPRENTICE_FIREBOLT, EVENT_ETHEREAL_APPRENTICE_FROSTBOLT), 0s );
264
268
}
265
269
266
270
void UpdateAI (uint32 diff) override
@@ -278,11 +282,11 @@ struct npc_ethereal_apprentice : public ScriptedAI
278
282
switch (eventId)
279
283
{
280
284
case EVENT_ETHEREAL_APPRENTICE_FIREBOLT:
281
- DoCastVictim (SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true );
285
+ DoCastVictim (SPELL_ETHEREAL_APPRENTICE_FIREBOLT);
282
286
_events.ScheduleEvent (EVENT_ETHEREAL_APPRENTICE_FROSTBOLT, 3s);
283
287
break ;
284
288
case EVENT_ETHEREAL_APPRENTICE_FROSTBOLT:
285
- DoCastVictim (SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true );
289
+ DoCastVictim (SPELL_ETHEREAL_APPRENTICE_FROSTBOLT);
286
290
_events.ScheduleEvent (EVENT_ETHEREAL_APPRENTICE_FIREBOLT, 3s);
287
291
break ;
288
292
default :
@@ -295,55 +299,9 @@ struct npc_ethereal_apprentice : public ScriptedAI
295
299
EventMap _events;
296
300
};
297
301
298
- enum Yor
299
- {
300
- SPELL_DOUBLE_BREATH = 38361 ,
301
- EVENT_DOUBLE_BREATH = 1
302
- };
303
-
304
- struct npc_yor : public ScriptedAI
305
- {
306
- npc_yor (Creature* creature) : ScriptedAI(creature) { }
307
-
308
- void Reset () override { }
309
-
310
- void JustEngagedWith (Unit* /* who*/ ) override
311
- {
312
- _events.ScheduleEvent (EVENT_DOUBLE_BREATH, 6s, 9s);
313
- }
314
-
315
- void UpdateAI (uint32 diff) override
316
- {
317
- if (!UpdateVictim ())
318
- return ;
319
-
320
- _events.Update (diff);
321
-
322
- while (uint32 eventId = _events.ExecuteEvent ())
323
- {
324
- switch (eventId)
325
- {
326
- case EVENT_DOUBLE_BREATH:
327
- if (me->IsWithinDist (me->GetVictim (), ATTACK_DISTANCE))
328
- DoCastVictim (SPELL_DOUBLE_BREATH);
329
- _events.ScheduleEvent (EVENT_DOUBLE_BREATH, 6s, 9s);
330
- break ;
331
- default :
332
- break ;
333
- }
334
- }
335
-
336
- DoMeleeAttackIfReady ();
337
- }
338
-
339
- private:
340
- EventMap _events;
341
- };
342
-
343
302
void AddSC_boss_nexusprince_shaffar ()
344
303
{
345
304
RegisterManaTombsCreatureAI (boss_nexusprince_shaffar);
346
305
RegisterManaTombsCreatureAI (npc_ethereal_beacon);
347
306
RegisterManaTombsCreatureAI (npc_ethereal_apprentice);
348
- RegisterManaTombsCreatureAI (npc_yor);
349
307
}
0 commit comments