Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_vexallus.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/* ScriptData
7SDName: Boss_Vexallus
8SD%Complete: 90
9SDComment: Heroic and Normal support. Needs further testing.
10SDCategory: Magister's Terrace
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "magisters_terrace.h"
16
18{
24
25 //is this text for real?
26 //#define SAY_DEATH "What...happen...ed."
27};
28
30{
31 // Pure energy spell info
34
35 // Vexallus spell info
37 SPELL_H_CHAIN_LIGHTNING = 46380, // heroic spell
40 SPELL_H_ARCANE_SHOCK = 46381, // heroic spell
41
42 SPELL_SUMMON_PURE_ENERGY = 44322, // mod scale -10
43 H_SPELL_SUMMON_PURE_ENERGY1 = 46154, // mod scale -5
44 H_SPELL_SUMMON_PURE_ENERGY2 = 46159 // mod scale -5
45};
46
48{
50};
51
57
59{
60public:
61 boss_vexallus() : CreatureScript("boss_vexallus") { }
62
64 {
65 return new boss_vexallusAI(creature);
66 };
67
68 struct boss_vexallusAI : public BossAI
69 {
71 {
72 instance = creature->GetInstanceScript();
73 }
74
76
81 bool Enraged;
82
84 {
85 summons.DespawnAll();
87 ArcaneShockTimer = 5000;
88 OverloadTimer = 1200;
90 Enraged = false;
91
92 if (instance)
94 }
95
96 void KilledUnit(Unit* /*victim*/) OVERRIDE
97 {
99 }
100
101 void JustDied(Unit* /*killer*/) OVERRIDE
102 {
103 summons.DespawnAll();
104 if (instance)
106 }
107
108 void EnterCombat(Unit* /*who*/) OVERRIDE
109 {
111
112 if (instance)
114 }
115
117 {
118 if (Unit* temp = SelectTarget(SELECT_TARGET_RANDOM, 0))
119 summoned->GetMotionMaster()->MoveFollow(temp, 0, 0);
120
121 //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
122 summoned->CastSpell(summoned, SPELL_ENERGY_BOLT, false, 0, 0, me->GetGUID());
123 }
124
126 {
127 if (!UpdateVictim())
128 return;
129
130 if (!Enraged)
131 {
132 //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
134 {
135 //increase amount, unless we're at 10%, then we switch and return
137 {
138 Enraged = true;
139 return;
140 }
141 else
143
146
147 if (IsHeroic())
148 {
151 }
152 else
154
155 //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core
156 me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType::TEMPSUMMON_CORPSE_DESPAWN, 0);
157
158 if (IsHeroic())
159 me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType::TEMPSUMMON_CORPSE_DESPAWN, 0);
160 }
161
162 if (ChainLightningTimer <= diff)
163 {
164 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
166
167 ChainLightningTimer = 8000;
168 } else ChainLightningTimer -= diff;
169
170 if (ArcaneShockTimer <= diff)
171 {
172 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
173 if (target)
174 DoCast(target, SPELL_ARCANE_SHOCK);
175
176 ArcaneShockTimer = 8000;
177 } else ArcaneShockTimer -= diff;
178 }
179 else
180 {
181 if (OverloadTimer <= diff)
182 {
184
185 OverloadTimer = 2000;
186 } else OverloadTimer -= diff;
187 }
188
190 }
191 };
192};
193
195{
196public:
197 npc_pure_energy() : CreatureScript("npc_pure_energy") { }
198
200 {
201 return new npc_pure_energyAI(creature);
202 };
203
205 {
206 npc_pure_energyAI(Creature* creature) : ScriptedAI(creature)
207 {
208 me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
209 }
210
211 void Reset() OVERRIDE { }
212
213 void JustDied(Unit* slayer) OVERRIDE
214 {
215 if (Unit* temp = me->GetOwner())
216 {
217 if (temp && temp->IsAlive())
218 slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
219 }
220 }
221
222 void EnterCombat(Unit* /*who*/) OVERRIDE { }
223 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
224
225 void AttackStart(Unit* /*who*/) OVERRIDE { }
226 };
227};
228
230{
231 new boss_vexallus();
232 new npc_pure_energy();
233}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:72
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
Creatures
#define SAY_AGGRO
#define SAY_KILL
@ NPC_PURE_ENERGY
void AddSC_boss_vexallus()
@ INTERVAL_MODIFIER
@ INTERVAL_SWITCH
@ SAY_AGGRO
@ SAY_ENERGY
@ SAY_KILL
@ EMOTE_DISCHARGE_ENERGY
@ SAY_OVERLOAD
@ SPELL_H_ARCANE_SHOCK
@ SPELL_ARCANE_SHOCK
@ H_SPELL_SUMMON_PURE_ENERGY2
@ H_SPELL_SUMMON_PURE_ENERGY1
@ SPELL_ENERGY_BOLT
@ SPELL_OVERLOAD
@ SPELL_CHAIN_LIGHTNING
@ SPELL_ENERGY_FEEDBACK
@ SPELL_SUMMON_PURE_ENERGY
@ SPELL_H_CHAIN_LIGHTNING
@ SPELL_CHAIN_LIGHTNING
SummonList summons
BossAI(Creature *creature, uint32 bossId)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(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
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_VEXALLUS_EVENT
bool IsHeroic() const
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void KilledUnit(Unit *) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
boss_vexallusAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustDied(Unit *) OVERRIDE
void MoveInLineOfSight(Unit *) OVERRIDE
void JustDied(Unit *slayer) OVERRIDE