TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_quagmirran.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#include "the_slave_pens.h"
21
23{
25 SPELL_CLEAVE = 40504,
28};
29
31{
36};
37
38// 17942 - Quagmirran
39struct boss_quagmirran : public BossAI
40{
41 boss_quagmirran(Creature* creature) : BossAI(creature, DATA_QUAGMIRRAN) { }
42
43 void JustEngagedWith(Unit* who) override
44 {
50 }
51
52 void UpdateAI(uint32 diff) override
53 {
54 if (!UpdateVictim())
55 return;
56
57 events.Update(diff);
58
60 return;
61
62 while (uint32 eventId = events.ExecuteEvent())
63 {
64 switch (eventId)
65 {
68 events.Repeat(20s, 25s);
69 break;
70 case EVENT_CLEAVE:
72 events.Repeat(18s, 34s);
73 break;
74 case EVENT_UPPERCUT:
75 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 10.0f, true))
76 DoCast(target, SPELL_UPPERCUT);
77 events.Repeat(22s);
78 break;
81 events.Repeat(24s);
82 break;
83 default:
84 break;
85 }
86
88 return;
89 }
90
92 }
93};
94
96{
98}
uint32_t uint32
Definition: Define.h:133
@ UNIT_STATE_CASTING
Definition: Unit.h:235
QuagmirranSpells
@ SPELL_CLEAVE
@ SPELL_ACID_SPRAY
@ SPELL_UPPERCUT
@ SPELL_POISON_BOLT_VOLLEY
QuagmirranEvents
@ EVENT_ACID_SPRAY
@ EVENT_POISON_BOLT_VOLLEY
@ EVENT_UPPERCUT
@ EVENT_CLEAVE
void AddSC_boss_quagmirran()
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Definition: CreatureAI.cpp:240
Creature *const me
Definition: CreatureAI.h:81
void Update(uint32 time)
Definition: EventMap.h:67
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
EventId ExecuteEvent()
Definition: EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition: EventMap.cpp:36
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:62
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:174
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:104
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:114
Definition: Unit.h:769
bool HasUnitState(const uint32 f) const
Definition: Unit.h:874
void JustEngagedWith(Unit *who) override
boss_quagmirran(Creature *creature)
void UpdateAI(uint32 diff) override
@ DATA_QUAGMIRRAN
#define RegisterSlavePensCreatureAI(ai_name)