TrinityCore
boss_vectus.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 "scholomance.h"
19#include "ScriptMgr.h"
20#include "ScriptedCreature.h"
21
23{
24 EMOTE_FRENZY = 0
25};
26
28{
32 SPELL_FRENZY = 8269 // 28371
33};
34
36{
40};
41
43{
46 TALK_IDLE3 = 3
47};
48
50{
51 PATH_VECTUS_IDLE = 3904400
52};
53
55{
56public:
57 boss_vectus() : CreatureScript("boss_vectus") { }
58
59 struct boss_vectusAI : public BossAI
60 {
61 boss_vectusAI(Creature* creature) : BossAI(creature, DATA_VECTUS) { }
62
63 void JustEngagedWith(Unit* who) override
64 {
68 }
69
70 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
71 {
72 if (me->HealthBelowPctDamaged(25, damage))
73 {
77 }
78 }
79
80 void UpdateAI(uint32 diff) override
81 {
82 if (!UpdateVictim())
83 return;
84
85 events.Update(diff);
86
88 return;
89
90 while (uint32 eventId = events.ExecuteEvent())
91 {
92 switch (eventId)
93 {
97 break;
101 break;
102 case EVENT_FRENZY:
106 break;
107 default:
108 break;
109 }
110
112 return;
113 }
114 }
115
116 void WaypointReached(uint32 waypointId, uint32 pathId) override
117 {
118 if (pathId != PATH_VECTUS_IDLE)
119 return;
120
121 if (waypointId == 2)
123 else if (waypointId == 3)
125 else if (waypointId == 4)
127 }
128 };
129
130 CreatureAI* GetAI(Creature* creature) const override
131 {
132 return GetScholomanceAI<boss_vectusAI>(creature);
133 }
134};
135
137{
138 new boss_vectus();
139}
uint32_t uint32
Definition: Define.h:142
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_STATE_CASTING
Definition: Unit.h:270
VectusEmotes
Definition: boss_vectus.cpp:23
@ EMOTE_FRENZY
Definition: boss_vectus.cpp:24
VectusSpells
Definition: boss_vectus.cpp:28
@ SPELL_FLAMESTRIKE
Definition: boss_vectus.cpp:29
@ SPELL_FIRE_SHIELD
Definition: boss_vectus.cpp:31
@ SPELL_BLAST_WAVE
Definition: boss_vectus.cpp:30
@ SPELL_FRENZY
Definition: boss_vectus.cpp:32
VectusEvents
Definition: boss_vectus.cpp:36
@ EVENT_BLAST_WAVE
Definition: boss_vectus.cpp:38
@ EVENT_FRENZY
Definition: boss_vectus.cpp:39
@ EVENT_FIRE_SHIELD
Definition: boss_vectus.cpp:37
void AddSC_boss_vectus()
VectusTalks
Definition: boss_vectus.cpp:43
@ TALK_IDLE2
Definition: boss_vectus.cpp:45
@ TALK_IDLE3
Definition: boss_vectus.cpp:46
@ TALK_IDLE
Definition: boss_vectus.cpp:44
VectusPaths
Definition: boss_vectus.cpp:50
@ PATH_VECTUS_IDLE
Definition: boss_vectus.cpp:51
void _JustEngagedWith(Unit *who)
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
CreatureAI * GetAI(Creature *creature) const override
@ DATA_VECTUS
Definition: scholomance.h:39
void WaypointReached(uint32 waypointId, uint32 pathId) override
void UpdateAI(uint32 diff) override
Definition: boss_vectus.cpp:80
boss_vectusAI(Creature *creature)
Definition: boss_vectus.cpp:61
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition: boss_vectus.cpp:70
void JustEngagedWith(Unit *who) override
Definition: boss_vectus.cpp:63