Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_razuvious.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 "naxxramas.h"
9
10//Razuvious - NO TEXT sound only
11//8852 aggro01 - Hah hah, I'm just getting warmed up!
12//8853 aggro02 Stand and fight!
13//8854 aggro03 Show me what you've got!
14//8861 slay1 - You should've stayed home!
15//8863 slay2-
16//8858 cmmnd3 - You disappoint me, students!
17//8855 cmmnd1 - Do as I taught you!
18//8856 cmmnd2 - Show them no mercy!
19//8859 cmmnd4 - The time for practice is over! Show me what you've learned!
20//8861 Sweep the leg! Do you have a problem with that?
21//8860 death - An honorable... death...
22//8947 - Aggro Mixed? - ?
23
24#define SOUND_AGGRO RAND(8852, 8853, 8854)
25#define SOUND_SLAY RAND(8861, 8863)
26#define SOUND_COMMND RAND(8855, 8856, 8858, 8859, 8861)
27#define SOUND_DEATH 8860
28#define SOUND_AGGROMIX 8847
29
37
46
48{
49public:
50 boss_razuvious() : CreatureScript("boss_razuvious") { }
51
53 {
54 return new boss_razuviousAI(creature);
55 }
56
57 struct boss_razuviousAI : public BossAI
58 {
59 boss_razuviousAI(Creature* creature) : BossAI(creature, BOSS_RAZUVIOUS) { }
60
61 void KilledUnit(Unit* /*victim*/) OVERRIDE
62 {
63 if (!(rand()%3))
65 }
66
67 void DamageTaken(Unit* pDone_by, uint32& uiDamage) OVERRIDE
68 {
69 // Damage done by the controlled Death Knight understudies should also count toward damage done by players
70 if (pDone_by->GetTypeId() == TypeID::TYPEID_UNIT && (pDone_by->GetEntry() == 16803 || pDone_by->GetEntry() == 29941))
71 {
72 me->LowerPlayerDamageReq(uiDamage);
73 }
74 }
75
76 void JustDied(Unit* /*killer*/) OVERRIDE
77 {
78 _JustDied();
80 me->CastSpell(me, SPELL_HOPELESS, true);
81 }
82
83 void EnterCombat(Unit* /*who*/) OVERRIDE
84 {
87 events.ScheduleEvent(EVENT_STRIKE, 30000);
88 events.ScheduleEvent(EVENT_SHOUT, 25000);
89 events.ScheduleEvent(EVENT_COMMAND, 40000);
90 events.ScheduleEvent(EVENT_KNIFE, 10000);
91 }
92
94 {
95 if (!UpdateVictim())
96 return;
97
98 events.Update(diff);
99
100 while (uint32 eventId = events.ExecuteEvent())
101 {
102 switch (eventId)
103 {
104 case EVENT_STRIKE:
106 events.ScheduleEvent(EVENT_STRIKE, 30000);
107 return;
108 case EVENT_SHOUT:
110 events.ScheduleEvent(EVENT_SHOUT, 25000);
111 return;
112 case EVENT_KNIFE:
113 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f))
114 DoCast(target, SPELL_JAGGED_KNIFE);
115 events.ScheduleEvent(EVENT_KNIFE, 10000);
116 return;
117 case EVENT_COMMAND:
119 events.ScheduleEvent(EVENT_COMMAND, 40000);
120 return;
121 }
122 }
123
125 }
126 };
127};
128
130{
131 new boss_razuvious();
132}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TYPEID_UNIT
Definition Object.h:54
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ EVENT_NONE
#define SOUND_SLAY
void AddSC_boss_razuvious()
#define SOUND_COMMND
#define SOUND_DEATH
@ SPELL_HOPELESS
@ SPELL_JAGGED_KNIFE
@ SPELL_UNBALANCING_STRIKE
@ SPELL_DISRUPTING_SHOUT
#define SOUND_AGGRO
@ EVENT_KNIFE
@ EVENT_COMMAND
@ EVENT_SHOUT
@ EVENT_STRIKE
@ SPELL_UNBALANCING_STRIKE
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
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_RAZUVIOUS
Definition naxxramas.h:23
Creature * me
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void DamageTaken(Unit *pDone_by, uint32 &uiDamage) OVERRIDE
void EnterCombat(Unit *) OVERRIDE