TrinityCore
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
26{
30 SAY_STUN = 3
31};
32
34{
36};
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
43{
48};
49
51{
53};
54
56{
58
59 void JustEngagedWith(Unit* who) override
60 {
63
64 if (IsHeroic())
69
71 }
72
73 void KilledUnit(Unit* /*who*/) override
74 {
76 }
77
78 void OnSpellCast(SpellInfo const* spell) override
79 {
80 if (spell->Id == SPELL_SHOCK_OF_SORROW)
82 }
83
84 void JustDied(Unit* /*killer*/) override
85 {
86 _JustDied();
88 }
89
90 void UpdateAI(uint32 diff) override
91 {
92 if (!UpdateVictim())
93 return;
94
95 events.Update(diff);
96
98 return;
99
100 while (uint32 eventId = events.ExecuteEvent())
101 {
102 switch (eventId)
103 {
105 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
107 events.Repeat(30s, 40s);
108 break;
111 events.Repeat(15s, 20s);
112 break;
115 events.Repeat(20s, 35s);
116 break;
118 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
120 else
122 events.Repeat(5s, 25s);
123 break;
124 default:
125 break;
126 }
127
129 return;
130 }
131 }
132};
133
135{
137}
Texts
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
#define SPELL_PILLAR_OF_WOE
@ SPELL_PARTING_SORROW
void AddSC_boss_maiden_of_grief()
#define SPELL_SHOCK_OF_SORROW
#define SPELL_STORM_OF_GRIEF
@ ACHIEV_GOOD_GRIEF_START_EVENT
@ EVENT_PILLAR_OF_WOE
@ EVENT_PARTING_SORROW
@ EVENT_STORM_OF_GRIEF
@ EVENT_SHOCK_OF_SORROW
Achievements
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
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 Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
uint32 const Id
Definition: SpellInfo.h:325
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 DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
@ 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)