Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_lavanthor.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 "violet_hold.h"
9
20
22{
23public:
24 boss_lavanthor() : CreatureScript("boss_lavanthor") { }
25
27 {
28 return new boss_lavanthorAI(creature);
29 }
30
32 {
33 boss_lavanthorAI(Creature* creature) : ScriptedAI(creature)
34 {
35 instance = creature->GetInstanceScript();
36 }
37
42
44
46 {
47 uiFireboltTimer = 1000;
48 uiFlameBreathTimer = 5000;
49 uiLavaBurnTimer = 10000;
51 if (instance)
52 {
53 if (instance->GetData(DATA_WAVE_COUNT) == 6)
55 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
57 }
58 }
59
60 void EnterCombat(Unit* /*who*/) OVERRIDE
61 {
62 if (instance)
63 {
64 if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_LAVANTHOR_CELL)))
65 if (pDoor->GetGoState() == GOState::GO_STATE_READY)
66 {
68 return;
69 }
70 if (instance->GetData(DATA_WAVE_COUNT) == 6)
72 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
74 }
75 }
76
78 {
80 return;
81
82 if (me->Attack(who, true))
83 {
84 me->AddThreat(who, 0.0f);
85 me->SetInCombatWith(who);
86 who->SetInCombatWith(me);
87 DoStartMovement(who);
88 }
89 }
90
91 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
92
93
95 {
96 //Return since we have no target
97 if (!UpdateVictim())
98 return;
99
100 if (uiFireboltTimer <= diff)
101 {
103 uiFireboltTimer = std::rand() % 13000 + 5000;
104 } else uiFireboltTimer -= diff;
105
106 if (uiFlameBreathTimer <= diff)
107 {
109 uiFlameBreathTimer = std::rand() % 15000 + 10000;
110 } else uiFlameBreathTimer -= diff;
111
112 if (uiLavaBurnTimer <= diff)
113 {
115 uiLavaBurnTimer = std::rand() % 23000 + 15000;
116 }
117
118 if (IsHeroic())
119 {
120 if (uiCauterizingFlamesTimer <= diff)
121 {
123 uiCauterizingFlamesTimer = std::rand() % 16000 + 10000;
124 } else uiCauterizingFlamesTimer -= diff;
125 }
126
128 }
129
130 void JustDied(Unit* /*killer*/) OVERRIDE
131 {
132 if (instance)
133 {
134 if (instance->GetData(DATA_WAVE_COUNT) == 6)
135 {
137 instance->SetData(DATA_WAVE_COUNT, 7);
138 }
139 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
140 {
142 instance->SetData(DATA_WAVE_COUNT, 13);
143 }
144 }
145 }
146 };
147};
148
150{
151 new boss_lavanthor();
152}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GO_STATE_READY
Definition GameObject.h:577
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ UNIT_FIELD_FLAGS
@ H_SPELL_FIREBOLT
@ H_SPELL_FLAME_BREATH
@ SPELL_FLAME_BREATH
@ H_SPELL_LAVA_BURN
@ SPELL_FIREBOLT
@ SPELL_LAVA_BURN
@ SPELL_CAUTERIZING_FLAMES
void AddSC_boss_lavanthor()
@ SPELL_FLAME_BREATH
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_WAVE_COUNT
bool IsHeroic() const
Creature * me
ScriptedAI(Creature *creature)
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MoveInLineOfSight(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
void AttackStart(Unit *who) OVERRIDE
@ DATA_LAVANTHOR_CELL
Definition violet_hold.h:45
@ DATA_1ST_BOSS_EVENT
Definition violet_hold.h:11
@ DATA_2ND_BOSS_EVENT
Definition violet_hold.h:12