TrinityCore
boss_magistrate_barthilas.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/* ScriptData
19SDName: Boss_Magistrate_Barthilas
20SD%Complete: 70
21SDComment:
22SDCategory: Stratholme
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "stratholme.h"
28
30{
35};
36
38{
39 MODEL_NORMAL = 10433,
40 MODEL_HUMAN = 3637
41};
42
44{
45public:
46 boss_magistrate_barthilas() : CreatureScript("boss_magistrate_barthilas") { }
47
48 CreatureAI* GetAI(Creature* creature) const override
49 {
50 return GetStratholmeAI<boss_magistrate_barthilasAI>(creature);
51 }
52
54 {
56 {
57 Initialize();
58 }
59
61 {
62 DrainingBlow_Timer = 20000;
63 CrowdPummel_Timer = 15000;
64 MightyBlow_Timer = 10000;
65 FuriousAnger_Timer = 5000;
66 AngerCount = 0;
67 }
68
74
75 void Reset() override
76 {
78
79 Initialize();
80
81 if (me->IsAlive())
83 else
85 }
86
87 void JustDied(Unit* killer) override
88 {
89 BossAI::JustDied(killer);
90
92 }
93
94 void UpdateAI(uint32 diff) override
95 {
96 //Return since we have no target
97 if (!UpdateVictim())
98 return;
99
100 if (FuriousAnger_Timer <= diff)
101 {
102 FuriousAnger_Timer = 4000;
103 if (AngerCount > 25)
104 return;
105
106 ++AngerCount;
108 } else FuriousAnger_Timer -= diff;
109
110 //DrainingBlow
111 if (DrainingBlow_Timer <= diff)
112 {
114 DrainingBlow_Timer = 15000;
115 } else DrainingBlow_Timer -= diff;
116
117 //CrowdPummel
118 if (CrowdPummel_Timer <= diff)
119 {
121 CrowdPummel_Timer = 15000;
122 } else CrowdPummel_Timer -= diff;
123
124 //MightyBlow
125 if (MightyBlow_Timer <= diff)
126 {
128 MightyBlow_Timer = 20000;
129 } else MightyBlow_Timer -= diff;
130 }
131 };
132
133};
134
136{
138}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
void AddSC_boss_magistrate_barthilas()
void JustDied(Unit *) override
void Reset() override
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetDisplayId(uint32 displayId, bool setNative=false) override
Definition: Creature.cpp:3402
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool IsAlive() const
Definition: Unit.h:1164
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_MAGISTRATE_BARTHILAS
Definition: stratholme.h:38