-
Notifications
You must be signed in to change notification settings - Fork 206
/
boss_ebonroc.cpp
123 lines (105 loc) · 3.48 KB
/
boss_ebonroc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ebonroc
SD%Complete: 90
SDComment: Thrash is missing
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#include "blackwing_lair.h"
enum
{
SPELL_SHADOW_FLAME = 22539,
SPELL_WING_BUFFET = 18500,
SPELL_SHADOW_OF_EBONROC = 23340,
SPELL_THRASH = 3391, // TODO missing
};
struct MANGOS_DLL_DECL boss_ebonrocAI : public ScriptedAI
{
boss_ebonrocAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}
ScriptedInstance* m_pInstance;
uint32 m_uiShadowFlameTimer;
uint32 m_uiWingBuffetTimer;
uint32 m_uiShadowOfEbonrocTimer;
void Reset() override
{
m_uiShadowFlameTimer = 15000; // These times are probably wrong
m_uiWingBuffetTimer = 30000;
m_uiShadowOfEbonrocTimer = 45000;
}
void Aggro(Unit* /*pWho*/) override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_EBONROC, IN_PROGRESS);
}
void JustDied(Unit* /*pKiller*/) override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_EBONROC, DONE);
}
void JustReachedHome() override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_EBONROC, FAIL);
}
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
// Shadow Flame Timer
if (m_uiShadowFlameTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_SHADOW_FLAME) == CAST_OK)
m_uiShadowFlameTimer = urand(12000, 15000);
}
else
m_uiShadowFlameTimer -= uiDiff;
// Wing Buffet Timer
if (m_uiWingBuffetTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_WING_BUFFET) == CAST_OK)
m_uiWingBuffetTimer = 25000;
}
else
m_uiWingBuffetTimer -= uiDiff;
// Shadow of Ebonroc Timer
if (m_uiShadowOfEbonrocTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_OF_EBONROC) == CAST_OK)
m_uiShadowOfEbonrocTimer = urand(25000, 35000);
}
else
m_uiShadowOfEbonrocTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_ebonroc(Creature* pCreature)
{
return new boss_ebonrocAI(pCreature);
}
void AddSC_boss_ebonroc()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "boss_ebonroc";
pNewScript->GetAI = &GetAI_boss_ebonroc;
pNewScript->RegisterSelf();
}