Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_falric.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"
9
18
27
35
37{
38public:
39 boss_falric() : CreatureScript("boss_falric") { }
40
42 {
43 return new boss_falricAI(creature);
44 }
45
46 struct boss_falricAI : public boss_horAI
47 {
48 boss_falricAI(Creature* creature) : boss_horAI(creature) { }
49
51
53 {
55
57
58 if (instance)
60 }
61
62 void EnterCombat(Unit* /*who*/) OVERRIDE
63 {
65 if (instance)
67
68 events.ScheduleEvent(EVENT_QUIVERING_STRIKE, 23000);
69 events.ScheduleEvent(EVENT_IMPENDING_DESPAIR, 9000);
70 events.ScheduleEvent(EVENT_DEFILING_HORROR, std::rand() % 45000 + 25000);
71 }
72
73 void JustDied(Unit* /*killer*/) OVERRIDE
74 {
76
77 if (instance)
78 instance->SetBossState(DATA_FALRIC_EVENT, DONE);
79 }
80
81 void KilledUnit(Unit* /*victim*/) OVERRIDE
82 {
84 }
85
87 {
88 // Return since we have no target
89 if (!UpdateVictim())
90 return;
91
92 events.Update(diff);
93
94 if (me->HasUnitState(UNIT_STATE_CASTING))
95 return;
96
97 switch (events.ExecuteEvent())
98 {
101 events.ScheduleEvent(EVENT_QUIVERING_STRIKE, 10000);
102 break;
105 {
108 }
109 events.ScheduleEvent(EVENT_IMPENDING_DESPAIR, 13000);
110 break;
113 events.ScheduleEvent(EVENT_DEFILING_HORROR, std::rand() % 45000 + 25000);
114 break;
115 }
116
117 if ((uiHopelessnessCount < 1 && HealthBelowPct(66))
118 || (uiHopelessnessCount < 2 && HealthBelowPct(33))
119 || (uiHopelessnessCount < 3 && HealthBelowPct(10)))
120 {
123 }
124
126 }
127 };
128};
129
131{
132 new boss_falric();
133}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
void AddSC_boss_falric()
@ SPELL_DEFILING_HORROR
@ H_SPELL_HOPELESSNESS
@ SPELL_QUIVERING_STRIKE
@ SPELL_IMPENDING_DESPAIR
@ SPELL_HOPELESSNESS
@ SAY_DEATH
@ SAY_DEFILING_HORROR
@ SAY_AGGRO
@ SAY_IMPENDING_DESPAIR
@ SAY_SLAY
@ EVENT_IMPENDING_DESPAIR
@ EVENT_DEFILING_HORROR
@ EVENT_QUIVERING_STRIKE
@ EVENT_NONE
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_FALRIC_EVENT
Creature * me
bool HealthBelowPct(uint32 pct) const
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
void JustDied(Unit *) OVERRIDE
void KilledUnit(Unit *) OVERRIDE
boss_falricAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
InstanceScript * instance
boss_horAI(Creature *creature)