Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_moorabi.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 "gundrak.h"
9
11{
17 SPELL_QUAKE = 55101,
20 SPELL_TRANSFORMATION = 55098, //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects.
21};
22
32
33enum Misc
34{
36};
37
39{
40public:
41 boss_moorabi() : CreatureScript("boss_moorabi") { }
42
44 {
45 return new boss_moorabiAI(creature);
46 }
47
48 struct boss_moorabiAI : public ScriptedAI
49 {
50 boss_moorabiAI(Creature* creature) : ScriptedAI(creature)
51 {
52 instance = creature->GetInstanceScript();
53 }
54
56
57 bool bPhase;
58
63
75
76 void EnterCombat(Unit* /*who*/) OVERRIDE
77 {
80
81 if (instance)
83 }
84
86 {
87 //Return since we have no target
88 if (!UpdateVictim())
89 return;
90
91 if (!bPhase && me->HasAura(SPELL_TRANSFORMATION))
92 {
93 bPhase = true;
94 me->RemoveAura(SPELL_MOJO_FRENZY);
95 }
96
97 if (uiGroundTremorTimer <= uiDiff)
98 {
100 if (bPhase)
102 else
105 } else uiGroundTremorTimer -= uiDiff;
106
107 if (uiNumblingShoutTimer <= uiDiff)
108 {
109 if (bPhase)
111 else
114 } else uiNumblingShoutTimer -=uiDiff;
115
116 if (uiDeterminedStabTimer <= uiDiff)
117 {
118 if (bPhase)
120 else
123 } else uiDeterminedStabTimer -=uiDiff;
124
125 if (!bPhase && uiTransformationTImer <= uiDiff)
126 {
131 } else uiTransformationTImer -= uiDiff;
132
134 }
135
137 {
138 if (type == DATA_LESS_RABI)
139 return bPhase ? 0 : 1;
140
141 return 0;
142 }
143
144 void JustDied(Unit* /*killer*/) OVERRIDE
145 {
147
148 if (instance)
150 }
151
153 {
154 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
155 return;
156
157 Talk(SAY_SLAY);
158 }
159 };
160};
161
163{
164 public:
166 {
167 }
168
169 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
170 {
171 if (!target)
172 return false;
173
174 if (Creature* Moorabi = target->ToCreature())
175 if (Moorabi->AI()->GetData(DATA_LESS_RABI))
176 return true;
177
178 return false;
179 }
180};
181
183{
184 new boss_moorabi();
186}
@ IN_MILLISECONDS
Definition Common.h:125
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
@ SPELL_GROUND_TREMOR
#define SAY_DEATH
#define SAY_AGGRO
@ SAY_DEATH
@ SAY_QUAKE
@ SAY_AGGRO
@ SAY_TRANSFORM
@ SAY_SLAY
@ EMOTE_TRANSFORM
@ DATA_LESS_RABI
@ SPELL_DETERMINED_STAB
@ SPELL_DETERMINED_GORE
@ SPELL_MOJO_FRENZY
@ SPELL_QUAKE
@ SPELL_NUMBING_ROAR
@ SPELL_NUMBING_SHOUT
@ SPELL_GROUND_TREMOR
@ SPELL_TRANSFORMATION
@ H_SPELL_DETERMINED_GORE
void AddSC_boss_moorabi()
AchievementCriteriaScript(const char *name)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
Creature * ToCreature()
Definition Object.h:207
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
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_MOORABI_EVENT
Definition gundrak.h:12
Creature * me
ScriptedAI(Creature *creature)
void KilledUnit(Unit *victim) OVERRIDE
void JustDied(Unit *) OVERRIDE
boss_moorabiAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
uint32 GetData(uint32 type) const OVERRIDE