TrinityCore
boss_galvangar.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 "ScriptedCreature.h"
20
22{
23 SPELL_CLEAVE = 15284,
28};
29
31{
34 SAY_BUFF = 2
35};
36
38{
44};
45
47{
48 ACTION_BUFF_YELL = -30001 // shared from Battleground
49};
50
52{
53 boss_galvangar(Creature* creature) : ScriptedAI(creature) { }
54
55 void Reset() override
56 {
57 events.Reset();
58 }
59
60 void JustEngagedWith(Unit* /*who*/) override
61 {
68 }
69
70 void DoAction(int32 actionId) override
71 {
72 if (actionId == ACTION_BUFF_YELL)
74 }
75
76 bool CheckInRoom() override
77 {
78 if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
79 {
82 return false;
83 }
84
85 return true;
86 }
87
88 void UpdateAI(uint32 diff) override
89 {
90 if (!UpdateVictim() || !CheckInRoom())
91 return;
92
93 events.Update(diff);
94
96 return;
97
98 while (uint32 eventId = events.ExecuteEvent())
99 {
100 switch (eventId)
101 {
102 case EVENT_CLEAVE:
105 break;
109 break;
110 case EVENT_WHIRLWIND1:
113 break;
114 case EVENT_WHIRLWIND2:
117 break;
121 break;
122 default:
123 break;
124 }
125
127 return;
128 }
129 }
130
131private:
133};
134
136{
138}
Texts
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
#define RegisterCreatureAI(ai_name)
Definition: ScriptMgr.h:1380
@ UNIT_STATE_CASTING
Definition: Unit.h:270
Action
void AddSC_boss_galvangar()
@ SPELL_CLEAVE
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_WHIRLWIND2
@ SPELL_WHIRLWIND1
@ ACTION_BUFF_YELL
@ SAY_AGGRO
@ SAY_EVADE
@ SAY_BUFF
@ EVENT_FRIGHTENING_SHOUT
@ EVENT_WHIRLWIND2
@ EVENT_WHIRLWIND1
@ EVENT_CLEAVE
@ EVENT_MORTAL_STRIKE
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
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
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:373
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
void Reset()
Definition: EventMap.cpp:21
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1096
void DoAction(int32 actionId) override
boss_galvangar(Creature *creature)
void JustEngagedWith(Unit *) override
void Reset() override
void UpdateAI(uint32 diff) override
bool CheckInRoom() override