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
40
48
53
54// 27975 - Maiden of Grief
56{
58
65
79
80 void OnSpellCast(SpellInfo const* spell) override
81 {
82 if (spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_SHOCK_OF_SORROW, me))
84 }
85
86 void KilledUnit(Unit* /*who*/) override
87 {
89 }
90
91 void JustDied(Unit* /*killer*/) override
92 {
93 _JustDied();
95 }
96
97 void UpdateAI(uint32 diff) override
98 {
99 if (!UpdateVictim())
100 return;
101
102 events.Update(diff);
103
105 return;
106
107 while (uint32 eventId = events.ExecuteEvent())
108 {
109 switch (eventId)
110 {
112 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
114 events.Repeat(30s, 40s);
115 break;
118 events.Repeat(15s, 20s);
119 break;
122 events.Repeat(20s, 35s);
123 break;
125 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
127 else
129 events.Repeat(5s, 25s);
130 break;
131 default:
132 break;
133 }
134
136 return;
137 }
138
140 }
141};
142
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:122
uint32_t uint32
Definition Define.h:133
#define sSpellMgr
Definition SpellMgr.h:738
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ SPELL_PILLAR_OF_WOE
@ SPELL_STORM_OF_GRIEF
@ SPELL_SHOCK_OF_SORROW
@ 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()
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
uint32 Id
Definition SpellInfo.h:289
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
@ 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)