TrinityCore
boss_ras_frostwhisper.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#include "scholomance.h"
19#include "ScriptMgr.h"
20#include "ScriptedCreature.h"
21
23{
25 SPELL_ICE_ARMOR = 18100, // This is actually a buff he gives himself
26 SPELL_FREEZE = 18763,
27 SPELL_FEAR = 26070,
30};
31
33{
40};
41
43{
44public:
45 boss_boss_ras_frostwhisper() : CreatureScript("boss_boss_ras_frostwhisper") { }
46
47 struct boss_rasfrostAI : public BossAI
48 {
50
51 void Reset() override
52 {
53 _Reset();
55 }
56
57 void JustEngagedWith(Unit* who) override
58 {
65 }
66
67 void UpdateAI(uint32 diff) override
68 {
69 if (!UpdateVictim())
70 return;
71
72 events.Update(diff);
73
75 return;
76
77 while (uint32 eventId = events.ExecuteEvent())
78 {
79 switch (eventId)
80 {
81 case EVENT_ICE_ARMOR:
84 break;
85 case EVENT_FROSTBOLT:
86 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
87 DoCast(target, SPELL_FROSTBOLT);
89 break;
90 case EVENT_FREEZE:
93 break;
94 case EVENT_FEAR:
97 break;
101 break;
105 break;
106 default:
107 break;
108 }
109
111 return;
112 }
113 }
114 };
115
116 CreatureAI* GetAI(Creature* creature) const override
117 {
118 return GetScholomanceAI<boss_rasfrostAI>(creature);
119 }
120};
121
123{
125}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_FROSTBOLT
@ SPELL_ICE_ARMOR
@ SPELL_CHILL_NOVA
@ SPELL_FROSTVOLLEY
void AddSC_boss_rasfrost()
@ EVENT_FROSTVOLLEY
@ EVENT_CHILL_NOVA
@ EVENT_ICE_ARMOR
@ EVENT_FROSTBOLT
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
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
CreatureAI * GetAI(Creature *creature) const override
@ DATA_RAS_FROSTWHISPER
Definition: scholomance.h:40