Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_ouro.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_Ouro
8SD%Complete: 85
9SDComment: No model for submerging. Currently just invisible.
10SDCategory: Temple of Ahn'Qiraj
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "temple_of_ahnqiraj.h"
16
18{
19 SPELL_SWEEP = 26103,
22 SPELL_BIRTH = 26262, // The Birth Animation
24};
25
27{
28public:
29 boss_ouro() : CreatureScript("boss_ouro") { }
30
32 {
33 return new boss_ouroAI(creature);
34 }
35
36 struct boss_ouroAI : public ScriptedAI
37 {
38 boss_ouroAI(Creature* creature) : ScriptedAI(creature) { }
39
46
47 bool Enrage;
49
51 {
52 Sweep_Timer = std::rand() % 10000 + 5000;
53 SandBlast_Timer = std::rand() % 35000 + 20000;
54 Submerge_Timer = std::rand() % 150000 + 90000;
55 Back_Timer = std::rand() % 45000 + 30000;
56 ChangeTarget_Timer = std::rand() % 8000 + 5000;
57 Spawn_Timer = std::rand() % 20000 + 10000;
58
59 Enrage = false;
60 Submerged = false;
61 }
62
63 void EnterCombat(Unit* /*who*/) OVERRIDE
64 {
66 }
67
69 {
70 //Return since we have no target
71 if (!UpdateVictim())
72 return;
73
74 //Sweep_Timer
75 if (!Submerged && Sweep_Timer <= diff)
76 {
78 Sweep_Timer = std::rand() % 30000 + 15000;
79 }
80 else Sweep_Timer -= diff;
81
82 //SandBlast_Timer
83 if (!Submerged && SandBlast_Timer <= diff)
84 {
86 SandBlast_Timer = std::rand() % 35000 + 20000;
87 }
88 else SandBlast_Timer -= diff;
89
90 //Submerge_Timer
91 if (!Submerged && Submerge_Timer <= diff)
92 {
93 //Cast
94 me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
96 me->setFaction(35);
98
99 Submerged = true;
100 Back_Timer = std::rand() % 45000 + 30000;
101 }
102 else Submerge_Timer -= diff;
103
104 //ChangeTarget_Timer
105 if (Submerged && ChangeTarget_Timer <= diff)
106 {
107 Unit* target = NULL;
109
110 if (target)
111 DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
112
113 ChangeTarget_Timer = std::rand() % 20000 + 10000;
114 }
115 else ChangeTarget_Timer -= diff;
116
117 //Back_Timer
118 if (Submerged && Back_Timer <= diff)
119 {
121 me->setFaction(14);
122
124
125 Submerged = false;
126 Submerge_Timer = std::rand() % 120000 + 60000;
127 }
128 else Back_Timer -= diff;
129
131 }
132 };
133};
134
136{
137 new boss_ouro();
138}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ EMOTE_ONESHOT_SUBMERGE
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
@ SPELL_GROUND_RUPTURE
@ SPELL_BIRTH
Definition boss_ouro.cpp:22
@ SPELL_DIRTMOUND_PASSIVE
Definition boss_ouro.cpp:23
@ SPELL_SWEEP
Definition boss_ouro.cpp:19
@ SPELL_GROUND_RUPTURE
Definition boss_ouro.cpp:21
@ SPELL_SANDBLAST
Definition boss_ouro.cpp:20
void AddSC_boss_ouro()
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition boss_ouro.cpp:31
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
Creature * me
void DoTeleportTo(float x, float y, float z, uint32 time=0)
ScriptedAI(Creature *creature)
void Reset() OVERRIDE
Definition boss_ouro.cpp:50
boss_ouroAI(Creature *creature)
Definition boss_ouro.cpp:38
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition boss_ouro.cpp:68
void EnterCombat(Unit *) OVERRIDE
Definition boss_ouro.cpp:63