TrinityCore
Loading...
Searching...
No Matches
boss_shazzrah.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 "Containers.h"
20#include "molten_core.h"
21#include "ScriptedCreature.h"
22#include "SpellInfo.h"
23#include "SpellScript.h"
24
35
44
45// 12264 - Shazzrah
46struct boss_shazzrah : public BossAI
47{
48 boss_shazzrah(Creature* creature) : BossAI(creature, BOSS_SHAZZRAH) { }
49
60
61 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
62 {
63 if (spellInfo->Id == SPELL_SHAZZRAH_GATE_TELE)
64 {
67 }
68 }
69
70 void UpdateAI(uint32 diff) override
71 {
72 if (!UpdateVictim())
73 return;
74
75 events.Update(diff);
76
78 return;
79
80 while (uint32 eventId = events.ExecuteEvent())
81 {
82 switch (eventId)
83 {
86 events.Repeat(4s, 6s);
87 break;
90 events.Repeat(20s, 30s);
91 break;
94 events.Repeat(20s, 25s);
95 break;
98 events.Repeat(15s, 20s);
99 break;
102 events.Repeat(40s, 45s);
103 break;
104 default:
105 break;
106 }
107
109 return;
110 }
111 }
112};
113
114// 23138 - Gate of Shazzrah
116{
117 bool Validate(SpellInfo const* /*spellInfo*/) override
118 {
120 }
121
122 void FilterTargets(std::list<WorldObject*>& targets)
123 {
124 if (targets.empty())
125 return;
126
128 targets.clear();
129 targets.push_back(target);
130 }
131
132 void HandleScript(SpellEffIndex /*effIndex*/)
133 {
135 }
136
142};
143
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:290
ShazzrahEvents
@ EVENT_COUNTERSPELL
@ EVENT_ARCANE_EXPLOSION
@ EVENT_SHAZZRAH_GATE
@ EVENT_SHAZZRAH_CURSE
@ EVENT_MAGIC_GROUNDING
void AddSC_boss_shazzrah()
ShazzrahSpells
@ SPELL_COUNTERSPELL
@ SPELL_SHAZZRAH_GATE_TELE
@ SPELL_ARCANE_EXPLOSION
@ SPELL_MAGIC_GROUNDING
@ SPELL_SHAZZRAH_CURSE
@ SPELL_SHAZZRAH_GATE
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 RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:56
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Definition Unit.h:647
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
#define RegisterMoltenCoreCreatureAI(ai_name)
@ BOSS_SHAZZRAH
Definition molten_core.h:34
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
void ResetThreatList(Unit *who=nullptr)
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void UpdateAI(uint32 diff) override
boss_shazzrah(Creature *creature)
void JustEngagedWith(Unit *who) override