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
113 }
114};
115
116// 23138 - Gate of Shazzrah
118{
120
121 bool Validate(SpellInfo const* /*spellInfo*/) override
122 {
124 }
125
126 void FilterTargets(std::list<WorldObject*>& targets)
127 {
128 if (targets.empty())
129 return;
130
132 targets.clear();
133 targets.push_back(target);
134 }
135
136 void HandleScript(SpellEffIndex /*effIndex*/)
137 {
139 }
140
146};
147
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
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:235
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:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:52
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_shazzrah_gate_dummy)
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) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
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