Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_nerubenkan.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_Nerubenkan
8SD%Complete: 70
9SDComment:
10SDCategory: Stratholme
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "stratholme.h"
16
24
26{
27public:
28 boss_nerubenkan() : CreatureScript("boss_nerubenkan") { }
29
31 {
32 return new boss_nerubenkanAI(creature);
33 }
34
36 {
37 boss_nerubenkanAI(Creature* creature) : ScriptedAI(creature)
38 {
39 instance = me->GetInstanceScript();
40 }
41
43
48
50 {
51 CryptScarabs_Timer = 3000;
52 EncasingWebs_Timer = 7000;
53 PierceArmor_Timer = 19000;
55 }
56
57 void EnterCombat(Unit* /*who*/) OVERRIDE
58 {
59 }
60
61 void JustDied(Unit* /*killer*/) OVERRIDE
62 {
63 if (instance)
65 }
66
67 void RaiseUndeadScarab(Unit* victim)
68 {
69 if (Creature* pUndeadScarab = DoSpawnCreature(10876, float(std::rand() % 9 + -9), float(std::rand() % 9 + -9), 0, 0, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000))
70 if (pUndeadScarab->AI())
71 pUndeadScarab->AI()->AttackStart(victim);
72 }
73
75 {
76 if (!UpdateVictim())
77 return;
78
79 //EncasingWebs
80 if (EncasingWebs_Timer <= diff)
81 {
83 EncasingWebs_Timer = 30000;
84 } else EncasingWebs_Timer -= diff;
85
86 //PierceArmor
87 if (PierceArmor_Timer <= diff)
88 {
89 if ((std::rand() % 3) < 2)
91 PierceArmor_Timer = 35000;
92 } else PierceArmor_Timer -= diff;
93
94 //CryptScarabs_Timer
95 if (CryptScarabs_Timer <= diff)
96 {
98 CryptScarabs_Timer = 20000;
99 } else CryptScarabs_Timer -= diff;
100
101 //RaiseUndeadScarab
102 if (RaiseUndeadScarab_Timer <= diff)
103 {
104 RaiseUndeadScarab(me->GetVictim());
106 } else RaiseUndeadScarab_Timer -= diff;
107
109 }
110 };
111};
112
114{
115 new boss_nerubenkan();
116}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:69
@ SPELL_PIERCEARMOR
@ SPELL_CRYPT_SCARABS
@ SPELL_ENCASINGWEBS
@ SPELL_RAISEUNDEADSCARAB
void AddSC_boss_nerubenkan()
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ TYPE_NERUB
Definition stratholme.h:13
Creature * me
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, TempSummonType type, uint32 despawntime)
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================