TrinityCore
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 {
55 }
56
57 void JustEngagedWith(Unit* who) override
58 {
63 }
64
65 void UpdateAI(uint32 diff) override
66 {
67 //Return since we have no target
68 if (!UpdateVictim())
69 return;
70
71 events.Update(diff);
72
74 return;
75
76 while (uint32 eventId = events.ExecuteEvent())
77 {
78 switch (eventId)
79 {
80 case EVENT_FROSTBOLT:
81 if (rand32() % 90)
84 break;
85 case EVENT_ICETOMB:
86 if (rand32() % 65)
89 break;
90 case EVENT_DRAINLIFE:
91 if (rand32() % 55)
94 break;
95 default:
96 break;
97 }
98 }
99 }
100 };
101
102 CreatureAI* GetAI(Creature* creature) const override
103 {
104 return GetStratholmeAI<boss_maleki_the_pallidAI>(creature);
105 }
106};
107
109{
111}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
uint32 rand32()
Definition: Random.cpp:70
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_DRAIN_MANA
void AddSC_boss_maleki_the_pallid()
@ EVENT_DRAIN_MANA
void _JustEngagedWith(Unit *who)
EventMap events
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_MALEKI_THE_PALLID
Definition: stratholme.h:37