Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_mother_smolderweb.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
16
22
24{
25public:
26 boss_mother_smolderweb() : CreatureScript("boss_mother_smolderweb") { }
27
29 {
30 return new boss_mothersmolderwebAI(creature);
31 }
32
34 {
36
38 {
39 _Reset();
40 }
41
42 void EnterCombat(Unit* /*who*/) OVERRIDE
43 {
45 events.ScheduleEvent(EVENT_CRYSTALIZE, 20 * IN_MILLISECONDS);
46 events.ScheduleEvent(EVENT_MOTHERS_MILK, 10 * IN_MILLISECONDS);
47 }
48
49 void JustDied(Unit* /*killer*/) OVERRIDE
50 {
51 _JustDied();
52 }
53
54 void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
55 {
56 if (me->GetHealth() <= damage)
58 }
59
61 {
62 if (!UpdateVictim())
63 return;
64
65 events.Update(diff);
66
67 if (me->HasUnitState(UNIT_STATE_CASTING))
68 return;
69
70 while (uint32 eventId = events.ExecuteEvent())
71 {
72 switch (eventId)
73 {
76 events.ScheduleEvent(EVENT_CRYSTALIZE, 15 * IN_MILLISECONDS);
77 break;
80 events.ScheduleEvent(EVENT_MOTHERS_MILK, std::rand() % 12500 + (5 * IN_MILLISECONDS));
81 break;
82 }
83 }
85 }
86 };
87};
88
@ 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
@ DATA_MOTHER_SMOLDERWEB
void AddSC_boss_mothersmolderweb()
@ SPELL_SUMMON_SPIRE_SPIDERLING
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
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================