Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_halycon.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#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "blackrock_spire.h"
9
11{
12 SPELL_REND = 13738,
14};
15
16enum Says
17{
19};
20
22{
25};
26
27const Position SummonLocation = { -167.9561f, -411.7844f, 76.23057f, 1.53589f };
28
30{
31public:
32 boss_halycon() : CreatureScript("boss_halycon") { }
33
34 struct boss_halyconAI : public BossAI
35 {
36 boss_halyconAI(Creature* creature) : BossAI(creature, DATA_HALYCON) { }
37
39 {
40 _Reset();
41 Summoned = false;
42 }
43
44 void EnterCombat(Unit* /*who*/) OVERRIDE
45 {
47 events.ScheduleEvent(EVENT_REND, std::rand() % 20000 + 17000);
48 events.ScheduleEvent(EVENT_THRASH, std::rand() % 12000 + 10000);
49 }
50
51 void JustDied(Unit* /*killer*/) OVERRIDE
52 {
55
56 Summoned = true;
57 }
58
60 {
61 if (!UpdateVictim())
62 return;
63
64 events.Update(diff);
65
66 if (me->HasUnitState(UNIT_STATE_CASTING))
67 return;
68
69 while (uint32 eventId = events.ExecuteEvent())
70 {
71 switch (eventId)
72 {
73 case EVENT_REND:
75 events.ScheduleEvent(EVENT_REND, std::rand() % 10000 + 8000);
76 break;
77 case EVENT_THRASH:
79 break;
80 default:
81 break;
82 }
83 }
85 }
86 private:
88 };
89
91 {
92 return new boss_halyconAI(creature);
93 }
94};
95
97{
98 new boss_halycon();
99}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ NPC_GIZRUL_THE_SLAVENER
@ DATA_HALYCON
@ EMOTE_DEATH
@ SPELL_THRASH
@ SPELL_REND
const Position SummonLocation
void AddSC_boss_halycon()
@ EVENT_REND
@ EVENT_THRASH
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
void EnterCombat(Unit *) OVERRIDE
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_halyconAI(Creature *creature)