Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_aku_mai.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 "blackfathom_deeps.h"
9
15
21
23{
24public:
25 boss_aku_mai() : CreatureScript("boss_aku_mai") { }
26
27 struct boss_aku_maiAI : public BossAI
28 {
29 boss_aku_maiAI(Creature* creature) : BossAI(creature, TYPE_AKU_MAI) { }
30
32 {
33 IsEnraged = false;
34 _Reset();
35 }
36
37 void EnterCombat(Unit* /*who*/) OVERRIDE
38 {
39 events.ScheduleEvent(EVENT_POISON_CLOUD, std::rand() % 9000 + 5000);
41 }
42
43 void JustDied(Unit* /*killer*/) OVERRIDE
44 {
45 _JustDied();
46 }
47
49 {
50 if (!UpdateVictim())
51 return;
52
53 events.Update(diff);
54
55 if (!IsEnraged && HealthBelowPct(30))
56 events.ScheduleEvent(EVENT_FRENZIED_RAGE, 100);
57
58 while (uint32 eventId = events.ExecuteEvent())
59 {
60 switch (eventId)
61 {
64 events.ScheduleEvent(EVENT_POISON_CLOUD, std::rand() % 50000 + 25000);
65 break;
68 IsEnraged = true;
69 break;
70 default:
71 break;
72 }
73 }
75 }
76
77 private:
79 };
80
82 {
83 return new boss_aku_maiAI(creature);
84 }
85};
86
88{
89 new boss_aku_mai();
90}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TYPE_AKU_MAI
void AddSC_boss_aku_mai()
@ SPELL_FRENZIED_RAGE
@ SPELL_POISON_CLOUD
@ EVENT_POISON_CLOUD
@ EVENT_FRENZIED_RAGE
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 JustDied(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_aku_maiAI(Creature *creature)