Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_baron_geddon.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Baron_Geddon
8SD%Complete: 100
9SDComment:
10SDCategory: Molten Core
11EndScriptData */
12
13#include "ObjectMgr.h"
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
16#include "molten_core.h"
17
19{
21};
22
30
37
39{
40 public:
41 boss_baron_geddon() : CreatureScript("boss_baron_geddon") { }
42
44 {
46 {
47 }
48
50 {
51 BossAI::EnterCombat(victim);
52 events.ScheduleEvent(EVENT_INFERNO, 45000);
53 events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
54 events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
55 }
56
58 {
59 if (!UpdateVictim())
60 return;
61
62 events.Update(diff);
63
64 // If we are <2% hp cast Armageddon
65 if (!HealthAbovePct(2))
66 {
67 me->InterruptNonMeleeSpells(true);
70 return;
71 }
72
73 if (me->HasUnitState(UNIT_STATE_CASTING))
74 return;
75
76 while (uint32 eventId = events.ExecuteEvent())
77 {
78 switch (eventId)
79 {
80 case EVENT_INFERNO:
82 events.ScheduleEvent(EVENT_INFERNO, 45000);
83 break;
85 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IGNITE_MANA))
87 events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
88 break;
90 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
92 events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
93 break;
94 default:
95 break;
96 }
97 }
98
100 }
101 };
102
104 {
105 return new boss_baron_geddonAI(creature);
106 }
107};
108
110{
111 new boss_baron_geddon();
112}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ EMOTE_SERVICE
@ SPELL_ARMAGEDDON
@ SPELL_LIVING_BOMB
@ SPELL_IGNITE_MANA
@ SPELL_INFERNO
void AddSC_boss_baron_geddon()
@ EVENT_INFERNO
@ EVENT_IGNITE_MANA
@ EVENT_LIVING_BOMB
EventMap events
BossAI(Creature *creature, uint32 bossId)
void EnterCombat(Unit *) OVERRIDE
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_BARON_GEDDON
Definition molten_core.h:16
Creature * me
bool HealthAbovePct(uint32 pct) const
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *victim) OVERRIDE