TrinityCore
Loading...
Searching...
No Matches
boss_pandemonius.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/*
19 * Timers requires to be revisited
20 * Is Dark Shell cast really delayed? Currently we have to delay it to not interrupt Void Blast sequence
21 * Spell 32326 is NYI. Not sure what it does. Don't know if it is used or not
22 */
23
24#include "ScriptMgr.h"
25#include "ScriptedCreature.h"
26#include "Spell.h"
27#include "SpellScript.h"
28#include "SpellInfo.h"
29#include "mana_tombs.h"
30
38
43
44#define SPELL_DARK_SHELL DUNGEON_MODE<uint32>(32358,38759)
45
53
54// 18341 - Pandemonius
55struct boss_pandemonius : public BossAI
56{
58
68
69 void OnSpellStart(SpellInfo const* spellInfo) override
70 {
71 if (spellInfo->Id == SPELL_DARK_SHELL)
73 }
74
75 void KilledUnit(Unit* /*victim*/) override
76 {
78 }
79
80 void JustDied(Unit* /*killer*/) override
81 {
82 _JustDied();
84 }
85
86 void ExecuteEvent(uint32 eventId) override
87 {
88 switch (eventId)
89 {
91 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
92 DoCast(target, SPELL_VOID_BLAST);
93 events.Repeat(25s, 35s);
95 break;
98 events.Repeat(20s, 30s);
99 break;
100 default:
101 break;
102 }
103 }
104};
105
106// 32325, 38760 - Void Blast
108{
110 {
111 int32 castIndex = GetCastIndex();
112 if (castIndex >= 4)
113 return;
114
115 if (Creature* caster = GetCaster()->ToCreature())
116 if (Unit* target = caster->AI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
117 caster->CastSpell(target, GetSpellInfo()->Id, CastSpellExtraArgs()
118 .AddSpellMod(SPELLVALUE_BASE_POINT2, castIndex + 1));
119 }
120
122 {
123 // We are storing number of casts in a non-effect SPELLVALUE_BASE_POINT2
125 }
126
131};
132
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_2
@ SPELLVALUE_BASE_POINT2
#define SpellCastFn(F)
#define SPELL_DARK_SHELL
PandemoniusSpells
@ SPELL_VOID_BLAST
void AddSC_boss_pandemonius()
PandemoniusTexts
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_SLAY
@ EMOTE_DARK_SHELL
PandemoniusEvents
@ EVENT_VOID_BLAST
@ DARK_SHELL_EVENT_GROUP
@ EVENT_DARK_SHELL
void JustEngagedWith(Unit *who) override
EventMap events
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void DelayEvents(Milliseconds delay)
Definition EventMap.cpp:100
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
uint32 const Id
Definition SpellInfo.h:328
HookList< CastHandler > AfterCast
Unit * GetCaster() const
SpellValue const * GetSpellValue() const
SpellInfo const * GetSpellInfo() const
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
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 DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
#define RegisterManaTombsCreatureAI(ai_name)
Definition mana_tombs.h:48
@ DATA_PANDEMONIUS
Definition mana_tombs.h:31
SpellEffectValue EffectBasePoints[MAX_SPELL_EFFECTS]
Definition Spell.h:242
void KilledUnit(Unit *) override
void JustEngagedWith(Unit *who) override
boss_pandemonius(Creature *creature)
void OnSpellStart(SpellInfo const *spellInfo) override
void JustDied(Unit *) override
void ExecuteEvent(uint32 eventId) override