Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_hydromancer_thespia.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#include "ScriptMgr.h"
6#include "ScriptedCreature.h"
7#include "steam_vault.h"
8
23
25{
26public:
27 boss_hydromancer_thespia() : CreatureScript("boss_hydromancer_thespia") { }
28
30 {
31 return new boss_thespiaAI(creature);
32 }
33
34 struct boss_thespiaAI : public ScriptedAI
35 {
36 boss_thespiaAI(Creature* creature) : ScriptedAI(creature)
37 {
38 instance = creature->GetInstanceScript();
39 }
40
42
46
48 {
50 LungBurst_Timer = 7000;
52
53 if (instance)
55 }
56
57 void JustDied(Unit* /*killer*/) OVERRIDE
58 {
60
61 if (instance)
63 }
64
65 void KilledUnit(Unit* /*victim*/) OVERRIDE
66 {
68 }
69
70 void EnterCombat(Unit* /*who*/) OVERRIDE
71 {
73
74 if (instance)
76 }
77
79 {
80 if (!UpdateVictim())
81 return;
82
83 //LightningCloud_Timer
84 if (LightningCloud_Timer <= diff)
85 {
86 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
88
89 //cast twice in Heroic mode
90 if (IsHeroic())
91 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
93
94 LightningCloud_Timer = 15000+rand()%10000;
95 } else LightningCloud_Timer -=diff;
96
97 //LungBurst_Timer
98 if (LungBurst_Timer <= diff)
99 {
100 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
101 DoCast(target, SPELL_LUNG_BURST);
102 LungBurst_Timer = 7000+rand()%5000;
103 } else LungBurst_Timer -=diff;
104
105 //EnvelopingWinds_Timer
106 if (EnvelopingWinds_Timer <= diff)
107 {
108 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
110
111 //cast twice in Heroic mode
112 if (IsHeroic())
113 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
115 EnvelopingWinds_Timer = 10000+rand()%5000;
116 } else EnvelopingWinds_Timer -=diff;
117
119 }
120 };
121};
122
124{
125public:
126 npc_coilfang_waterelemental() : CreatureScript("npc_coilfang_waterelemental") { }
127
129 {
130 return new npc_coilfang_waterelementalAI(creature);
131 }
132
134 {
136
138
140 {
141 WaterBoltVolley_Timer = 3000+rand()%3000;
142 }
143
144 void EnterCombat(Unit* /*who*/) OVERRIDE { }
145
147 {
148 if (!UpdateVictim())
149 return;
150
151 if (WaterBoltVolley_Timer <= diff)
152 {
154 WaterBoltVolley_Timer = 7000+rand()%5000;
155 } else WaterBoltVolley_Timer -= diff;
156
158 }
159 };
160};
161
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_AGGRO
void AddSC_boss_hydromancer_thespia()
@ H_SPELL_WATER_BOLT_VOLLEY
@ SPELL_WATER_BOLT_VOLLEY
@ SPELL_WATER_BOLT_VOLLEY
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
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_HYDROMANCER_THESPIA
Definition steam_vault.h:15
bool IsHeroic() const
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================