TrinityCore
Loading...
Searching...
No Matches
boss_vexallus.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "magisters_terrace.h"
20#include "MotionMaster.h"
21#include "ScriptedCreature.h"
22
24{
30
31 //is this text for real?
32 //#define SAY_DEATH "What...happen...ed."
33};
34
36{
40
41 SPELL_SUMMON_PURE_ENERGY = 44322, // mod scale -10
42 H_SPELL_SUMMON_PURE_ENERGY1 = 46154, // mod scale -5
43 H_SPELL_SUMMON_PURE_ENERGY2 = 46159 // mod scale -5
44};
45
54
60
62{
63 public:
64 boss_vexallus() : CreatureScript("boss_vexallus") { }
65
66 struct boss_vexallusAI : public BossAI
67 {
69 {
71 _enraged = false;
72 }
73
74 void Reset() override
75 {
76 _Reset();
78 _enraged = false;
79 }
80
81 void KilledUnit(Unit* /*victim*/) override
82 {
84 }
85
94
95 void JustSummoned(Creature* summoned) override
96 {
98 summoned->GetMotionMaster()->MoveFollow(temp, 0, 0);
99
100 summons.Summon(summoned);
101 }
102
103 void DamageTaken(Unit* /*who*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
104 {
105 if (_enraged)
106 return;
107
108 // 85%, 70%, 55%, 40%, 25%
110 {
111 // increase amount, unless we're at 10%, then we switch and return
113 {
114 _enraged = true;
115 events.Reset();
117 return;
118 }
119 else
121
124
125 if (IsHeroic())
126 {
129 }
130 else
132 }
133 }
134
135 void UpdateAI(uint32 diff) override
136 {
137 if (!UpdateVictim())
138 return;
139
140 events.Update(diff);
141
143 return;
144
145 while (uint32 eventId = events.ExecuteEvent())
146 {
147 switch (eventId)
148 {
150 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
153 break;
155 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true))
156 DoCast(target, SPELL_ARCANE_SHOCK);
158 break;
159 case EVENT_OVERLOAD:
162 break;
163 default:
164 break;
165 }
166
168 return;
169 }
170 }
171
172 private:
175 };
176
177 CreatureAI* GetAI(Creature* creature) const override
178 {
179 return GetMagistersTerraceAI<boss_vexallusAI>(creature);
180 }
181};
182
189
191{
192 public:
193 npc_pure_energy() : CreatureScript("npc_pure_energy") { }
194
196 {
197 npc_pure_energyAI(Creature* creature) : ScriptedAI(creature)
198 {
200 }
201
202 void JustDied(Unit* killer) override
203 {
204 if (killer)
205 killer->CastSpell(killer, SPELL_ENERGY_FEEDBACK, true);
207 }
208 };
209
210 CreatureAI* GetAI(Creature* creature) const override
211 {
212 return GetMagistersTerraceAI<npc_pure_energyAI>(creature);
213 }
214};
215
217{
218 new boss_vexallus();
219 new npc_pure_energy();
220}
uint32_t uint32
Definition Define.h:154
Spells
Definition PlayerAI.cpp:32
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
Yells
NpcPureEnergy
@ SPELL_ENERGY_BOLT
@ SPELL_ENERGY_FEEDBACK
@ SPELL_PURE_ENERGY_PASSIVE
void AddSC_boss_vexallus()
@ INTERVAL_MODIFIER
@ INTERVAL_SWITCH
@ SAY_AGGRO
@ SAY_ENERGY
@ SAY_KILL
@ EMOTE_DISCHARGE_ENERGY
@ SAY_OVERLOAD
@ SPELL_ARCANE_SHOCK
@ H_SPELL_SUMMON_PURE_ENERGY2
@ H_SPELL_SUMMON_PURE_ENERGY1
@ SPELL_OVERLOAD
@ SPELL_CHAIN_LIGHTNING
@ SPELL_SUMMON_PURE_ENERGY
@ EVENT_CHAIN_LIGHTNING
@ EVENT_ENERGY_BOLT
@ EVENT_ARCANE_SHOCK
@ EVENT_ENERGY_FEEDBACK
@ EVENT_OVERLOAD
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetDisplayFromModel(uint32 modelIdx)
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
void MoveFollow(Unit *target, float dist, Optional< ChaseAngle > angle={}, Optional< Milliseconds > duration={}, bool ignoreTargetWalk=false, MovementSlot slot=MOTION_SLOT_ACTIVE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void Summon(Creature const *summon)
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
@ DATA_VEXALLUS
bool IsHeroic() const
bool HealthAbovePct(uint32 pct) const
void JustSummoned(Creature *summoned) override
boss_vexallusAI(Creature *creature)
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *) override
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
void JustDied(Unit *killer) override