Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_general_zarithrian.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "ScriptedEscortAI.h"
9#include "ruby_sanctum.h"
10
12{
13 SAY_AGGRO = 0, // Alexstrasza has chosen capable allies.... A pity that I must END YOU!
14 SAY_KILL = 1, // You thought you stood a chance? - It's for the best.
15 SAY_ADDS = 2, // Turn them to ash, minions!
16 SAY_DEATH = 3, // HALION! I...
17};
18
20{
21 // General Zarithrian
24 // Zarithrian Spawn Stalker
26 // Onyx Flamecaller
29};
30
32{
33 // General Zarithrian
37 // Onyx Flamecaller
40};
41
43
45{
46 // East
47 {3042.971f, 419.8809f, 86.94320f, 0.0f},
48 {3043.971f, 419.8809f, 86.94320f, 0.0f},
49 {3044.885f, 428.8281f, 86.19320f, 0.0f},
50 {3045.494f, 434.7930f, 85.56398f, 0.0f},
51 {3045.900f, 438.7695f, 84.81398f, 0.0f},
52 {3045.657f, 456.8290f, 85.95601f, 0.0f},
53 {3043.657f, 459.0790f, 87.20601f, 0.0f},
54 {3042.157f, 460.5790f, 87.70601f, 0.0f},
55 {3040.907f, 462.0790f, 88.45601f, 0.0f},
56 {3038.907f, 464.0790f, 89.20601f, 0.0f},
57 {3025.907f, 478.0790f, 89.70601f, 0.0f},
58 {3003.832f, 501.2510f, 89.47303f, 0.0f},
59 // West
60 {3062.596f, 636.9980f, 82.50338f, 0.0f},
61 {3062.514f, 624.9980f, 83.70634f, 0.0f},
62 {3062.486f, 620.9980f, 84.33134f, 0.0f},
63 {3062.445f, 613.9930f, 84.45634f, 0.0f},
64 {3062.445f, 613.9930f, 84.45634f, 0.0f},
65 {3059.208f, 610.6501f, 85.39581f, 0.0f},
66 {3055.958f, 606.9001f, 86.14581f, 0.0f},
67 {3046.458f, 596.4001f, 86.89581f, 0.0f},
68 {3043.958f, 593.4001f, 87.64581f, 0.0f},
69 {3040.458f, 589.9001f, 88.39581f, 0.0f},
70 {3034.458f, 583.1501f, 88.89581f, 0.0f},
71 {3014.970f, 561.8073f, 88.83527f, 0.0f},
72};
73
75{
76 public:
77 boss_general_zarithrian() : CreatureScript("boss_general_zarithrian") { }
78
80 {
84
86 {
87 _Reset();
88 if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
90 }
91
92 void EnterCombat(Unit* /*who*/) OVERRIDE
93 {
96 events.Reset();
97 events.ScheduleEvent(EVENT_CLEAVE, 15000);
98 events.ScheduleEvent(EVENT_INTIDMDATING_ROAR, 42000);
99 events.ScheduleEvent(EVENT_SUMMON_ADDS, 40000);
100 }
101
103 {
105 instance->SetBossState(DATA_GENERAL_ZARITHRIAN, FAIL);
106 }
107
108 // Override to not set adds in combat yet.
110 {
111 summons.Summon(summon);
112 }
113
114 void JustDied(Unit* /*killer*/) OVERRIDE
115 {
116 _JustDied();
118 }
119
121 {
122 if (victim->GetTypeId() == TypeID::TYPEID_PLAYER)
123 Talk(SAY_KILL);
124 }
125
126 bool CanAIAttack(Unit const* /*target*/) const OVERRIDE
127 {
128 return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE);
129 }
130
132 {
133 if (!UpdateVictim())
134 return;
135
136 // Can't use room boundary here, the gameobject is spawned at the same position as the boss. This is just as good anyway.
137 if (me->GetPositionX() > 3058.0f)
138 {
140 return;
141 }
142
143 events.Update(diff);
144
145 if (me->HasUnitState(UNIT_STATE_CASTING))
146 return;
147
148 while (uint32 eventId = events.ExecuteEvent())
149 {
150 switch (eventId)
151 {
153 {
155 stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, false);
156
158 stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, false);
159
160 Talk(SAY_ADDS);
161 events.ScheduleEvent(EVENT_SUMMON_ADDS, 42000);
162 break;
163 }
166 events.ScheduleEvent(EVENT_INTIDMDATING_ROAR, 42000);
167 case EVENT_CLEAVE:
169 events.ScheduleEvent(EVENT_CLEAVE, 15000);
170 break;
171 default:
172 break;
173 }
174 }
175
177 }
178 };
179
181 {
183 }
184};
185
187{
188 public:
189 npc_onyx_flamecaller() : CreatureScript("npc_onyx_flamecaller") { }
190
192 {
193 npc_onyx_flamecallerAI(Creature* creature) : npc_escortAI(creature), _instance(creature->GetInstanceScript())
194 {
196 }
197
199 {
200 _lavaGoutCount = 0;
201 me->setActive(true);
202 AddWaypoints();
203 Start(true, true);
204 }
205
206 void EnterCombat(Unit* /*who*/) OVERRIDE
207 {
208 _events.Reset();
209 _events.ScheduleEvent(EVENT_BLAST_NOVA, std::rand() % 30000 + 20000);
210 _events.ScheduleEvent(EVENT_LAVA_GOUT, 5000);
211 }
212
214 {
215 // Prevent EvadeMode
216 }
217
218 void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
219 {
220 // Let Zarithrian count as summoner. _instance cant be null since we got GetRubySanctumAI
222 zarithrian->AI()->JustSummoned(me);
223 }
224
226 {
227 if (waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS || waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2)
228 {
230 SetEscortPaused(true);
231 }
232 }
233
235 {
236 if (me->GetPositionY() < 500.0f)
237 {
238 for (uint8 i = 0; i < MAX_PATH_FLAMECALLER_WAYPOINTS; i++)
239 AddWaypoint(i, FlamecallerWaypoints[i].GetPositionX(), FlamecallerWaypoints[i].GetPositionY(), FlamecallerWaypoints[i].GetPositionZ());
240 }
241 else
242 {
244 AddWaypoint(i, FlamecallerWaypoints[j].GetPositionX(), FlamecallerWaypoints[j].GetPositionY(), FlamecallerWaypoints[j].GetPositionZ());
245 }
246 }
247
249 {
250 if (!UpdateVictim())
251 return;
252
253 _events.Update(diff);
254
255 if (me->HasUnitState(UNIT_STATE_CASTING))
256 return;
257
258 while (uint32 eventId = _events.ExecuteEvent())
259 {
260 switch (eventId)
261 {
262 case EVENT_BLAST_NOVA:
264 _events.ScheduleEvent(EVENT_BLAST_NOVA, std::rand() % 30000 + 20000);
265 break;
266 case EVENT_LAVA_GOUT:
267 if (_lavaGoutCount >= 3)
268 {
269 _lavaGoutCount = 0;
270 _events.ScheduleEvent(EVENT_LAVA_GOUT, 8000);
271 break;
272 }
275 _events.ScheduleEvent(EVENT_LAVA_GOUT, 1500);
276 break;
277 default:
278 break;
279 }
280 }
281
283 }
284 private:
288 };
289
291 {
293 }
294};
295
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ FAIL
@ DONE
@ TYPEID_PLAYER
Definition Object.h:55
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ UNIT_FIELD_FLAGS
@ EVENT_CLEAVE
#define SAY_DEATH
#define SAY_AGGRO
#define SAY_KILL
@ SPELL_SUMMON_FLAMECALLER
@ SPELL_INTIMIDATING_ROAR
void AddSC_boss_general_zarithrian()
uint32 const MAX_PATH_FLAMECALLER_WAYPOINTS
Position const FlamecallerWaypoints[MAX_PATH_FLAMECALLER_WAYPOINTS *2]
@ EVENT_INTIDMDATING_ROAR
@ SPELL_INTIMIDATING_ROAR
InstanceScript *const instance
void _JustReachedHome()
SummonList summons
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetRubySanctumAI(Creature *creature)
@ DATA_GENERAL_ZARITHRIAN
@ DATA_SAVIANA_RAGEFIRE
@ DATA_ZARITHRIAN_SPAWN_STALKER_2
@ DATA_ZARITHRIAN_SPAWN_STALKER_1
@ DATA_BALTHARUS_THE_WARBORN
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_escortAI(Creature *creature)
void SetDespawnAtEnd(bool despawn)
void SetEscortPaused(bool on)
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)