Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: Boss_Landslide
8SD%Complete: 100
9SDComment:
10SDCategory: Maraudon
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
17{
21};
22
24{
25public:
26 boss_landslide() : CreatureScript("boss_landslide") { }
27
29 {
30 return new boss_landslideAI(creature);
31 }
32
34 {
35 boss_landslideAI(Creature* creature) : ScriptedAI(creature) { }
36
40
42 {
43 KnockAwayTimer = 8000;
44 TrampleTimer = 2000;
46 }
47
48 void EnterCombat(Unit* /*who*/) OVERRIDE
49 {
50 }
51
53 {
54 if (!UpdateVictim())
55 return;
56
57 //KnockAwayTimer
58 if (KnockAwayTimer <= diff)
59 {
61 KnockAwayTimer = 15000;
62 }
63 else KnockAwayTimer -= diff;
64
65 //TrampleTimer
66 if (TrampleTimer <= diff)
67 {
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);
80 LandslideTimer = 60000;
81 }
82 else LandslideTimer -= diff;
83 }
84
86 }
87 };
88};
89
91{
92 new boss_landslide();
93}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SPELL_TRAMPLE
@ SPELL_LANDSLIDE
@ SPELL_KNOCKAWAY
void AddSC_boss_landslide()
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE