Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_omor_the_unscarred.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_Omar_The_Unscarred
8SD%Complete: 90
9SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper.
10SDCategory: Hellfire Citadel, Hellfire Ramparts
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "Player.h"
16#include "hellfire_ramparts.h"
17
27
39
41{
42 public:
43 boss_omor_the_unscarred() : CreatureScript("boss_omor_the_unscarred") { }
44
46 {
51
53 {
55
56 OrbitalStrike_Timer = 25000;
57 ShadowWhip_Timer = 2000;
58 Aura_Timer = 10000;
60 Shadowbolt_Timer = 2000;
61 Summon_Timer = 10000;
62 SummonedCount = 0;
63 PlayerGUID = 0;
64 CanPullBack = false;
65
66 _Reset();
67 }
68
69 void EnterCombat(Unit* /*who*/) OVERRIDE
70 {
73 }
74
75 void KilledUnit(Unit* /*victim*/) OVERRIDE
76 {
77 if (rand()%2)
78 return;
79
81 }
82
84 {
86
87 if (Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0))
88 summoned->AI()->AttackStart(random);
89
91 }
92
93 void JustDied(Unit* /*killer*/) OVERRIDE
94 {
96 _JustDied();
97 }
98
100 {
101 if (!UpdateVictim())
102 return;
103
104 //only two may be wrong, perhaps increase timer and spawn periodically instead.
105 if (SummonedCount < 2)
106 {
107 if (Summon_Timer <= diff)
108 {
109 me->InterruptNonMeleeSpells(false);
111 Summon_Timer = 15000+rand()%15000;
112 }
113 else
114 Summon_Timer -= diff;
115 }
116
117 if (CanPullBack)
118 {
119 if (ShadowWhip_Timer <= diff)
120 {
122 {
123 //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
124 if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))
125 {
126 me->InterruptNonMeleeSpells(false);
128 }
129 }
130 PlayerGUID = 0;
131 ShadowWhip_Timer = 2000;
132 CanPullBack = false;
133 }
134 else
135 ShadowWhip_Timer -= diff;
136 }
137 else
138 if (OrbitalStrike_Timer <= diff)
139 {
140 Unit* temp = NULL;
141 if (me->IsWithinMeleeRange(me->GetVictim()))
142 temp = me->GetVictim();
143 else temp = SelectTarget(SELECT_TARGET_RANDOM, 0);
144
145 if (temp && temp->GetTypeId() == TypeID::TYPEID_PLAYER)
146 {
148 OrbitalStrike_Timer = 14000+rand()%2000;
149 PlayerGUID = temp->GetGUID();
150
151 if (PlayerGUID)
152 CanPullBack = true;
153 }
154 }
155 else
156 OrbitalStrike_Timer -= diff;
157
158 if (HealthBelowPct(20))
159 {
160 if (DemonicShield_Timer <= diff)
161 {
163 DemonicShield_Timer = 15000;
164 }
165 else
166 DemonicShield_Timer -= diff;
167 }
168
169 if (Aura_Timer <= diff)
170 {
172
173 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
174 {
176 Aura_Timer = 8000+rand()%8000;
177 }
178 }
179 else
180 Aura_Timer -= diff;
181
182 if (Shadowbolt_Timer <= diff)
183 {
184 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
185 {
186 if (target)
187 target = me->GetVictim();
188
189 DoCast(target, SPELL_SHADOW_BOLT);
190 Shadowbolt_Timer = 4000+rand()%2500;
191 }
192 }
193 else
194 Shadowbolt_Timer -= diff;
195
197 }
198
199 private:
209 };
210
212 {
213 return new boss_omor_the_unscarredAI(creature);
214 }
215};
216
221
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
@ MOVEMENTFLAG_FALLING_FAR
Definition Unit.h:735
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
#define SAY_AGGRO
@ SPELL_SHADOW_BOLT
@ SPELL_TREACHEROUS_AURA
@ H_SPELL_BANE_OF_TREACHERY
@ SPELL_SUMMON_FIENDISH_HOUND
void AddSC_boss_omor_the_unscarred()
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
static Player * GetPlayer(WorldObject const &, uint64 guid)
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_OMOR_THE_UNSCARRED
void SetCombatMovement(bool allowMovement)
Creature * me
bool HealthBelowPct(uint32 pct) const
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================