Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_lord_valthalak.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
17
18enum Says
19{
21};
22
29
31{
32public:
33 boss_lord_valthalak() : CreatureScript("boss_lord_valthalak") { }
34
36 {
38
40 {
41 _Reset();
42 frenzy40 = false;
43 frenzy15 = false;
44 }
45
46 void EnterCombat(Unit* /*who*/) OVERRIDE
47 {
49 events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, std::rand() % 8000 + 6000);
50 events.ScheduleEvent(EVENT_SHADOW_WRATH, std::rand() % 18000 + 9000);
51 }
52
53 void JustDied(Unit* /*killer*/) OVERRIDE
54 {
55 if (instance)
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 {
75 events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, std::rand() % 35000 + 30000);
76 break;
79 events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, std::rand() % 6000 + 4000);
80 break;
83 events.ScheduleEvent(EVENT_SHADOW_WRATH, std::rand() % 24000 + 19000);
84 break;
85 default:
86 break;
87 }
88 }
89
90 if (!frenzy40)
91 {
92 if (HealthBelowPct(40))
93 {
96 frenzy40 = true;
97 }
98 }
99
100 if (!frenzy15)
101 {
102 if (HealthBelowPct(15))
103 {
105 events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, std::rand() % 14000 + 7000);
106 frenzy15 = true;
107 }
108 }
109
111 }
112 private:
115 };
116
118 {
119 return new boss_lord_valthalakAI(creature);
120 }
121};
122
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ DONE
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ DATA_LORD_VALTHALAK
@ SPELL_FRENZY
@ SPELL_SHADOW_BOLT_VOLLEY
@ SPELL_SHADOW_WRATH
@ SPELL_SUMMON_SPECTRAL_ASSASSIN
void AddSC_boss_lord_valthalak()
@ EVENT_SHADOW_BOLT_VOLLEY
@ EVENT_SHADOW_WRATH
@ EVENT_SUMMON_SPECTRAL_ASSASSIN
InstanceScript *const instance
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================