Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_amnennar_the_coldbringer.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_Amnennar_the_coldbringer
8SD%Complete: 100
9SDComment:
10SDCategory: Razorfen Downs
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
29
31{
32public:
33 boss_amnennar_the_coldbringer() : CreatureScript("boss_amnennar_the_coldbringer") { }
34
36 {
37 return new boss_amnennar_the_coldbringerAI(creature);
38 }
39
41 {
43
49 bool Hp;
50
52 {
54 FrostBolt_Timer = 1000;
55 FrostNova_Timer = std::rand() % 15000 + 10000;
56 Spectrals30 = false;
57 Spectrals60 = false;
58 Hp = false;
59 }
60
61 void EnterCombat(Unit* /*who*/) OVERRIDE
62 {
64 }
65
66 void KilledUnit(Unit* /*victim*/) OVERRIDE
67 {
69 }
70
72 {
73 if (!UpdateVictim())
74 return;
75
76 //AmnenarsWrath_Timer
77 if (AmnenarsWrath_Timer <= diff)
78 {
80 AmnenarsWrath_Timer = 12000;
81 } else AmnenarsWrath_Timer -= diff;
82
83 //FrostBolt_Timer
84 if (FrostBolt_Timer <= diff)
85 {
87 FrostBolt_Timer = 8000;
88 } else FrostBolt_Timer -= diff;
89
90 if (FrostNova_Timer <= diff)
91 {
93 FrostNova_Timer = 15000;
94 } else FrostNova_Timer -= diff;
95
96 if (!Spectrals60 && HealthBelowPct(60))
97 {
100 Spectrals60 = true;
101 }
102
103 if (!Hp && HealthBelowPct(50))
104 {
105 Talk(SAY_HP);
106 Hp = true;
107 }
108
109 if (!Spectrals30 && HealthBelowPct(30))
110 {
113 Spectrals30 = true;
114 }
115
117 }
118 };
119};
120
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SPELL_FROST_NOVA
void AddSC_boss_amnennar_the_coldbringer()
@ SPELL_FROSTBOLT
#define SAY_AGGRO
#define SAY_KILL
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
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================