Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_shirrak_the_dead_watcher.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
7Name: Boss_Shirrak_the_dead_watcher
8%Complete: 80
9Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented
10Category: Auchindoun, Auchenai Crypts
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "Player.h"
16
18{
22
24
25 SPELL_FOCUS_FIRE_VISUAL = 42075 //need to find better visual
26};
27
28enum Say
29{
31};
32
34{
36};
37
39{
40public:
41 boss_shirrak_the_dead_watcher() : CreatureScript("boss_shirrak_the_dead_watcher") { }
42
44 {
45 return new boss_shirrak_the_dead_watcherAI(creature);
46 }
47
49 {
51 {
52 }
53
58
60
62 {
64 Attractmagic_Timer = 28000;
66 FocusFire_Timer = 17000;
68 }
69
70 void EnterCombat(Unit* /*who*/) OVERRIDE
71 { }
72
74 {
75 if (summoned && summoned->GetEntry() == NPC_FOCUS_FIRE)
76 {
77 summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
78 summoned->setFaction(me->getFaction());
79 summoned->SetLevel(me->getLevel());
80 summoned->AddUnitState(UNIT_STATE_ROOT);
81
82 if (Unit* pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
83 summoned->AI()->AttackStart(pFocusedTarget);
84 }
85 }
86
88 {
89 //Inhibitmagic_Timer
90 if (Inhibitmagic_Timer <= diff)
91 {
92 float dist;
93 Map* map = me->GetMap();
94 Map::PlayerList const &PlayerList = map->GetPlayers();
95 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
96 if (Player* i_pl = i->GetSource())
97 if (i_pl->IsAlive() && (dist = i_pl->IsWithinDist(me, 45)))
98 {
99 i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
100 me->AddAura(SPELL_INHIBITMAGIC, i_pl);
101 if (dist < 35)
102 me->AddAura(SPELL_INHIBITMAGIC, i_pl);
103 if (dist < 25)
104 me->AddAura(SPELL_INHIBITMAGIC, i_pl);
105 if (dist < 15)
106 me->AddAura(SPELL_INHIBITMAGIC, i_pl);
107 }
108 Inhibitmagic_Timer = 3000+(rand()%1000);
109 } else Inhibitmagic_Timer -= diff;
110
111 //Return since we have no target
112 if (!UpdateVictim())
113 return;
114
115 //Attractmagic_Timer
116 if (Attractmagic_Timer <= diff)
117 {
119 Attractmagic_Timer = 30000;
121 } else Attractmagic_Timer -= diff;
122
123 //Carnivorousbite_Timer
124 if (Carnivorousbite_Timer <= diff)
125 {
127 Carnivorousbite_Timer = 10000;
128 } else Carnivorousbite_Timer -= diff;
129
130 //FocusFire_Timer
131 if (FocusFire_Timer <= diff)
132 {
133 // Summon Focus Fire & Emote
135 if (target && target->GetTypeId() == TypeID::TYPEID_PLAYER && target->IsAlive())
136 {
137 FocusedTargetGUID = target->GetGUID();
138 me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 5500);
139 Talk(EMOTE_FOCUSED, target);
140 }
141 FocusFire_Timer = 15000+(rand()%5000);
142 } else FocusFire_Timer -= diff;
143
145 }
146 };
147};
148
150{
151public:
152 npc_focus_fire() : CreatureScript("npc_focus_fire") { }
153
155 {
156 return new npc_focus_fireAI(creature);
157 }
158
160 {
161 npc_focus_fireAI(Creature* creature) : ScriptedAI(creature) { }
162
165
167 {
168 FieryBlast_Timer = 3000+(rand()%1000);
169 fiery1 = fiery2 = true;
170 }
171
172 void EnterCombat(Unit* /*who*/) OVERRIDE
173 { }
174
176 {
177 //Return since we have no target
178 if (!UpdateVictim())
179 return;
180
181 //FieryBlast_Timer
182 if (fiery2 && FieryBlast_Timer <= diff)
183 {
185
186 if (fiery1) fiery1 = false;
187 else if (fiery2) fiery2 = false;
188
189 FieryBlast_Timer = 1000;
190 } else FieryBlast_Timer -= diff;
191
193 }
194 };
195};
196
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
Definition Object.h:70
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
Creatures
void AddSC_boss_shirrak_the_dead_watcher()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
Definition Map.h:238
MapRefManager PlayerList
Definition Map.h:406
PlayerList const & GetPlayers() const
Definition Map.h:407
iterator end()
iterator begin()
LinkedListHead::Iterator< MapReference const > const_iterator
uint64 GetGUID() const
Definition Object.h:119
TypeID GetTypeId() const
Definition Object.h:131
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
Definition Unit.h:1367
bool IsAlive() const
Definition Unit.h:2032
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================