TrinityCore
Loading...
Searching...
No Matches
boss_glutton.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 "razorfen_downs.h"
21
29
37
43
50
51// 8567 - Glutton
52struct boss_glutton : public BossAI
53{
55
56 void Reset() override
57 {
58 _Reset();
62 }
63
64 void JustEngagedWith(Unit* who) override
65 {
68 }
69
70 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
71 {
72 if (_phase < PHASE_HEALTH_50 && me->HealthBelowPctDamaged(50, damage))
73 {
74 _phase++;
76 }
77
78 if (_phase < PHASE_HEALTH_15 && me->HealthBelowPctDamaged(15, damage))
79 {
80 _phase++;
82 }
83 }
84
85 void KilledUnit(Unit* /*victim*/) override
86 {
88 }
89
90 void UpdateAI(uint32 diff) override
91 {
92 if (!UpdateVictim())
93 return;
94
95 events.Update(diff);
96
98 return;
99
100 while (uint32 eventId = events.ExecuteEvent())
101 {
102 switch (eventId)
103 {
104 case EVENT_HEALTH_50:
108 break;
109 case EVENT_HEALTH_15:
112 break;
113 default:
114 break;
115 }
116
118 return;
119 }
120
122 }
123
124private:
126};
127
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
void AddSC_boss_glutton()
GluttonPhases
@ PHASE_NONE
@ PHASE_HEALTH_50
@ PHASE_HEALTH_15
GluttonSpells
@ SPELL_THRASH_15
@ SPELL_THRASH_35
@ SPELL_DISEASE_CLOUD
@ SPELL_FRENZY
GluttonTexts
@ SAY_HEALTH_50
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_HEALTH_15
GluttonEvents
@ EVENT_HEALTH_15
@ EVENT_HEALTH_50
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
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:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
Definition Unit.h:769
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
#define RegisterRazorfenDownsCreatureAI(ai_name)
@ DATA_GLUTTON
void KilledUnit(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void Reset() override
boss_glutton(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override