Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
pit_of_saron.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 "SpellScript.h"
9#include "SpellAuraEffects.h"
10#include "pit_of_saron.h"
11#include "Vehicle.h"
12
14{
15 SPELL_FIREBALL = 69583, //Ymirjar Flamebearer
18 SPELL_FROST_BREATH = 69527, //Iceborn Proto-Drake
19 SPELL_LEAPING_FACE_MAUL = 69504, // Geist Ambusher
20};
21
23{
24 // Ymirjar Flamebearer
27};
28
30{
31 public:
32 npc_ymirjar_flamebearer() : CreatureScript("npc_ymirjar_flamebearer") { }
33
35 {
37 {
38 }
39
41 {
42 _events.Reset();
43 }
44
45 void EnterCombat(Unit* /*who*/) OVERRIDE
46 {
47 _events.ScheduleEvent(EVENT_FIREBALL, 4000);
48 _events.ScheduleEvent(EVENT_TACTICAL_BLINK, 15000);
49 }
50
52 {
53 if (!UpdateVictim())
54 return;
55
56 _events.Update(diff);
57
58 if (me->HasUnitState(UNIT_STATE_CASTING))
59 return;
60
61 while (uint32 eventId = _events.ExecuteEvent())
62 {
63 switch (eventId)
64 {
65 case EVENT_FIREBALL:
66 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
67 DoCast(target, SPELL_FIREBALL);
68 _events.RescheduleEvent(EVENT_FIREBALL, 5000);
69 break;
71 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
74 _events.RescheduleEvent(EVENT_TACTICAL_BLINK, 12000);
75 break;
76 default:
77 break;
78 }
79 }
80
82 }
83
84 private:
86 };
87
89 {
90 return new npc_ymirjar_flamebearerAI(creature);
91 }
92};
93
95{
96 public:
97 npc_iceborn_protodrake() : CreatureScript("npc_iceborn_protodrake") { }
98
100 {
101 npc_iceborn_protodrakeAI(Creature* creature) : ScriptedAI(creature), _vehicle(creature->GetVehicleKit())
102 {
104 }
105
107 {
109 }
110
111 void EnterCombat(Unit* /*who*/) OVERRIDE
112 {
113 _vehicle->RemoveAllPassengers();
114 }
115
117 {
118 if (!UpdateVictim())
119 return;
120
121 if (_frostBreathCooldown < diff)
122 {
124 _frostBreathCooldown = 10000;
125 }
126 else
127 _frostBreathCooldown -= diff;
128
130 }
131
132 private:
135 };
136
138 {
139 return new npc_iceborn_protodrakeAI(creature);
140 }
141};
142
144{
145 public:
146 npc_geist_ambusher() : CreatureScript("npc_geist_ambusher") { }
147
149 {
151 {
152 }
153
155 {
157 }
158
160 {
161 if (who->GetTypeId() != TypeID::TYPEID_PLAYER)
162 return;
163
164 // the max range is determined by aggro range
165 if (me->GetDistance(who) > 5.0f)
167 }
168
170 {
171 if (!UpdateVictim())
172 return;
173
174 if (_leapingFaceMaulCooldown < diff)
175 {
176 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 5.0f, true))
178 _leapingFaceMaulCooldown = std::rand() % 14000 + 9000;
179 }
180 else
182
184 }
185
186 private:
188 };
189
191 {
192 return new npc_geist_ambusherAI(creature);
193 }
194};
195
225
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
#define ASSERT
Definition Errors.h:29
@ TYPEID_PLAYER
Definition Object.h:55
@ EFFECT_2
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
#define AuraEffectPeriodicFn(F, I, N)
@ AURA_REMOVE_BY_ENEMY_SPELL
Definition Unit.h:409
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_FIREBALL
@ SPELL_FROST_BREATH
@ EVENT_FIREBALL
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
uint32 GetId() const
bool UpdateVictim()
CreatureScript(const char *name)
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AuraScript * GetAuraScript() const OVERRIDE
@ SPELL_FROST_BREATH
@ SPELL_HELLFIRE
@ SPELL_TACTICAL_BLINK
@ SPELL_FIREBALL
@ SPELL_LEAPING_FACE_MAUL
void AddSC_pit_of_saron()
@ EVENT_FIREBALL
@ EVENT_TACTICAL_BLINK
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================