Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_magmadar.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_Magmadar
8SD%Complete: 75
9SDComment: Conflag on ground nyi
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
24{
25 SPELL_FRENZY = 19451,
27 SPELL_PANIC = 19408,
29};
30
37
39{
40 public:
41 boss_magmadar() : CreatureScript("boss_magmadar") { }
42
43 struct boss_magmadarAI : public BossAI
44 {
46 {
47 }
48
50 {
53 }
54
56 {
57 BossAI::EnterCombat(victim);
58 events.ScheduleEvent(EVENT_FRENZY, 30000);
59 events.ScheduleEvent(EVENT_PANIC, 20000);
60 events.ScheduleEvent(EVENT_LAVA_BOMB, 12000);
61 }
62
64 {
65 if (!UpdateVictim())
66 return;
67
68 events.Update(diff);
69
70 if (me->HasUnitState(UNIT_STATE_CASTING))
71 return;
72
73 while (uint32 eventId = events.ExecuteEvent())
74 {
75 switch (eventId)
76 {
77 case EVENT_FRENZY:
80 events.ScheduleEvent(EVENT_FRENZY, 15000);
81 break;
82 case EVENT_PANIC:
84 events.ScheduleEvent(EVENT_PANIC, 35000);
85 break;
86 case EVENT_LAVA_BOMB:
87 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_LAVA_BOMB))
88 DoCast(target, SPELL_LAVA_BOMB);
89 events.ScheduleEvent(EVENT_LAVA_BOMB, 12000);
90 break;
91 default:
92 break;
93 }
94 }
95
97 }
98 };
99
101 {
102 return new boss_magmadarAI(creature);
103 }
104};
105
107{
108 new boss_magmadar();
109}
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_FRENZY
void AddSC_boss_magmadar()
@ SPELL_FRENZY
@ SPELL_MAGMA_SPIT
@ SPELL_LAVA_BOMB
@ SPELL_PANIC
@ EMOTE_FRENZY
@ EVENT_PANIC
@ EVENT_LAVA_BOMB
@ EVENT_FRENZY
EventMap events
void Reset() OVERRIDE
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_MAGMADAR
Definition molten_core.h:12
Creature * me
boss_magmadarAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *victim) OVERRIDE