Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gehennas.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_Gehennas
8SD%Complete: 90
9SDComment: Adds MC NYI
10SDCategory: Molten Core
11EndScriptData */
12
13#include "ObjectMgr.h"
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
16#include "molten_core.h"
17
24
31
33{
34 public:
35 boss_gehennas() : CreatureScript("boss_gehennas") { }
36
37 struct boss_gehennasAI : public BossAI
38 {
40 {
41 }
42
44 {
45 BossAI::EnterCombat(victim);
46 events.ScheduleEvent(EVENT_GEHENNAS_CURSE, 12000);
47 events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 10000);
48 events.ScheduleEvent(EVENT_SHADOW_BOLT, 6000);
49 }
50
52 {
53 if (!UpdateVictim())
54 return;
55
56 events.Update(diff);
57
58 if (me->HasUnitState(UNIT_STATE_CASTING))
59 return;
60
61 while (uint32 eventId = events.ExecuteEvent())
62 {
63 switch (eventId)
64 {
67 events.ScheduleEvent(EVENT_GEHENNAS_CURSE, std::rand() % 30000 + 22000);
68 break;
70 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
72 events.ScheduleEvent(EVENT_RAIN_OF_FIRE, std::rand() % 12000 + 4000);
73 break;
75 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
77 events.ScheduleEvent(EVENT_SHADOW_BOLT, 7000);
78 break;
79 default:
80 break;
81 }
82 }
83
85 }
86 };
87
89 {
90 return new boss_gehennasAI(creature);
91 }
92};
93
95{
96 new boss_gehennas();
97}
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
@ SPELL_RAIN_OF_FIRE
@ SPELL_SHADOW_BOLT
@ SPELL_GEHENNAS_CURSE
void AddSC_boss_gehennas()
@ EVENT_GEHENNAS_CURSE
@ EVENT_RAIN_OF_FIRE
@ EVENT_SHADOW_BOLT
@ EVENT_SHADOW_BOLT
EventMap events
BossAI(Creature *creature, uint32 bossId)
void EnterCombat(Unit *) OVERRIDE
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_GEHENNAS
Definition molten_core.h:13
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *victim) OVERRIDE
boss_gehennasAI(Creature *creature)