TrinityCore
Loading...
Searching...
No Matches
boss_baron_geddon.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 "molten_core.h"
20#include "ScriptedCreature.h"
21#include "SpellAuraEffects.h"
22#include "SpellInfo.h"
23#include "SpellScript.h"
24
26{
28};
29
39
47
48// 12056 - Baron Geddon
50{
52
53 void Reset() override
54 {
55 _Reset();
57 }
58
67
68 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
69 {
71 {
74 }
75 }
76
77 void OnSpellCast(SpellInfo const* spell) override
78 {
79 if (spell->Id == SPELL_ARMAGEDDON)
81 }
82
83 void UpdateAI(uint32 diff) override
84 {
85 if (!UpdateVictim())
86 return;
87
88 events.Update(diff);
89
91 return;
92
93 while (uint32 eventId = events.ExecuteEvent())
94 {
95 switch (eventId)
96 {
97 case EVENT_INFERNO:
99 events.Repeat(20s, 35s);
100 break;
103 events.Repeat(25s, 40s);
104 break;
106 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
107 DoCast(target, SPELL_LIVING_BOMB);
108 events.Repeat(10s, 20s);
109 break;
110 case EVENT_ARMAGEDDON:
112 break;
113 default:
114 break;
115 }
116
118 return;
119 }
120
122 }
123
124private:
126};
127
128// 19695 - Inferno
130{
132
133 bool Validate(SpellInfo const* /*spellInfo*/) override
134 {
136 }
137
138 void OnPeriodic(AuraEffect const* aurEff)
139 {
141 static const int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
144 args.TriggeringAura = aurEff;
145 args.AddSpellMod(SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1]);
146 GetTarget()->CastSpell(nullptr, SPELL_INFERNO_DMG, args);
147 }
148
153};
154
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_BASE_POINT0
#define AuraEffectPeriodicFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
@ SPELL_ARMAGEDDON
@ SPELL_INFERNO_DMG
@ SPELL_LIVING_BOMB
@ SPELL_IGNITE_MANA
@ SPELL_INFERNO
void AddSC_boss_baron_geddon()
@ EVENT_INFERNO
@ EVENT_IGNITE_MANA
@ EVENT_LIVING_BOMB
@ EVENT_ARMAGEDDON
@ EMOTE_SERVICE
uint32 GetTickNumber() const
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
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
uint32 Id
Definition SpellInfo.h:289
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
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 DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_baron_geddon_inferno)
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *aurEff)
#define RegisterMoltenCoreCreatureAI(ai_name)
@ BOSS_BARON_GEDDON
Definition molten_core.h:35
TriggerCastFlags TriggerFlags
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
AuraEffect const * TriggeringAura
boss_baron_geddon(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void OnSpellCast(SpellInfo const *spell) override
void Reset() override