74 {
76 switch (
events.ExecuteEvent())
77 {
78 case 0:
79 break;
80 case 1:
81 {
83 {
86 }
87
92 {
94 {
99 }
100
103 }
104 else
105 {
106 events.RescheduleEvent(2, 2500ms);
107 }
108 }
109 break;
110 case 2:
113 {
114 c->setActive(true);
116 }
117
118 events.RescheduleEvent(3, 7s);
119 break;
120 case 3:
124
125 events.RescheduleEvent(4, 14s);
126 break;
127 case 4:
129 {
132 if (n1 && n2)
133 {
135 {
139 }
141 {
145 }
147
148
151
152
155 {
156 if (c->GetPositionX() < 440.0f)
157 continue;
158 if (c->GetPositionY() > 215.0f)
159 c->GetMotionMaster()->MoveChase(n2, 0.0f,
rand_norm() * 2 * M_PI);
160 else
161 c->GetMotionMaster()->MoveChase(n1, 0.0f,
rand_norm() * 2 * M_PI);
162 }
163 }
164 }
165
166 events.RescheduleEvent(5, 1ms);
167 break;
168 case 5:
170
171 events.RescheduleEvent(6, 1s);
172 break;
173 case 6:
177
178 events.RescheduleEvent(7, 5s);
179 break;
180 case 7:
182 {
187
190 {
191 if (c->GetPositionX() < 450.0f)
192 continue;
194 c->GetMotionMaster()->Clear(false);
195 c->GetMotionMaster()->MoveIdle();
196 c->StopMoving();
197 c->CastSpell(c, 69413, true);
198 c->SetCanFly(true);
199 c->SetDisableGravity(true);
200 c->SendMovementFlagUpdate();
203 c->GetMotionMaster()->MoveTakeoff(0, c->GetPositionX() + dist * cos(angle), c->GetPositionY() + dist * std::sin(angle), c->GetPositionZ() + 6.0f + (
float)
urand(0, 4), 1.5f +
frand(0.0f, 1.5f));
204 }
205 }
206
207 events.RescheduleEvent(8, 7s);
208 break;
209 case 8:
212 c->CastSpell(c, 69753, false);
213
214 events.RescheduleEvent(9, 400ms);
215 break;
216 case 9:
220 {
221 if (c->GetPositionX() < 450.0f)
222 continue;
224 c->RemoveAllAuras();
225 c->GetMotionMaster()->MoveFall(0, true);
226 }
227
228 events.RescheduleEvent(10, 1s);
229 break;
230 case 10:
232
233 events.RescheduleEvent(11, 1s);
234 break;
235 case 11:
239 {
240 if (c->GetPositionX() < 450.0f)
241 continue;
242 c->SetCanFly(false);
243 c->SetDisableGravity(false);
244 c->SendMovementFlagUpdate();
245 c->CastSpell(c, 69350, true);
246 }
247
248 events.RescheduleEvent(12, 2s);
249 break;
250 case 12:
252 {
255
258 {
259 if (c->GetPositionX() < 450.0f)
260 continue;
261 c->SetHomePosition(c->GetPositionX(), c->GetPositionY(), c->GetPositionZ(), c->GetOrientation());
262 c->Respawn(true);
263 c->UpdateEntry(36796, 0, false);
264 c->SetFacingTo(M_PI);
266 }
267 }
268
269 events.RescheduleEvent(13, 3s);
270 break;
271 case 13:
273 {
276 {
277 if (c->GetPositionX() < 450.0f)
278 continue;
283 c->SetInCombatWithZone();
284 c->GetMotionMaster()->MoveChase(
me, dist, angle);
286 }
287 }
288
289 events.RescheduleEvent(14, 2s);
290 break;
291 case 14:
293 {
295 {
298 }
299 else
300 {
302 for (
uint8 i = 0; i < 2; ++i)
304 c->CastSpell(c, 70513, false);
305 }
306 }
307
308 events.RescheduleEvent(15, 2s);
309 break;
310 case 15:
312 {
315
317 {
318 for (
uint8 i = 0; i < 2; ++i)
320 c->CastSpell(c, 70464, false);
321 }
322 }
323
324 events.RescheduleEvent(16, 3s);
325 break;
326 case 16:
329 {
330 for (
uint8 i = 0; i < 2; ++i)
333
336 {
337 if (c->IsAlive())
338 {
340 continue;
341
343 }
344 c->DespawnOrUnsummon(10000);
345 }
347 }
348
349 events.RescheduleEvent(17, 5s);
350 break;
351 case 17:
354
355 break;
356 }
357
359 return;
360
362 }
float frand(float min, float max)
Definition: Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
double rand_norm()
Definition: Random.cpp:77
std::uint8_t uint8
Definition: Define.h:109
@ REACT_PASSIVE
Definition: Unit.h:548
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition: UnitDefines.h:177
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ NPC_JAINA_PART1
Definition: forge_of_souls.h:42
@ NPC_KALIRA
Definition: forge_of_souls.h:44
@ NPC_KORELN
Definition: forge_of_souls.h:47
@ NPC_LORALEN
Definition: forge_of_souls.h:46
@ NPC_ELANDRA
Definition: forge_of_souls.h:45
@ SAY_JAINA_INTRO_4
Definition: forge_of_souls.cpp:31
@ SAY_SYLVANAS_INTRO_3
Definition: forge_of_souls.cpp:39
@ SAY_JAINA_INTRO_5
Definition: forge_of_souls.cpp:32
@ SAY_SYLVANAS_INTRO_4
Definition: forge_of_souls.cpp:40
@ SAY_JAINA_INTRO_2
Definition: forge_of_souls.cpp:29
@ SAY_JAINA_INTRO_1
Definition: forge_of_souls.cpp:28
@ SAY_SYLVANAS_INTRO_2
Definition: forge_of_souls.cpp:38
@ SAY_JAINA_INTRO_3
Definition: forge_of_souls.cpp:30
@ SAY_SYLVANAS_INTRO_1
Definition: forge_of_souls.cpp:37
const Position LeaderIntroPos
Definition: pit_of_saron.h:167
const Position NecrolytePos2
Definition: pit_of_saron.h:169
@ SAY_TYRANNUS_INTRO_3
Definition: pit_of_saron.h:155
@ SAY_TYRANNUS_INTRO_2
Definition: pit_of_saron.h:154
@ SAY_TYRANNUS_INTRO_1
Definition: pit_of_saron.h:151
@ SAY_TYRANNUS_INTRO_4
Definition: pit_of_saron.h:158
const Position NecrolytePos1
Definition: pit_of_saron.h:168
const Position SBSTyrannusStartPos
Definition: pit_of_saron.h:240
const ChampionPosition introPositions[]
Definition: pit_of_saron.h:177
@ SPELL_NECROLYTE_CHANNELING
Definition: pit_of_saron.h:132
@ INSTANCE_PROGRESS_FINISHED_INTRO
Definition: pit_of_saron.h:57
const Position PortalPos
Definition: pit_of_saron.h:166
@ DATA_GUARD_1_GUID
Definition: pit_of_saron.h:40
@ DATA_NECROLYTE_1_GUID
Definition: pit_of_saron.h:38
@ DATA_TYRANNUS_EVENT_GUID
Definition: pit_of_saron.h:37
@ DATA_NECROLYTE_2_GUID
Definition: pit_of_saron.h:39
@ DATA_TEAMID_IN_INSTANCE
Definition: trial_of_the_champion.h:44
Talk
Definition: hyjal.cpp:82
@ EMOTE_STATE_READY1H
Definition: SharedDefines.h:1966
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
virtual void DoAction(int32)
Definition: UnitAI.h:212
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:269
iterator begin()
Definition: ScriptedCreature.h:48
iterator end()
Definition: ScriptedCreature.h:58
StorageType::iterator iterator
Definition: ScriptedCreature.h:36
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:143
uint32 GetEntry() const
Definition: Object.h:112
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4758
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17658
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
bool IsAlive() const
Definition: Unit.h:1204
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:1611
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
bool IsInCombat() const
Definition: Unit.h:820
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
uint32 entry[2]
Definition: pit_of_saron.h:173