Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_exarch_maladaar.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_Exarch_Maladaar
8SD%Complete: 95
9SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player.
10SDCategory: Auchindoun, Auchenai Crypts
11EndScriptData */
12
13/* ContentData
14npc_stolen_soul
15boss_exarch_maladaar
16npc_avatar_of_martyred
17EndContentData */
18
19#include "ScriptMgr.h"
20#include "ScriptedCreature.h"
21
38
40{
41public:
42 npc_stolen_soul() : CreatureScript("npc_stolen_soul") { }
43
45 {
46 return new npc_stolen_soulAI(creature);
47 }
48
50 {
51 npc_stolen_soulAI(Creature* creature) : ScriptedAI(creature) { }
52
55
57 {
58 Class_Timer = 1000;
59 }
60
61 void EnterCombat(Unit* /*who*/) OVERRIDE
62 { }
63
64 void SetMyClass(uint8 myclass)
65 {
66 myClass = myclass;
67 }
68
70 {
71 if (!UpdateVictim())
72 return;
73
74 if (Class_Timer <= diff)
75 {
76 switch (myClass)
77 {
78 case CLASS_WARRIOR:
80 Class_Timer = 6000;
81 break;
82 case CLASS_PALADIN:
84 Class_Timer = 6000;
85 break;
86 case CLASS_HUNTER:
88 Class_Timer = 20000;
89 break;
90 case CLASS_ROGUE:
92 Class_Timer = 10000;
93 break;
94 case CLASS_PRIEST:
96 Class_Timer = 5000;
97 break;
98 case CLASS_SHAMAN:
100 Class_Timer = 8000;
101 break;
102 case CLASS_MAGE:
104 Class_Timer = 5000;
105 break;
106 case CLASS_WARLOCK:
108 Class_Timer = 20000;
109 break;
110 case CLASS_DRUID:
112 Class_Timer = 10000;
113 break;
114 }
115 } else Class_Timer -= diff;
116
118 }
119 };
120};
121
139
141{
142public:
143 boss_exarch_maladaar() : CreatureScript("boss_exarch_maladaar") { }
144
146 {
147 return new boss_exarch_maladaarAI(creature);
148 }
149
151 {
153 {
154 HasTaunted = false;
155 }
156
160
164
167
169 {
170 soulmodel = 0;
171 soulholder = 0;
172 soulclass = 0;
173
174 Fear_timer = 15000 + rand()% 5000;
176 StolenSoul_Timer = 25000 + rand()% 10000;
177
178 Avatar_summoned = false;
179 }
180
182
183 {
184 if (!HasTaunted && me->IsWithinDistInMap(who, 150.0f))
185 {
187 HasTaunted = true;
188 }
189
191 }
192
193 void EnterCombat(Unit* /*who*/) OVERRIDE
194 {
196 }
197
199 {
200 if (summoned->GetEntry() == ENTRY_STOLEN_SOUL)
201 {
202 //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Skyfire for this spell.
203 summoned->CastSpell(summoned, SPELL_STOLEN_SOUL_VISUAL, false);
204 summoned->SetDisplayId(soulmodel);
205 summoned->setFaction(me->getFaction());
206
207 if (Unit* target = Unit::GetUnit(*me, soulholder))
208 {
209 CAST_AI(npc_stolen_soul::npc_stolen_soulAI, summoned->AI())->SetMyClass(soulclass);
210 summoned->AI()->AttackStart(target);
211 }
212 }
213 }
214
215 void KilledUnit(Unit* /*victim*/) OVERRIDE
216 {
217 if (rand()%2)
218 return;
219
220 Talk(SAY_SLAY);
221 }
222
223 void JustDied(Unit* /*killer*/) OVERRIDE
224 {
226 //When Exarch Maladar is defeated D'ore appear.
227 me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 600000);
228 }
229
231 {
232 if (!UpdateVictim())
233 return;
234
236 {
237 if (me->IsNonMeleeSpellCasted(false))
238 me->InterruptNonMeleeSpells(true);
239
241
243 Avatar_summoned = true;
244 StolenSoul_Timer = 15000 + rand()% 15000;
245 }
246
247 if (StolenSoul_Timer <= diff)
248 {
249 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
250 {
251 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
252 {
253 if (me->IsNonMeleeSpellCasted(false))
254 me->InterruptNonMeleeSpells(true);
255
256 Talk(SAY_ROAR);
257
258 soulmodel = target->GetDisplayId();
259 soulholder = target->GetGUID();
260 soulclass = target->getClass();
261
262 DoCast(target, SPELL_STOLEN_SOUL);
263 me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
264
265 StolenSoul_Timer = 20000 + rand()% 10000;
266 } else StolenSoul_Timer = 1000;
267 }
268 } else StolenSoul_Timer -= diff;
269
270 if (Ribbon_of_Souls_timer <= diff)
271 {
272 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
274
275 Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
276 } else Ribbon_of_Souls_timer -= diff;
277
278 if (Fear_timer <= diff)
279 {
281 Fear_timer = 15000 + rand()% 15000;
282 } else Fear_timer -= diff;
283
285 }
286 };
287};
288
290{
291public:
292 npc_avatar_of_martyred() : CreatureScript("npc_avatar_of_martyred") { }
293
295 {
296 return new npc_avatar_of_martyredAI(creature);
297 }
298
300 {
302
304
306 {
307 Mortal_Strike_timer = 10000;
308 }
309
310 void EnterCombat(Unit* /*who*/) OVERRIDE
311 {
312 }
313
315 {
316 if (!UpdateVictim())
317 return;
318
319 if (Mortal_Strike_timer <= diff)
320 {
322 Mortal_Strike_timer = (std::rand() % 30 + 10) * 1000;
323 } else Mortal_Strike_timer -= diff;
324
326 }
327 };
328};
329
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
#define CAST_AI(a, b)
@ CLASS_HUNTER
@ CLASS_DRUID
@ CLASS_SHAMAN
@ CLASS_PRIEST
@ CLASS_WARRIOR
@ CLASS_WARLOCK
@ CLASS_MAGE
@ CLASS_PALADIN
@ CLASS_ROGUE
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
@ SAY_INTRO
@ SPELL_FIREBALL
@ SPELL_HAMMER_OF_JUSTICE
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_MIND_FLAY
@ SPELL_HAMMER_OF_JUSTICE
@ SPELL_FREEZING_TRAP
@ SPELL_AV_MORTAL_STRIKE
@ SPELL_AV_SUNDER_ARMOR
@ SPELL_MORTAL_STRIKE
@ SPELL_CURSE_OF_AGONY
@ SPELL_FROSTSHOCK
@ SPELL_MIND_FLAY
@ SPELL_HEMORRHAGE
@ SPELL_SUMMON_AVATAR
@ SPELL_STOLEN_SOUL_VISUAL
@ SPELL_SOUL_SCREAM
@ SPELL_RIBBON_OF_SOULS
@ SPELL_STOLEN_SOUL
@ ENTRY_STOLEN_SOUL
void AddSC_boss_exarch_maladaar()
@ SPELL_MORTAL_STRIKE
virtual void MoveInLineOfSight(Unit *)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
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
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_RIBBON_OF_SOULS