Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_dathrohan_balnazzar.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Dathrohan_Balnazzar
8SD%Complete: 95
9SDComment: Possibly need to fix/improve summons after death
10SDCategory: Stratholme
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
17{
18 //Dathrohan spells
19 SPELL_CRUSADERSHAMMER = 17286, //AOE stun
21 SPELL_HOLYSTRIKE = 17284, //weapon dmg +3
22
23 //Transform
24 SPELL_BALNAZZARTRANSFORM = 17288, //restore full HP/mana, trigger spell Balnazzar Transform Stun
25
26 //Balnazzar spells
30 SPELL_SLEEP = 12098,
32};
33
35{
38 NPC_ZOMBIE = 10698 //probably incorrect
39};
40
42{
44};
45
47{
48 {3444.156f, -3090.626f, 135.002f, 2.240f}, //G1 front, left
49 {3449.123f, -3087.009f, 135.002f, 2.240f}, //G1 front, right
50 {3446.246f, -3093.466f, 135.002f, 2.240f}, //G1 back left
51 {3451.160f, -3089.904f, 135.002f, 2.240f}, //G1 back, right
52
53 {3457.995f, -3080.916f, 135.002f, 3.784f}, //G2 front, left
54 {3454.302f, -3076.330f, 135.002f, 3.784f}, //G2 front, right
55 {3460.975f, -3078.901f, 135.002f, 3.784f}, //G2 back left
56 {3457.338f, -3073.979f, 135.002f, 3.784f} //G2 back, right
57};
58
60{
61public:
62 boss_dathrohan_balnazzar() : CreatureScript("boss_dathrohan_balnazzar") { }
63
65 {
66 return new boss_dathrohan_balnazzarAI(creature);
67 }
68
70 {
72
82
84 {
91 m_uiDeepSleep_Timer = 20000;
93 m_bTransformed = false;
94
95 if (me->GetEntry() == NPC_BALNAZZAR)
96 me->UpdateEntry(NPC_DATHROHAN);
97 }
98
99 void JustDied(Unit* /*killer*/) OVERRIDE
100 {
101 static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef);
102
103 for (uint8 i=0; i<uiCount; ++i)
104 me->SummonCreature(NPC_ZOMBIE,
105 m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient,
107 }
108
109 void EnterCombat(Unit* /*who*/) OVERRIDE
110 {
111 }
112
114 {
115 if (!UpdateVictim())
116 return;
117
118 //START NOT TRANSFORMED
119 if (!m_bTransformed)
120 {
121 //MindBlast
122 if (m_uiMindBlast_Timer <= uiDiff)
123 {
125 m_uiMindBlast_Timer = std::rand() % 20000 + 15000;
126 } else m_uiMindBlast_Timer -= uiDiff;
127
128 //CrusadersHammer
129 if (m_uiCrusadersHammer_Timer <= uiDiff)
130 {
133 } else m_uiCrusadersHammer_Timer -= uiDiff;
134
135 //CrusaderStrike
136 if (m_uiCrusaderStrike_Timer <= uiDiff)
137 {
140 } else m_uiCrusaderStrike_Timer -= uiDiff;
141
142 //HolyStrike
143 if (m_uiHolyStrike_Timer <= uiDiff)
144 {
146 m_uiHolyStrike_Timer = 15000;
147 } else m_uiHolyStrike_Timer -= uiDiff;
148
149 //BalnazzarTransform
150 if (HealthBelowPct(40))
151 {
152 if (me->IsNonMeleeSpellCasted(false))
153 me->InterruptNonMeleeSpells(false);
154
155 //restore hp, mana and stun
157 me->UpdateEntry(NPC_BALNAZZAR);
158 m_bTransformed = true;
159 }
160 }
161 else
162 {
163 //MindBlast
164 if (m_uiMindBlast_Timer <= uiDiff)
165 {
167 m_uiMindBlast_Timer = std::rand() % 20000 + 15000;
168 } else m_uiMindBlast_Timer -= uiDiff;
169
170 //ShadowShock
171 if (m_uiShadowShock_Timer <= uiDiff)
172 {
174 m_uiShadowShock_Timer = 11000;
175 } else m_uiShadowShock_Timer -= uiDiff;
176
177 //PsychicScream
178 if (m_uiPsychicScream_Timer <= uiDiff)
179 {
180 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
182
184 } else m_uiPsychicScream_Timer -= uiDiff;
185
186 //DeepSleep
187 if (m_uiDeepSleep_Timer <= uiDiff)
188 {
189 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
190 DoCast(target, SPELL_SLEEP);
191
192 m_uiDeepSleep_Timer = 15000;
193 } else m_uiDeepSleep_Timer -= uiDiff;
194
195 //MindControl
196 if (m_uiMindControl_Timer <= uiDiff)
197 {
199 m_uiMindControl_Timer = 15000;
200 } else m_uiMindControl_Timer -= uiDiff;
201 }
202
204 }
205 };
206};
207
@ IN_MILLISECONDS
Definition Common.h:125
@ HOUR
Definition Common.h:120
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
Creatures
@ SPELL_BALNAZZARTRANSFORM
void AddSC_boss_dathrohan_balnazzar()
SummonDef m_aSummonPoint[]
@ SPELL_MINDCONTROL
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================