TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_maleki_the_pallid.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_maleki_the_pallid
20SD%Complete: 100
21SDComment:
22SDCategory: Stratholme
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "ScriptedCreature.h"
28#include "stratholme.h"
29
31{
35 SPELL_ICETOMB = 16869
36};
37
39{
44};
45
47{
48public:
49 boss_maleki_the_pallid() : CreatureScript("boss_maleki_the_pallid") { }
50
52 {
54 {
56 }
57
58 void Reset() override
59 {
60 _events.Reset();
61 }
62
63 void JustEngagedWith(Unit* /*who*/) override
64 {
68 }
69
70 void JustDied(Unit* /*killer*/) override
71 {
73 }
74
75 void UpdateAI(uint32 diff) override
76 {
77 //Return since we have no target
78 if (!UpdateVictim())
79 return;
80
81 _events.Update(diff);
82
84 return;
85
86 while (uint32 eventId = _events.ExecuteEvent())
87 {
88 switch (eventId)
89 {
90 case EVENT_FROSTBOLT:
91 if (rand32() % 90)
94 break;
95 case EVENT_ICETOMB:
96 if (rand32() % 65)
99 break;
100 case EVENT_DRAINLIFE:
101 if (rand32() % 55)
104 break;
105 default:
106 break;
107 }
108 }
109
111 }
112
113 private:
116 };
117
118 CreatureAI* GetAI(Creature* creature) const override
119 {
120 return GetStratholmeAI<boss_maleki_the_pallidAI>(creature);
121 }
122};
123
125{
127}
uint32_t uint32
Definition: Define.h:133
@ IN_PROGRESS
Spells
Definition: PlayerAI.cpp:32
uint32 rand32()
Definition: Random.cpp:70
@ UNIT_STATE_CASTING
Definition: Unit.h:235
@ SPELL_DRAIN_MANA
void AddSC_boss_maleki_the_pallid()
@ EVENT_DRAIN_MANA
bool UpdateVictim()
Definition: CreatureAI.cpp:240
Creature *const me
Definition: CreatureAI.h:81
void Update(uint32 time)
Definition: EventMap.h:67
EventId ExecuteEvent()
Definition: EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:62
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:174
Definition: Unit.h:769
bool HasUnitState(const uint32 f) const
Definition: Unit.h:874
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1080
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:56
CreatureAI * GetAI(Creature *creature) const override
@ TYPE_PALLID
Definition: stratholme.h:31