TrinityCore
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/* ScriptData
19SDName: Boss_Baron_Geddon
20SD%Complete: 100
21SDComment:
22SDCategory: Molten Core
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "molten_core.h"
27#include "ScriptedCreature.h"
28#include "SpellAuraEffects.h"
29#include "SpellScript.h"
30
32{
34};
35
37{
43};
44
46{
50};
51
53{
55 {
56 }
57
58 void JustEngagedWith(Unit* victim) override
59 {
64 }
65
66 void UpdateAI(uint32 diff) override
67 {
68 if (!UpdateVictim())
69 return;
70
71 events.Update(diff);
72
73 // If we are <2% hp cast Armageddon
74 if (!HealthAbovePct(2))
75 {
79 return;
80 }
81
83 return;
84
85 while (uint32 eventId = events.ExecuteEvent())
86 {
87 switch (eventId)
88 {
89 case EVENT_INFERNO:
92 break;
94 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_IGNITE_MANA))
97 break;
99 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
100 DoCast(target, SPELL_LIVING_BOMB);
102 break;
103 default:
104 break;
105 }
106
108 return;
109 }
110 }
111};
112
113// 19695 - Inferno
115{
116 void OnPeriodic(AuraEffect const* aurEff)
117 {
119 static const int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
122 args.TriggeringAura = aurEff;
123 args.AddSpellMod(SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1]);
124 GetTarget()->CastSpell(nullptr, SPELL_INFERNO_DMG, args);
125 }
126
127 void Register() override
128 {
130 }
131};
132
134{
137}
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:196
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ EMOTE_SERVICE
@ 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
uint32 GetTickNumber() const
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
Unit * GetTarget() const
void JustEngagedWith(Unit *who) override
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void OnPeriodic(AuraEffect const *aurEff)
#define RegisterMoltenCoreCreatureAI(ai_name)
Definition: molten_core.h:84
@ BOSS_BARON_GEDDON
Definition: molten_core.h:35
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:478
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
AuraEffect const * TriggeringAura
Definition: SpellDefines.h:481
bool HealthAbovePct(uint32 pct) const
boss_baron_geddon(Creature *creature)
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *victim) override