Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_broodlord_lashlayer.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 "blackwing_lair.h"
9
10enum Say
11{
14};
15
17{
18 SPELL_CLEAVE = 26350,
22};
23
32
34{
35public:
36 boss_broodlord() : CreatureScript("boss_broodlord") { }
37
38 struct boss_broodlordAI : public BossAI
39 {
40 boss_broodlordAI(Creature* creature) : BossAI(creature, BOSS_BROODLORD) { }
41
42 void EnterCombat(Unit* /*who*/) OVERRIDE
43 {
44 if (instance->GetBossState(BOSS_VAELASTRAZ) != DONE)
45 {
47 return;
48 }
49
52
53 events.ScheduleEvent(EVENT_CLEAVE, 8000);
54 events.ScheduleEvent(EVENT_BLASTWAVE, 12000);
55 events.ScheduleEvent(EVENT_MORTALSTRIKE, 20000);
56 events.ScheduleEvent(EVENT_KNOCKBACK, 30000);
57 events.ScheduleEvent(EVENT_CHECK, 1000);
58 }
59
61 {
62 if (!UpdateVictim())
63 return;
64
65 events.Update(diff);
66
67 while (uint32 eventId = events.ExecuteEvent())
68 {
69 switch (eventId)
70 {
71 case EVENT_CLEAVE:
73 events.ScheduleEvent(EVENT_CLEAVE, 7000);
74 break;
75 case EVENT_BLASTWAVE:
77 events.ScheduleEvent(EVENT_BLASTWAVE, std::rand() % 16000 + 8000);
78 break;
81 events.ScheduleEvent(EVENT_MORTALSTRIKE, std::rand() % 35000 + 25000);
82 break;
83 case EVENT_KNOCKBACK:
85 if (DoGetThreat(me->GetVictim()))
86 DoModifyThreatPercent(me->GetVictim(), -50);
87 events.ScheduleEvent(EVENT_KNOCKBACK, std::rand() % 30000 + 15000);
88 break;
89 case EVENT_CHECK:
90 if (me->GetDistance(me->GetHomePosition()) > 150.0f)
91 {
94 }
95 events.ScheduleEvent(EVENT_CHECK, 1000);
96 break;
97 }
98 }
99
101 }
102 };
103
105 {
106 return new boss_broodlordAI(creature);
107 }
108};
109
111{
112 new boss_broodlord();
113}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ DONE
@ SPELL_CLEAVE
@ EVENT_CLEAVE
@ BOSS_BROODLORD
@ BOSS_VAELASTRAZ
void AddSC_boss_broodlord()
#define SAY_AGGRO
InstanceScript *const instance
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
float DoGetThreat(Unit *unit)
void DoModifyThreatPercent(Unit *unit, int32 pct)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================