TrinityCore
boss_dathrohan_balnazzar.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_Dathrohan_Balnazzar
20SD%Complete: 95
21SDComment: Possibly need to fix/improve summons after death
22SDCategory: Stratholme
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "stratholme.h"
28
30{
31 //Dathrohan spells
32 SPELL_CRUSADERSHAMMER = 17286, //AOE stun
34 SPELL_HOLYSTRIKE = 17284, //weapon dmg +3
35
36 //Transform
37 SPELL_BALNAZZARTRANSFORM = 17288, //restore full HP/mana, trigger spell Balnazzar Transform Stun
38
39 //Balnazzar spells
43 SPELL_SLEEP = 12098,
44 SPELL_MINDCONTROL = 15690
45};
46
48{
51 NPC_ZOMBIE = 10698 //probably incorrect
52};
53
55{
57};
58
60{
61 {3444.156f, -3090.626f, 135.002f, 2.240f}, //G1 front, left
62 {3449.123f, -3087.009f, 135.002f, 2.240f}, //G1 front, right
63 {3446.246f, -3093.466f, 135.002f, 2.240f}, //G1 back left
64 {3451.160f, -3089.904f, 135.002f, 2.240f}, //G1 back, right
65
66 {3457.995f, -3080.916f, 135.002f, 3.784f}, //G2 front, left
67 {3454.302f, -3076.330f, 135.002f, 3.784f}, //G2 front, right
68 {3460.975f, -3078.901f, 135.002f, 3.784f}, //G2 back left
69 {3457.338f, -3073.979f, 135.002f, 3.784f} //G2 back, right
70};
71
73{
74public:
75 boss_dathrohan_balnazzar() : CreatureScript("boss_dathrohan_balnazzar") { }
76
77 CreatureAI* GetAI(Creature* creature) const override
78 {
79 return GetStratholmeAI<boss_dathrohan_balnazzarAI>(creature);
80 }
81
83 {
85 {
86 Initialize();
87 }
88
90 {
97 m_uiDeepSleep_Timer = 20000;
99 m_bTransformed = false;
100 }
101
111
112 void Reset() override
113 {
115
116 Initialize();
117
118 if (me->GetEntry() == NPC_BALNAZZAR)
120 }
121
122 void JustDied(Unit* killer) override
123 {
124 BossAI::JustDied(killer);
125
126 for (SummonDef const& summon : m_aSummonPoint)
127 me->SummonCreature(NPC_ZOMBIE, summon.m_fX, summon.m_fY, summon.m_fZ, summon.m_fOrient, TEMPSUMMON_TIMED_DESPAWN, 1h);
128 }
129
130 void UpdateAI(uint32 uiDiff) override
131 {
132 if (!UpdateVictim())
133 return;
134
135 //START NOT TRANSFORMED
136 if (!m_bTransformed)
137 {
138 //MindBlast
139 if (m_uiMindBlast_Timer <= uiDiff)
140 {
142 m_uiMindBlast_Timer = urand(15000, 20000);
143 } else m_uiMindBlast_Timer -= uiDiff;
144
145 //CrusadersHammer
146 if (m_uiCrusadersHammer_Timer <= uiDiff)
147 {
150 } else m_uiCrusadersHammer_Timer -= uiDiff;
151
152 //CrusaderStrike
153 if (m_uiCrusaderStrike_Timer <= uiDiff)
154 {
157 } else m_uiCrusaderStrike_Timer -= uiDiff;
158
159 //HolyStrike
160 if (m_uiHolyStrike_Timer <= uiDiff)
161 {
163 m_uiHolyStrike_Timer = 15000;
164 } else m_uiHolyStrike_Timer -= uiDiff;
165
166 //BalnazzarTransform
167 if (HealthBelowPct(40))
168 {
169 if (me->IsNonMeleeSpellCast(false))
171
172 //restore hp, mana and stun
175 m_bTransformed = true;
176 }
177 }
178 else
179 {
180 //MindBlast
181 if (m_uiMindBlast_Timer <= uiDiff)
182 {
184 m_uiMindBlast_Timer = urand(15000, 20000);
185 } else m_uiMindBlast_Timer -= uiDiff;
186
187 //ShadowShock
188 if (m_uiShadowShock_Timer <= uiDiff)
189 {
191 m_uiShadowShock_Timer = 11000;
192 } else m_uiShadowShock_Timer -= uiDiff;
193
194 //PsychicScream
195 if (m_uiPsychicScream_Timer <= uiDiff)
196 {
199
201 } else m_uiPsychicScream_Timer -= uiDiff;
202
203 //DeepSleep
204 if (m_uiDeepSleep_Timer <= uiDiff)
205 {
207 DoCast(target, SPELL_SLEEP);
208
209 m_uiDeepSleep_Timer = 15000;
210 } else m_uiDeepSleep_Timer -= uiDiff;
211
212 //MindControl
213 if (m_uiMindControl_Timer <= uiDiff)
214 {
216 m_uiMindControl_Timer = 15000;
217 } else m_uiMindControl_Timer -= uiDiff;
218 }
219 }
220 };
221
222};
223
225{
227}
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
@ SPELL_CRUSADERSTRIKE
@ SPELL_BALNAZZARTRANSFORM
@ SPELL_CRUSADERSHAMMER
void AddSC_boss_dathrohan_balnazzar()
SummonDef m_aSummonPoint[]
void JustDied(Unit *) override
void Reset() override
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
bool UpdateEntry(uint32 entry, CreatureData const *data=nullptr, bool updateLevel=true)
Definition: Creature.cpp:577
uint32 GetEntry() const
Definition: Object.h:161
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:3059
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_BALNAZZAR
Definition: stratholme.h:33
bool HealthBelowPct(uint32 pct) const