TrinityCore
Loading...
Searching...
No Matches
boss_maiden_of_grief.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 "ScriptMgr.h"
19#include "halls_of_stone.h"
20#include "InstanceScript.h"
21#include "ScriptedCreature.h"
22#include "SpellInfo.h"
23#include "SpellMgr.h"
24
32
37
38#define SPELL_STORM_OF_GRIEF DUNGEON_MODE<uint32>(50752,59772)
39#define SPELL_SHOCK_OF_SORROW DUNGEON_MODE<uint32>(50760,59726)
40#define SPELL_PILLAR_OF_WOE DUNGEON_MODE<uint32>(50761,59727)
41
49
54
55// 27975 - Maiden of Grief
57{
59
73
74 void OnSpellCast(SpellInfo const* spell) override
75 {
76 if (spell->Id == SPELL_SHOCK_OF_SORROW)
78 }
79
80 void KilledUnit(Unit* /*who*/) override
81 {
83 }
84
85 void JustDied(Unit* /*killer*/) override
86 {
87 _JustDied();
89 }
90
91 void UpdateAI(uint32 diff) override
92 {
93 if (!UpdateVictim())
94 return;
95
96 events.Update(diff);
97
99 return;
100
101 while (uint32 eventId = events.ExecuteEvent())
102 {
103 switch (eventId)
104 {
106 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
108 events.Repeat(30s, 40s);
109 break;
112 events.Repeat(15s, 20s);
113 break;
116 events.Repeat(20s, 35s);
117 break;
119 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
121 else
123 events.Repeat(5s, 25s);
124 break;
125 default:
126 break;
127 }
128
130 return;
131 }
132 }
133};
134
uint32_t uint32
Definition Define.h:154
@ UNIT_STATE_CASTING
Definition Unit.h:290
#define SPELL_PILLAR_OF_WOE
@ SPELL_PARTING_SORROW
@ EVENT_PILLAR_OF_WOE
@ EVENT_PARTING_SORROW
@ EVENT_STORM_OF_GRIEF
@ EVENT_SHOCK_OF_SORROW
MaidenOfGriefAchievements
@ ACHIEV_GOOD_GRIEF_START_EVENT
void AddSC_boss_maiden_of_grief()
#define SPELL_SHOCK_OF_SORROW
#define SPELL_STORM_OF_GRIEF
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
uint32 const Id
Definition SpellInfo.h:328
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
@ DATA_MAIDEN_OF_GRIEF
#define RegisterHallsOfStoneCreatureAI(ai_name)
bool IsHeroic() const
void UpdateAI(uint32 diff) override
void OnSpellCast(SpellInfo const *spell) override
void JustEngagedWith(Unit *who) override
void KilledUnit(Unit *) override
void JustDied(Unit *) override
boss_maiden_of_grief(Creature *creature)