Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_cyanigosa.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#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "violet_hold.h"
9
22
33
35{
36public:
37 boss_cyanigosa() : CreatureScript("boss_cyanigosa") { }
38
40 {
41 return new boss_cyanigosaAI(creature);
42 }
43
45 {
46 boss_cyanigosaAI(Creature* creature) : ScriptedAI(creature)
47 {
48 instance = creature->GetInstanceScript();
49 }
50
56
58
60 {
61 uiArcaneVacuumTimer = 10000;
62 uiBlizzardTimer = 15000;
64 uiTailSweepTimer = 20000;
66 if (instance)
68 }
69
70 void EnterCombat(Unit* /*who*/) OVERRIDE
71 {
73
74 if (instance)
76 }
77
78 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
79
80
82 {
83 if (instance && instance->GetData(DATA_REMOVE_NPC) == 1)
84 {
85 me->DespawnOrUnsummon();
86 instance->SetData(DATA_REMOVE_NPC, 0);
87 }
88
89 //Return since we have no target
90 if (!UpdateVictim())
91 return;
92
93 if (uiArcaneVacuumTimer <= diff)
94 {
96 uiArcaneVacuumTimer = 10000;
97 } else uiArcaneVacuumTimer -= diff;
98
99 if (uiBlizzardTimer <= diff)
100 {
101 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
102 DoCast(target, SPELL_BLIZZARD);
103 uiBlizzardTimer = 15000;
104 } else uiBlizzardTimer -= diff;
105
106 if (uiTailSweepTimer <= diff)
107 {
109 uiTailSweepTimer = 20000;
110 } else uiTailSweepTimer -= diff;
111
112 if (uiUncontrollableEnergyTimer <= diff)
113 {
116 } else uiUncontrollableEnergyTimer -= diff;
117
118 if (IsHeroic())
119 {
120 if (uiManaDestructionTimer <= diff)
121 {
122 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
125 } else uiManaDestructionTimer -= diff;
126 }
127
129 }
130
131 void JustDied(Unit* /*killer*/) OVERRIDE
132 {
134
135 if (instance)
137 }
138
140 {
141 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
142 return;
143
144 Talk(SAY_SLAY);
145 }
146 };
147};
148
150{
151 public:
153 {
154 }
155
156 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
157 {
158 if (!target)
159 return false;
160
161 InstanceScript* instance = target->GetInstanceScript();
162 if (!instance)
163 return false;
164
165 if (!instance->GetData(DATA_DEFENSELESS))
166 return false;
167
168 return true;
169 }
170};
171
173{
174 new boss_cyanigosa();
176}
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
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_TRANSFORM
@ SAY_DEATH
@ SAY_BREATH_ATTACK
@ SAY_AGGRO
@ SAY_DISRUPTION
@ SAY_SLAY
@ SAY_SPECIAL_ATTACK
@ H_SPELL_BLIZZARD
@ H_SPELL_UNCONTROLLABLE_ENERGY
@ SPELL_UNCONTROLLABLE_ENERGY
@ SPELL_ARCANE_VACUUM
@ SPELL_BLIZZARD
@ SPELL_MANA_DESTRUCTION
@ H_SPELL_TAIL_SWEEP
@ SPELL_TAIL_SWEEP
void AddSC_boss_cyanigosa()
@ SPELL_TAIL_SWEEP
AchievementCriteriaScript(const char *name)
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
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:36
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool IsHeroic() const
Creature * me
ScriptedAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void KilledUnit(Unit *victim) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MoveInLineOfSight(Unit *) OVERRIDE
@ DATA_CYANIGOSA_EVENT
Definition violet_hold.h:13
@ DATA_REMOVE_NPC
Definition violet_hold.h:15
@ DATA_DEFENSELESS
Definition violet_hold.h:26