TrinityCore
boss_landslide.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Boss_Landslide
20SD%Complete: 100
21SDComment:
22SDCategory: Maraudon
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "maraudon.h"
27#include "ScriptedCreature.h"
28
30{
33 SPELL_LANDSLIDE = 21808
34};
35
37{
38public:
39 boss_landslide() : CreatureScript("boss_landslide") { }
40
41 CreatureAI* GetAI(Creature* creature) const override
42 {
43 return GetMaraudonAI<boss_landslideAI>(creature);
44 }
45
46 struct boss_landslideAI : public BossAI
47 {
49 {
50 Initialize();
51 }
52
54 {
55 KnockAwayTimer = 8000;
56 TrampleTimer = 2000;
58 }
59
63
64 void Reset() override
65 {
67
68 Initialize();
69 }
70
71 void UpdateAI(uint32 diff) override
72 {
73 if (!UpdateVictim())
74 return;
75
76 //KnockAwayTimer
77 if (KnockAwayTimer <= diff)
78 {
80 KnockAwayTimer = 15000;
81 }
82 else KnockAwayTimer -= diff;
83
84 //TrampleTimer
85 if (TrampleTimer <= diff)
86 {
88 TrampleTimer = 8000;
89 }
90 else TrampleTimer -= diff;
91
92 //Landslide
93 if (HealthBelowPct(50))
94 {
95 if (LandslideTimer <= diff)
96 {
99 LandslideTimer = 60000;
100 }
101 else LandslideTimer -= diff;
102 }
103 }
104 };
105};
106
108{
109 new boss_landslide();
110}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ SPELL_TRAMPLE
@ SPELL_LANDSLIDE
@ SPELL_KNOCKAWAY
void AddSC_boss_landslide()
void Reset() override
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_LANDSLIDE
Definition: maraudon.h:32
bool HealthBelowPct(uint32 pct) const
boss_landslideAI(Creature *creature)
void UpdateAI(uint32 diff) override