Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_general_angerforge.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
10{
14};
15
17{
18public:
19 boss_general_angerforge() : CreatureScript("boss_general_angerforge") { }
20
22 {
23 return new boss_general_angerforgeAI(creature);
24 }
25
27 {
29
34 bool Medics;
35
37 {
38 MightyBlow_Timer = 8000;
39 HamString_Timer = 12000;
40 Cleave_Timer = 16000;
41 Adds_Timer = 0;
42 Medics = false;
43 }
44
45 void EnterCombat(Unit* /*who*/) OVERRIDE { }
46
47 void SummonAdds(Unit* victim)
48 {
49 if (Creature* SummonedAdd = DoSpawnCreature(8901, float(std::rand() % 14 + -14), float(std::rand() % 14 + -14), 0, 0, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
50 SummonedAdd->AI()->AttackStart(victim);
51 }
52
53 void SummonMedics(Unit* victim)
54 {
55 if (Creature* SummonedMedic = DoSpawnCreature(8894, float(std::rand() % 9 + -9), float(std::rand() % 9 + -9), 0, 0, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
56 SummonedMedic->AI()->AttackStart(victim);
57 }
58
60 {
61 //Return since we have no target
62 if (!UpdateVictim())
63 return;
64
65 //MightyBlow_Timer
66 if (MightyBlow_Timer <= diff)
67 {
69 MightyBlow_Timer = 18000;
70 } else MightyBlow_Timer -= diff;
71
72 //HamString_Timer
73 if (HamString_Timer <= diff)
74 {
76 HamString_Timer = 15000;
77 } else HamString_Timer -= diff;
78
79 //Cleave_Timer
80 if (Cleave_Timer <= diff)
81 {
83 Cleave_Timer = 9000;
84 } else Cleave_Timer -= diff;
85
86 //Adds_Timer
87 if (HealthBelowPct(21))
88 {
89 if (Adds_Timer <= diff)
90 {
91 // summon 3 Adds every 25s
92 SummonAdds(me->GetVictim());
93 SummonAdds(me->GetVictim());
94 SummonAdds(me->GetVictim());
95
96 Adds_Timer = 25000;
97 } else Adds_Timer -= diff;
98 }
99
100 //Summon Medics
101 if (!Medics && HealthBelowPct(21))
102 {
103 SummonMedics(me->GetVictim());
104 SummonMedics(me->GetVictim());
105 Medics = true;
106 }
107
109 }
110 };
111};
112
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:69
@ SPELL_CLEAVE
@ SPELL_MIGHTYBLOW
void AddSC_boss_general_angerforge()
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
Creature * me
bool HealthBelowPct(uint32 pct) const
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, TempSummonType type, uint32 despawntime)
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================