TrinityCore
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 "razorfen_downs.h"
20#include "ScriptedCreature.h"
21
22enum Say
23{
27 SAY_HP15 = 3
28};
29
31{
33 SPELL_FRENZY = 12795
34};
35
37{
38public:
39 boss_glutton() : CreatureScript("boss_glutton") { }
40
41 struct boss_gluttonAI : public BossAI
42 {
44 {
45 hp50 = false;
46 hp15 = false;
47 }
48
49 void Reset() override
50 {
51 _Reset();
52 hp50 = false;
53 hp15 = false;
54 }
55
56 void JustEngagedWith(Unit* who) override
57 {
60 }
61
62 void KilledUnit(Unit* /*victim*/) override
63 {
65 }
66
67 void JustDied(Unit* /*killer*/) override
68 {
69 _JustDied();
70 }
71
72 void UpdateAI(uint32 /*diff*/) override
73 {
74 if (!UpdateVictim())
75 return;
76
77 if (!hp50 && HealthBelowPct(50))
78 {
80 hp50 = true;
81 }
82
83 if (!hp15 && HealthBelowPct(15))
84 {
87 hp15 = true;
88 }
89 }
90
91 private:
92 bool hp50;
93 bool hp15;
94 };
95
96 CreatureAI* GetAI(Creature* creature) const override
97 {
98 return GetRazorfenDownsAI<boss_gluttonAI>(creature);
99 }
100};
101
103{
104 new boss_glutton();
105}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
void AddSC_boss_glutton()
@ SPELL_DISEASE_CLOUD
@ SPELL_FRENZY
@ SAY_AGGRO
@ SAY_HP50
@ SAY_SLAY
@ SAY_HP15
void JustEngagedWith(Unit *who) override
void _JustDied()
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
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
CreatureAI * GetAI(Creature *creature) const override
@ DATA_GLUTTON
bool HealthBelowPct(uint32 pct) const
void KilledUnit(Unit *) override
void JustDied(Unit *) override
boss_gluttonAI(Creature *creature)
void UpdateAI(uint32) override
void JustEngagedWith(Unit *who) override