Skip to content

Commit 539f6e4

Browse files
authored
Scripts/Mana Tombs: Update scripts (TrinityCore#31024)
1 parent dde4541 commit 539f6e4

File tree

4 files changed

+182
-162
lines changed

4 files changed

+182
-162
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--
2+
DELETE FROM `smart_scripts` WHERE `entryorguid` = 185522 AND `source_type` = 1 AND `id` = 1;
3+
UPDATE `smart_scripts` SET `link` = 0 WHERE `entryorguid` = 185522 AND `source_type` = 1 AND `id` = 0;

src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp

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

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+
*/
2424

2525
#include "ScriptMgr.h"
26+
#include "ScriptedCreature.h"
27+
#include "SpellInfo.h"
2628
#include "mana_tombs.h"
2729
#include "MotionMaster.h"
28-
#include "ScriptedCreature.h"
2930

30-
enum Yells
31+
enum ShaffarTexts
3132
{
3233
SAY_INTRO = 0,
3334
SAY_AGGRO = 1,
3435
SAY_SLAY = 2,
3536
SAY_SUMMON = 3,
36-
SAY_DEAD = 4
37+
SAY_DEATH = 4
3738
};
3839

39-
enum Spells
40+
enum ShaffarSpells
4041
{
42+
// Shaffar
4143
SPELL_BLINK = 34605,
42-
SPELL_FROSTBOLT = 32364,
4344
SPELL_FIREBALL = 32363,
45+
SPELL_FROSTBOLT = 32364,
4446
SPELL_FROSTNOVA = 32365,
4547

46-
SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON
47-
SPELL_ETHEREAL_BEACON_VISUAL = 32368,
48+
SPELL_ETHEREAL_BEACON = 32371,
4849

4950
// Ethereal Beacon
51+
SPELL_ETHEREAL_BEACON_VISUAL = 32368,
5052
SPELL_ARCANE_BOLT = 15254,
51-
SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430
53+
SPELL_ETHEREAL_APPRENTICE = 32372
5254
};
5355

54-
enum Creatures
56+
enum ShaffarEvents
5557
{
56-
NPC_BEACON = 18431,
57-
NPC_SHAFFAR = 18344
58-
};
58+
EVENT_BLINK = 1,
59+
EVENT_BEACON,
60+
EVENT_MAIN_SPELL,
61+
EVENT_FROST_NOVA,
5962

60-
enum Misc
61-
{
62-
NR_INITIAL_BEACONS = 3
63+
// Ethereal Beacon
64+
EVENT_SUMMON_APPRENTICE,
65+
EVENT_ARCANE_BOLT
6366
};
6467

65-
enum Events
68+
enum ShaffarCreatures
6669
{
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
7272
};
7373

74+
// 18344 - Nexus-Prince Shaffar
7475
struct boss_nexusprince_shaffar : public BossAI
7576
{
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) { }
8078

8179
void Reset() override
8280
{
8381
_Reset();
8482

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);
9286
}
9387

9488
void MoveInLineOfSight(Unit* who) override
@@ -105,25 +99,33 @@ struct boss_nexusprince_shaffar : public BossAI
10599
Talk(SAY_AGGRO);
106100
BossAI::JustEngagedWith(who);
107101

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);
112106
}
113107

114108
void JustSummoned(Creature* summoned) override
115109
{
116110
if (summoned->GetEntry() == NPC_BEACON)
117111
{
118-
summoned->CastSpell(summoned, SPELL_ETHEREAL_BEACON_VISUAL, false);
119-
120112
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
121113
summoned->AI()->AttackStart(target);
114+
115+
if (!me->IsInCombat())
116+
summoned->GetMotionMaster()->MoveRandom(5.0f);
122117
}
123118

124119
summons.Summon(summoned);
125120
}
126121

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+
127129
void KilledUnit(Unit* victim) override
128130
{
129131
if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -132,7 +134,7 @@ struct boss_nexusprince_shaffar : public BossAI
132134

133135
void JustDied(Unit* /*killer*/) override
134136
{
135-
Talk(SAY_DEAD);
137+
Talk(SAY_DEATH);
136138
_JustDied();
137139
}
138140

@@ -141,34 +143,25 @@ struct boss_nexusprince_shaffar : public BossAI
141143
switch (eventId)
142144
{
143145
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);
152149
break;
153150
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);
159153
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);
167161
break;
168162
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);
172165
break;
173166
default:
174167
break;
@@ -179,16 +172,16 @@ struct boss_nexusprince_shaffar : public BossAI
179172
bool _hasTaunted;
180173
};
181174

182-
enum EtherealBeacon
183-
{
184-
EVENT_APPRENTICE = 1,
185-
EVENT_ARCANE_BOLT
186-
};
187-
175+
// 18431 - Ethereal Beacon
188176
struct npc_ethereal_beacon : public ScriptedAI
189177
{
190178
npc_ethereal_beacon(Creature* creature) : ScriptedAI(creature) { }
191179

180+
void JustAppeared() override
181+
{
182+
DoCastSelf(SPELL_ETHEREAL_BEACON_VISUAL);
183+
}
184+
192185
void Reset() override
193186
{
194187
_events.Reset();
@@ -200,8 +193,8 @@ struct npc_ethereal_beacon : public ScriptedAI
200193
if (!shaffar->IsInCombat())
201194
shaffar->AI()->AttackStart(who);
202195

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);
205198
}
206199

207200
void JustSummoned(Creature* summoned) override
@@ -223,13 +216,17 @@ struct npc_ethereal_beacon : public ScriptedAI
223216
{
224217
switch (eventId)
225218
{
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);
229226
break;
230227
case EVENT_ARCANE_BOLT:
231228
DoCastVictim(SPELL_ARCANE_BOLT);
232-
_events.ScheduleEvent(EVENT_ARCANE_BOLT, 2s, 4500ms);
229+
_events.Repeat(3s, 10s);
233230
break;
234231
default:
235232
break;
@@ -243,24 +240,31 @@ struct npc_ethereal_beacon : public ScriptedAI
243240

244241
enum EtherealApprentice
245242
{
243+
SPELL_SIMPLE_TELEPORT = 12980,
246244
SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369,
247245
SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370,
248246
EVENT_ETHEREAL_APPRENTICE_FIREBOLT = 1,
249247
EVENT_ETHEREAL_APPRENTICE_FROSTBOLT
250248
};
251249

250+
// 18430 - Ethereal Apprentice
252251
struct npc_ethereal_apprentice : public ScriptedAI
253252
{
254253
npc_ethereal_apprentice(Creature* creature) : ScriptedAI(creature) { }
255254

255+
void JustAppeared() override
256+
{
257+
DoCastSelf(SPELL_SIMPLE_TELEPORT);
258+
}
259+
256260
void Reset() override
257261
{
258262
_events.Reset();
259263
}
260264

261265
void JustEngagedWith(Unit* /*who*/) override
262266
{
263-
_events.ScheduleEvent(EVENT_ETHEREAL_APPRENTICE_FIREBOLT, 3s);
267+
_events.ScheduleEvent(RAND(EVENT_ETHEREAL_APPRENTICE_FIREBOLT, EVENT_ETHEREAL_APPRENTICE_FROSTBOLT), 0s);
264268
}
265269

266270
void UpdateAI(uint32 diff) override
@@ -278,11 +282,11 @@ struct npc_ethereal_apprentice : public ScriptedAI
278282
switch (eventId)
279283
{
280284
case EVENT_ETHEREAL_APPRENTICE_FIREBOLT:
281-
DoCastVictim(SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true);
285+
DoCastVictim(SPELL_ETHEREAL_APPRENTICE_FIREBOLT);
282286
_events.ScheduleEvent(EVENT_ETHEREAL_APPRENTICE_FROSTBOLT, 3s);
283287
break;
284288
case EVENT_ETHEREAL_APPRENTICE_FROSTBOLT:
285-
DoCastVictim(SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true);
289+
DoCastVictim(SPELL_ETHEREAL_APPRENTICE_FROSTBOLT);
286290
_events.ScheduleEvent(EVENT_ETHEREAL_APPRENTICE_FIREBOLT, 3s);
287291
break;
288292
default:
@@ -295,55 +299,9 @@ struct npc_ethereal_apprentice : public ScriptedAI
295299
EventMap _events;
296300
};
297301

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-
343302
void AddSC_boss_nexusprince_shaffar()
344303
{
345304
RegisterManaTombsCreatureAI(boss_nexusprince_shaffar);
346305
RegisterManaTombsCreatureAI(npc_ethereal_beacon);
347306
RegisterManaTombsCreatureAI(npc_ethereal_apprentice);
348-
RegisterManaTombsCreatureAI(npc_yor);
349307
}

0 commit comments

Comments
 (0)