Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_landslide.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
7
SDName: Boss_Landslide
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Maraudon
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
enum
Spells
17
{
18
SPELL_TRAMPLE
= 5568,
19
SPELL_LANDSLIDE
= 21808,
20
SPELL_KNOCKAWAY
= 110762,
21
};
22
23
class
boss_landslide
:
public
CreatureScript
24
{
25
public
:
26
boss_landslide
() :
CreatureScript
(
"boss_landslide"
) { }
27
28
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
29
{
30
return
new
boss_landslideAI
(creature);
31
}
32
33
struct
boss_landslideAI
:
public
ScriptedAI
34
{
35
boss_landslideAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
36
37
uint32
KnockAwayTimer
;
38
uint32
TrampleTimer
;
39
uint32
LandslideTimer
;
40
41
void
Reset
()
OVERRIDE
42
{
43
KnockAwayTimer
= 8000;
44
TrampleTimer
= 2000;
45
LandslideTimer
= 0;
46
}
47
48
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
49
{
50
}
51
52
void
UpdateAI
(
uint32
diff)
OVERRIDE
53
{
54
if
(!
UpdateVictim
())
55
return
;
56
57
//KnockAwayTimer
58
if
(
KnockAwayTimer
<= diff)
59
{
60
DoCastVictim
(
SPELL_KNOCKAWAY
);
61
KnockAwayTimer
= 15000;
62
}
63
else
KnockAwayTimer
-= diff;
64
65
//TrampleTimer
66
if
(
TrampleTimer
<= diff)
67
{
68
DoCast
(
me
,
SPELL_TRAMPLE
);
69
TrampleTimer
= 8000;
70
}
71
else
TrampleTimer
-= diff;
72
73
//Landslide
74
if
(
HealthBelowPct
(50))
75
{
76
if
(
LandslideTimer
<= diff)
77
{
78
me
->InterruptNonMeleeSpells(
false
);
79
DoCast
(
me
,
SPELL_LANDSLIDE
);
80
LandslideTimer
= 60000;
81
}
82
else
LandslideTimer
-= diff;
83
}
84
85
DoMeleeAttackIfReady
();
86
}
87
};
88
};
89
90
void
AddSC_boss_landslide
()
91
{
92
new
boss_landslide
();
93
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
SPELL_TRAMPLE
@ SPELL_TRAMPLE
Definition
boss_landslide.cpp:18
SPELL_LANDSLIDE
@ SPELL_LANDSLIDE
Definition
boss_landslide.cpp:19
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_landslide.cpp:20
AddSC_boss_landslide
void AddSC_boss_landslide()
Definition
boss_landslide.cpp:90
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_overlord_wyrmthalak.cpp:15
SPELL_TRAMPLE
@ SPELL_TRAMPLE
Definition
boss_ramstein_the_gorger.cpp:19
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_landslide
Definition
boss_landslide.cpp:24
boss_landslide::boss_landslide
boss_landslide()
Definition
boss_landslide.cpp:26
boss_landslide::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_landslide.cpp:28
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_landslide::boss_landslideAI
Definition
boss_landslide.cpp:34
boss_landslide::boss_landslideAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_landslide.cpp:52
boss_landslide::boss_landslideAI::KnockAwayTimer
uint32 KnockAwayTimer
Definition
boss_landslide.cpp:37
boss_landslide::boss_landslideAI::LandslideTimer
uint32 LandslideTimer
Definition
boss_landslide.cpp:39
boss_landslide::boss_landslideAI::boss_landslideAI
boss_landslideAI(Creature *creature)
Definition
boss_landslide.cpp:35
boss_landslide::boss_landslideAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_landslide.cpp:48
boss_landslide::boss_landslideAI::Reset
void Reset() OVERRIDE
Definition
boss_landslide.cpp:41
boss_landslide::boss_landslideAI::TrampleTimer
uint32 TrampleTimer
Definition
boss_landslide.cpp:38
src
server
scripts
Kalimdor
Maraudon
boss_landslide.cpp
Generated on
for Project SkyFire Core by
1.17.0