Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_shadow_hunter_voshgajin.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{
13 SPELL_HEX = 16708,
14 SPELL_CLEAVE = 20691,
15};
16
23
25{
26public:
27 boss_shadow_hunter_voshgajin() : CreatureScript("boss_shadow_hunter_voshgajin") { }
28
30 {
31 return new boss_shadowvoshAI(creature);
32 }
33
34 struct boss_shadowvoshAI : public BossAI
35 {
37
39 {
40 _Reset();
41 //DoCast(me, SPELL_ICEARMOR, true);
42 }
43
44 void EnterCombat(Unit* /*who*/) OVERRIDE
45 {
48 events.ScheduleEvent(EVENT_HEX, 8 * IN_MILLISECONDS);
49 events.ScheduleEvent(EVENT_CLEAVE, 14 * IN_MILLISECONDS);
50 }
51
52 void JustDied(Unit* /*killer*/) OVERRIDE
53 {
54 _JustDied();
55 }
56
58 {
59 if (!UpdateVictim())
60 return;
61
62 events.Update(diff);
63
64 if (me->HasUnitState(UNIT_STATE_CASTING))
65 return;
66
67 while (uint32 eventId = events.ExecuteEvent())
68 {
69 switch (eventId)
70 {
73 events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 45 * IN_MILLISECONDS);
74 break;
75 case EVENT_HEX:
76 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
77 DoCast(target, SPELL_HEX);
78 events.ScheduleEvent(EVENT_HEX, 15 * IN_MILLISECONDS);
79 break;
80 case EVENT_CLEAVE:
82 events.ScheduleEvent(EVENT_CLEAVE, 7 * IN_MILLISECONDS);
83 break;
84 }
85 }
87 }
88 };
89};
90
@ IN_MILLISECONDS
Definition Common.h:125
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_CLEAVE
@ EVENT_CLEAVE
@ DATA_SHADOW_HUNTER_VOSHGAJIN
void AddSC_boss_shadowvosh()
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
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
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================