Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_void_reaver.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_Void_Reaver
8SD%Complete: 90
9SDComment: Should reset if raid are out of room.
10SDCategory: Tempest Keep, The Eye
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "the_eye.h"
16
24
26{
31};
32
34{
35public:
36 boss_void_reaver() : CreatureScript("boss_void_reaver") { }
37
39 {
40 boss_void_reaverAI(Creature* creature) : ScriptedAI(creature)
41 {
42 instance = creature->GetInstanceScript();
43 }
44
46
51
52 bool Enraged;
53
55 {
56 Pounding_Timer = 15000;
57 ArcaneOrb_Timer = 3000;
58 KnockAway_Timer = 30000;
59 Berserk_Timer = 600000;
60
61 Enraged = false;
62
63 if (instance && me->IsAlive())
65 }
66
67 void KilledUnit(Unit* /*victim*/) OVERRIDE
68 {
70 }
71
72 void JustDied(Unit* /*killer*/) OVERRIDE
73 {
76
77 if (instance)
79 }
80
81 void EnterCombat(Unit* /*who*/) OVERRIDE
82 {
84
85 if (instance)
87 }
88
90 {
91 if (!UpdateVictim())
92 return;
93 // Pounding
94 if (Pounding_Timer <= diff)
95 {
98 Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000)
99 }
100 else
101 Pounding_Timer -= diff;
102 // Arcane Orb
103 if (ArcaneOrb_Timer <= diff)
104 {
105 Unit* target = NULL;
106 std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
107 std::vector<Unit*> target_list;
108 for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
109 {
110 target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
111 if (!target)
112 continue;
113 // exclude pets & totems, 18 yard radius minimum
114 if (target->GetTypeId() == TypeID::TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false))
115 target_list.push_back(target);
116 target = NULL;
117 }
118
119 if (!target_list.empty())
120 target = *(target_list.begin() + rand() % target_list.size());
121 else
122 target = me->GetVictim();
123
124 if (target)
125 me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL, 0);
126 ArcaneOrb_Timer = 3000;
127 }
128 else
129 ArcaneOrb_Timer -= diff;
130 // Single Target knock back, reduces aggro
131 if (KnockAway_Timer <= diff)
132 {
134 //Drop 25% aggro
135 if (DoGetThreat(me->GetVictim()))
136 DoModifyThreatPercent(me->GetVictim(), -25);
137 KnockAway_Timer = 30000;
138 }
139 else
140 KnockAway_Timer -= diff;
141 //Berserk
142 if (Berserk_Timer < diff && !Enraged)
143 {
145 Enraged = true;
146 }
147 else
148 Berserk_Timer -= diff;
149
151
153 }
154 };
155
157 {
158 return new boss_void_reaverAI(creature);
159 }
160};
161
163{
164 new boss_void_reaver();
165}
166
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
#define SPELL_BERSERK
@ SPELL_KNOCK_AWAY
Definition boss_gyth.cpp:16
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_POUNDING
@ SAY_SLAY
@ SPELL_ARCANE_ORB
@ SPELL_KNOCK_AWAY
@ SPELL_BERSERK
@ SPELL_POUNDING
void AddSC_boss_void_reaver()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
TypeID GetTypeId() const
Definition Object.h:131
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
bool IsAlive() const
Definition Unit.h:2032
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1730
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
float DoGetThreat(Unit *unit)
bool EnterEvadeIfOutOfCombatArea(uint32 const diff)
ScriptedAI(Creature *creature)
void DoModifyThreatPercent(Unit *unit, int32 pct)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ DATA_VOIDREAVEREVENT
Definition the_eye.h:20