Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_eck.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 "gundrak.h"
9
11{
12 SPELL_ECK_BERSERK = 55816, //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
13 SPELL_ECK_BITE = 55813, //Eck bites down hard, inflicting 150% of his normal damage to an enemy.
14 SPELL_ECK_SPIT = 55814, //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
15 SPELL_ECK_SPRING_1 = 55815, //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
16 SPELL_ECK_SPRING_2 = 55837 //Eck leaps at a distant target.
17};
18
19static Position EckSpawnPoint = { 1643.877930f, 936.278015f, 107.204948f, 0.668432f };
20
22{
23public:
24 boss_eck() : CreatureScript("boss_eck") { }
25
27 {
28 return new boss_eckAI(creature);
29 }
30
31 struct boss_eckAI : public ScriptedAI
32 {
33 boss_eckAI(Creature* creature) : ScriptedAI(creature)
34 {
35 instance = creature->GetInstanceScript();
36 }
37
42
44
46
48 {
49 uiBerserkTimer = std::rand() % (90 * IN_MILLISECONDS) + (60 * IN_MILLISECONDS); //60-90 secs according to wowwiki
53
54 bBerserk = false;
55
56 if (instance)
58 }
59
60 void EnterCombat(Unit* /*who*/) OVERRIDE
61 {
62 if (instance)
64 }
65
67 {
68 //Return since we have no target
69 if (!UpdateVictim())
70 return;
71
72 if (uiBiteTimer <= diff)
73 {
75 uiBiteTimer = std::rand() % (12 * IN_MILLISECONDS) + (8 * IN_MILLISECONDS);
76 } else uiBiteTimer -= diff;
77
78 if (uiSpitTimer <= diff)
79 {
81 uiSpitTimer = std::rand() % (14 * IN_MILLISECONDS) + (6*IN_MILLISECONDS);
82 } else uiSpitTimer -= diff;
83
84 if (uiSpringTimer <= diff)
85 {
87 if (target && target->GetTypeId() == TypeID::TYPEID_PLAYER)
88 {
90 uiSpringTimer = std::rand() % (10 * IN_MILLISECONDS) + (5 * IN_MILLISECONDS);
91 }
92 } else uiSpringTimer -= diff;
93
94 //Berserk on timer or 20% of health
95 if (!bBerserk)
96 {
97 if (uiBerserkTimer <= diff)
98 {
100 bBerserk = true;
101 }
102 else
103 {
104 uiBerserkTimer -= diff;
105 if (HealthBelowPct(20))
106 {
108 bBerserk = true;
109 }
110 }
111 }
112
114 }
115
116 void JustDied(Unit* /*killer*/) OVERRIDE
117 {
118 if (instance)
120 }
121 };
122};
123
125{
126public:
127 npc_ruins_dweller() : CreatureScript("npc_ruins_dweller") { }
128
130 {
131 return new npc_ruins_dwellerAI(creature);
132 }
133
135 {
137 {
138 instance = creature->GetInstanceScript();
139 }
140
142
143 void JustDied(Unit* /*killer*/) OVERRIDE
144 {
145 if (instance)
146 {
147 instance->SetData64(DATA_RUIN_DWELLER_DIED, me->GetGUID());
148 if (instance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0)
150 }
151 }
152 };
153};
154
156{
157 new boss_eck();
158 new npc_ruins_dweller();
159}
@ IN_MILLISECONDS
Definition Common.h:125
const T & RAND(const T &v1, const T &v2)
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:73
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
void AddSC_boss_eck()
Definition boss_eck.cpp:155
static Position EckSpawnPoint
Definition boss_eck.cpp:19
@ SPELL_ECK_BITE
Definition boss_eck.cpp:13
@ SPELL_ECK_SPRING_1
Definition boss_eck.cpp:15
@ SPELL_ECK_SPRING_2
Definition boss_eck.cpp:16
@ SPELL_ECK_BERSERK
Definition boss_eck.cpp:12
@ SPELL_ECK_SPIT
Definition boss_eck.cpp:14
bool UpdateVictim()
CreatureScript(const char *name)
TypeID GetTypeId() const
Definition Object.h:131
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
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition boss_eck.cpp:26
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition boss_eck.cpp:129
@ DATA_RUIN_DWELLER_DIED
Definition gundrak.h:28
@ CREATURE_ECK
Definition gundrak.h:39
@ DATA_ECK_THE_FEROCIOUS_EVENT
Definition gundrak.h:15
@ DATA_ALIVE_RUIN_DWELLERS
Definition gundrak.h:16
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition boss_eck.cpp:66
void EnterCombat(Unit *) OVERRIDE
Definition boss_eck.cpp:60
void Reset() OVERRIDE
Definition boss_eck.cpp:47
boss_eckAI(Creature *creature)
Definition boss_eck.cpp:33
InstanceScript * instance
Definition boss_eck.cpp:45
void JustDied(Unit *) OVERRIDE
Definition boss_eck.cpp:116
npc_ruins_dwellerAI(Creature *creature)
Definition boss_eck.cpp:136