Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_herod.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_Herod
8SD%Complete: 95
9SDComment: Should in addition spawn Myrmidons in the hallway outside
10SDCategory: Scarlet Monastery
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "ScriptedEscortAI.h"
16
25
33
39
41{
42public:
43 boss_herod() : CreatureScript("boss_herod") { }
44
46 {
47 return new boss_herodAI(creature);
48 }
49
50 struct boss_herodAI : public ScriptedAI
51 {
52 boss_herodAI(Creature* creature) : ScriptedAI(creature) { }
53
54 bool Enrage;
55
58
60 {
61 Enrage = false;
62 Cleave_Timer = 12000;
63 Whirlwind_Timer = 60000;
64 }
65
66 void EnterCombat(Unit* /*who*/) OVERRIDE
67 {
70 }
71
72 void KilledUnit(Unit* /*victim*/) OVERRIDE
73 {
75 }
76
77 void JustDied(Unit* /*killer*/) OVERRIDE
78 {
79 for (uint8 i = 0; i < 20; ++i)
80 me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18f, -431.58f, 17.09f, 6.22f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
81 }
82
84 {
85 if (!UpdateVictim())
86 return;
87
88 //If we are <30% hp goes Enraged
89 if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCasted(false))
90 {
94 Enrage = true;
95 }
96
97 //Cleave_Timer
98 if (Cleave_Timer <= diff)
99 {
101 Cleave_Timer = 12000;
102 }
103 else Cleave_Timer -= diff;
104
105 // Whirlwind_Timer
106 if (Whirlwind_Timer <= diff)
107 {
110 Whirlwind_Timer = 30000;
111 }
112 else Whirlwind_Timer -= diff;
113
115 }
116 };
117};
118
120{
121public:
122 npc_scarlet_trainee() : CreatureScript("npc_scarlet_trainee") { }
123
125 {
126 return new npc_scarlet_traineeAI(creature);
127 }
128
130 {
132 {
133 Start_Timer = urand(1000, 6000);
134 }
135
137
138 void Reset() OVERRIDE { }
139 void WaypointReached(uint32 /*waypointId*/) OVERRIDE { }
140 void EnterCombat(Unit* /*who*/) OVERRIDE { }
141
143 {
144 if (Start_Timer)
145 {
146 if (Start_Timer <= diff)
147 {
148 Start(true, true);
149 Start_Timer = 0;
150 } else Start_Timer -= diff;
151 }
152
154 }
155 };
156};
157
159{
160 new boss_herod();
162}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
static constexpr TempSummonType TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
@ SPELL_CLEAVE
@ SPELL_WHIRLWIND
#define SAY_AGGRO
#define SAY_KILL
@ SAY_ENRAGE
@ SPELL_FRENZY
@ SAY_WHIRLWIND
@ SAY_AGGRO
@ SAY_KILL
@ EMOTE_ENRAGE
@ SAY_ENRAGE
@ SPELL_RUSHINGCHARGE
@ SPELL_CLEAVE
@ SPELL_FRENZY
@ SPELL_WHIRLWIND
@ ENTRY_SCARLET_MYRMIDON
@ ENTRY_SCARLET_TRAINEE
void AddSC_boss_herod()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void Reset() OVERRIDE
void EnterCombat(Unit *) OVERRIDE
boss_herodAI(Creature *creature)
void JustDied(Unit *) OVERRIDE
void KilledUnit(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_escortAI(Creature *creature)
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================