Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_chrono_lord_epoch.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/* Script Data Start
7SDName: Boss epoch
8SDAuthor: Tartalo
9SD%Complete: 80
10SDComment: @todo Intro, consecutive attacks to a random target durin time wrap, adjust timers
11SDCategory:
12Script Data End */
13
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
17
19{
21 SPELL_TIME_WARP = 52766, //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec.
22 SPELL_TIME_STOP = 58848, //Stops time in a 50 yard sphere for 2 sec.
23 SPELL_WOUNDING_STRIKE = 52771, //Used only on the tank
25};
26
35
37{
38public:
39 boss_epoch() : CreatureScript("boss_epoch") { }
40
41 struct boss_epochAI : public ScriptedAI
42 {
43 boss_epochAI(Creature* creature) : ScriptedAI(creature)
44 {
45 instance = creature->GetInstanceScript();
46 uiStep = 0;
47 uiStepTimer = 0;
52 }
53
55 {
56 uiStep = 1;
57 uiStepTimer = 26000;
59 uiTimeWarpTimer = 25300;
60 uiTimeStopTimer = 21300;
62
63 if (instance)
65 }
66
67 void EnterCombat(Unit* /*who*/) OVERRIDE
68 {
70
71 if (instance)
73 }
74
76 {
77 //Return since we have no target
78 if (!UpdateVictim())
79 return;
80
81 if (uiCurseOfExertionTimer < diff)
82 {
83 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
86 } else uiCurseOfExertionTimer -= diff;
87
88 if (uiWoundingStrikeTimer < diff)
89 {
92 } else uiWoundingStrikeTimer -= diff;
93
94 if (uiTimeStopTimer < diff)
95 {
97 uiTimeStopTimer = 21300;
98 } else uiTimeStopTimer -= diff;
99
100 if (uiTimeWarpTimer < diff)
101 {
104 uiTimeWarpTimer = 25300;
105 } else uiTimeWarpTimer -= diff;
106
108 }
109
110 void JustDied(Unit* /*killer*/) OVERRIDE
111 {
113
114 if (instance)
115 instance->SetData(DATA_EPOCH_EVENT, DONE);
116 }
117
119 {
120 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
121 return;
122
123 Talk(SAY_SLAY);
124 }
125
126 private:
134 };
135
137 {
138 return new boss_epochAI(creature);
139 }
140};
141
143{
144 new boss_epoch();
145}
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
@ TYPEID_PLAYER
Definition Object.h:55
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
@ SAY_INTRO
void AddSC_boss_epoch()
@ SPELL_CURSE_OF_EXERTION
@ SPELL_WOUNDING_STRIKE
@ H_SPELL_WOUNDING_STRIKE
#define SAY_DEATH
#define SAY_AGGRO
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_EPOCH_EVENT
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void KilledUnit(Unit *victim) OVERRIDE
void EnterCombat(Unit *) OVERRIDE