Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_postmaster_malown.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/* ScriptData
7SDName: boss_postmaster_malown
8SD%Complete: 50
9SDComment:
10SDCategory: Stratholme
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "stratholme.h"
16
17//Spell ID to summon this guy is 24627 "Summon Postmaster Malown"
18//He should be spawned along with three other elites once the third postbox has been opened
19
20enum Says
21{
23};
24
33
42
44{
45public:
46 boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { }
47
49 {
51
52 void Reset() OVERRIDE { }
53
54 void EnterCombat(Unit* /*who*/) OVERRIDE
55 {
56 events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); // lasts 6 sec
57 events.ScheduleEvent(EVENT_BACKHAND, 8000); // 2 sec stun
58 events.ScheduleEvent(EVENT_CURSEOFWEAKNESS, 20000); // lasts 2 mins
59 events.ScheduleEvent(EVENT_CURSEOFTONGUES, 22000);
60 events.ScheduleEvent(EVENT_CALLOFTHEGRAVE, 25000);
61 }
62
63 void KilledUnit(Unit* /*victim*/) OVERRIDE
64 {
66 }
67
69 {
70 if (!UpdateVictim())
71 return;
72
73 events.Update(diff);
74
75 if (me->HasUnitState(UNIT_STATE_CASTING))
76 return;
77
78 while (uint32 eventId = events.ExecuteEvent())
79 {
80 switch (eventId)
81 {
83 if (rand()%100 < 65) //65% chance to cast
85 events.ScheduleEvent(EVENT_WAILINGDEAD, 19000);
86 break;
87 case EVENT_BACKHAND:
88 if (rand()%100 < 45) //45% chance to cast
90 events.ScheduleEvent(EVENT_WAILINGDEAD, 8000);
91 break;
93 if (rand()%100 < 3) //3% chance to cast
95 events.ScheduleEvent(EVENT_WAILINGDEAD, 20000);
96 break;
98 if (rand()%100 < 3) //3% chance to cast
100 events.ScheduleEvent(EVENT_WAILINGDEAD, 22000);
101 break;
103 if (rand()%100 < 5) //5% chance to cast
105 events.ScheduleEvent(EVENT_WAILINGDEAD, 25000);
106 break;
107 default:
108 break;
109 }
110 }
112 }
113 };
114
116 {
117 return new boss_postmaster_malownAI(creature);
118 }
119};
120
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SPELL_CURSEOFWEAKNESS
@ SPELL_CURSEOFTONGUES
#define SAY_KILL
@ SPELL_CURSEOFWEAKNESS
@ SPELL_CALLOFTHEGRAVE
@ SPELL_CURSEOFTONGUES
void AddSC_boss_postmaster_malown()
@ EVENT_CALLOFTHEGRAVE
@ EVENT_CURSEOFTONGUES
@ EVENT_CURSEOFWEAKNESS
EventMap events
BossAI(Creature *creature, uint32 bossId)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
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
@ TYPE_MALOWN
Definition stratholme.h:18
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================