Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_high_inquisitor_fairbanks.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_High_Inquisitor_Fairbanks
8SD%Complete: 100
9SDComment: @todo if this guy not involved in some special event, remove (and let ACID script)
10SDCategory: Scarlet Monastery
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
25
27{
28public:
29 boss_high_inquisitor_fairbanks() : CreatureScript("boss_high_inquisitor_fairbanks") { }
30
32 {
33 return new boss_high_inquisitor_fairbanksAI(creature);
34 }
35
37 {
39
47
49 {
50 CurseOfBlood_Timer = 10000;
51 DispelMagic_Timer = 30000;
52 Fear_Timer = 40000;
53 Heal_Timer = 30000;
54 Sleep_Timer = 30000;
55 Dispel_Timer = 20000;
56 PowerWordShield = false;
57 me->SetStandState(UNIT_STAND_STATE_DEAD);
58 me->SetUInt32Value(UNIT_FIELD_ANIM_TIER, 7);
59 }
60
61 void EnterCombat(Unit* /*who*/) OVERRIDE
62 {
63 me->SetStandState(UNIT_STAND_STATE_STAND);
64 me->SetUInt32Value(UNIT_FIELD_ANIM_TIER, 0);
65 }
66
68 {
69 if (!UpdateVictim())
70 return;
71
72 //If we are <25% hp cast Heal
73 if (!HealthAbovePct(25) && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
74 {
76 Heal_Timer = 30000;
77 }
78 else Heal_Timer -= diff;
79
80 //Fear_Timer
81 if (Fear_Timer <= diff)
82 {
83 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
84 DoCast(target, SPELL_FEAR);
85
86 Fear_Timer = 40000;
87 }
88 else Fear_Timer -= diff;
89
90 //Sleep_Timer
91 if (Sleep_Timer <= diff)
92 {
94 DoCast(target, SPELL_SLEEP);
95
96 Sleep_Timer = 30000;
97 }
98 else Sleep_Timer -= diff;
99
100 //PowerWordShield_Timer
101 if (!PowerWordShield && !HealthAbovePct(25))
102 {
104 PowerWordShield = true;
105 }
106
107 //Dispel_Timer
108 if (Dispel_Timer <= diff)
109 {
110 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
111 DoCast(target, SPELL_DISPELMAGIC);
112
113 DispelMagic_Timer = 30000;
114 }
115 else DispelMagic_Timer -= diff;
116
117 //CurseOfBlood_Timer
118 if (CurseOfBlood_Timer <= diff)
119 {
121 CurseOfBlood_Timer = 25000;
122 }
123 else CurseOfBlood_Timer -= diff;
124
126 }
127 };
128};
129
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STAND_STATE_DEAD
Definition Unit.h:169
@ UNIT_STAND_STATE_STAND
Definition Unit.h:162
@ SELECT_TARGET_TOPAGGRO
Definition UnitAI.h:24
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_ANIM_TIER
void AddSC_boss_high_inquisitor_fairbanks()
@ SPELL_DISPELMAGIC
@ SPELL_FEAR
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
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================