Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_rage_winterchill.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 "hyjal.h"
9#include "hyjal_trash.h"
10
18
27
29{
30public:
31 boss_rage_winterchill() : CreatureScript("boss_rage_winterchill") { }
32
34 {
35 return new boss_rage_winterchillAI(creature);
36 }
37
39 {
41 {
42 instance = creature->GetInstanceScript();
43 go = false;
44 }
45
50 bool go;
51
53 {
54 damageTaken = 0;
55 FrostArmorTimer = 37000;
56 DecayTimer = 45000;
57 NovaTimer = 15000;
58 IceboltTimer = 10000;
59
60 if (instance && IsEvent)
62 }
63
64 void EnterCombat(Unit* /*who*/) OVERRIDE
65 {
66 if (instance && IsEvent)
69 }
70
71 void KilledUnit(Unit* /*victim*/) OVERRIDE
72 {
74 }
75
77 {
78 if (waypointId == 7 && instance)
79 {
80 Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE));
81 if (target && target->IsAlive())
82 me->AddThreat(target, 0.0f);
83 }
84 }
85
86 void JustDied(Unit* killer) OVERRIDE
87 {
89 if (instance && IsEvent)
92 }
93
95 {
96 if (IsEvent)
97 {
98 //Must update npc_escortAI
100 if (!go)
101 {
102 go = true;
103 if (instance)
104 {
105 AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
106 AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
107 AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
108 AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
109 AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
110 AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
111 AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
112 AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
113 Start(false, true);
114 SetDespawnAtEnd(false);
115 }
116 }
117 }
118
119 //Return since we have no target
120 if (!UpdateVictim())
121 return;
122
123 if (FrostArmorTimer <= diff)
124 {
126 FrostArmorTimer = 40000+rand()%20000;
127 } else FrostArmorTimer -= diff;
128 if (DecayTimer <= diff)
129 {
131 DecayTimer = 60000+rand()%20000;
133 } else DecayTimer -= diff;
134 if (NovaTimer <= diff)
135 {
137 NovaTimer = 30000+rand()%15000;
138 Talk(SAY_NOVA);
139 } else NovaTimer -= diff;
140 if (IceboltTimer <= diff)
141 {
143 IceboltTimer = 11000+rand()%20000;
144 } else IceboltTimer -= diff;
145
147 }
148 };
149};
150
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_FROST_NOVA
@ SAY_ONAGGRO
@ SAY_ONSLAY
@ SAY_ONDEATH
void AddSC_boss_rage_winterchill()
@ SPELL_DEATH_AND_DECAY
@ SPELL_FROST_ARMOR
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
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
bool IsAlive() const
Definition Unit.h:2032
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_RAGEWINTERCHILLEVENT
Definition hyjal.h:25
@ DATA_JAINAPROUDMOORE
Definition hyjal.h:21
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustDied(Unit *)
uint32 damageTaken
Definition hyjal_trash.h:34
InstanceScript * instance
Definition hyjal_trash.h:25
hyjal_trashAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SetDespawnAtEnd(bool despawn)
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 AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)