TrinityCore
boss_order_of_silver_hand.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Boss_Silver_Hand_Bosses
20SD%Complete: 40
21SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now)
22SDCategory: Stratholme
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "Player.h"
28#include "ScriptedCreature.h"
29#include "stratholme.h"
30
31/*#####
32# Additional:
33# Although this is a working solution, the correct would be in addition to check if Aurius is dead.
34# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile.
35# Once Aurius is defeated, he should be the one summoning the ghosts.
36#####*/
37
39{
40 SH_GREGOR = 17910,
41 SH_CATHELA = 17911,
42 SH_NEMAS = 17912,
43 SH_AELMAR = 17913,
44 SH_VICAR = 17914,
45 SH_QUEST_CREDIT = 17915
46};
47
49{
52};
53
55{
56public:
57 boss_silver_hand_bosses() : CreatureScript("boss_silver_hand_bosses") { }
58
59 CreatureAI* GetAI(Creature* creature) const override
60 {
61 return GetStratholmeAI<boss_silver_hand_bossesAI>(creature);
62 }
63
65 {
67 {
68 Initialize();
69 instance = creature->GetInstanceScript();
70 }
71
73 {
74 HolyLight_Timer = 20000;
75 DivineShield_Timer = 20000;
76 }
77
79
82
83 void Reset() override
84 {
85 Initialize();
86
87 switch (me->GetEntry())
88 {
89 case SH_AELMAR:
91 break;
92 case SH_CATHELA:
94 break;
95 case SH_GREGOR:
97 break;
98 case SH_NEMAS:
100 break;
101 case SH_VICAR:
103 break;
104 }
105 }
106
107 void JustEngagedWith(Unit* /*who*/) override
108 {
109 }
110
111 void JustDied(Unit* killer) override
112 {
113 switch (me->GetEntry())
114 {
115 case SH_AELMAR:
117 break;
118 case SH_CATHELA:
120 break;
121 case SH_GREGOR:
123 break;
124 case SH_NEMAS:
126 break;
127 case SH_VICAR:
129 break;
130 }
131
132 if (killer && instance->GetData(TYPE_SH_QUEST))
133 {
134 if (Player* player = killer->ToPlayer())
135 player->KilledMonsterCredit(SH_QUEST_CREDIT);
136 }
137 }
138
139 void UpdateAI(uint32 diff) override
140 {
141 //Return since we have no target
142 if (!UpdateVictim())
143 return;
144
145 if (HolyLight_Timer <= diff)
146 {
147 if (HealthBelowPct(20))
148 {
150 HolyLight_Timer = 20000;
151 }
152 } else HolyLight_Timer -= diff;
153
154 if (DivineShield_Timer <= diff)
155 {
156 if (HealthBelowPct(5))
157 {
159 DivineShield_Timer = 40000;
160 }
161 } else DivineShield_Timer -= diff;
162 }
163 };
164};
165
167{
169}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
void AddSC_boss_order_of_silver_hand()
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 GetEntry() const
Definition: Object.h:161
static Player * ToPlayer(Object *o)
Definition: Object.h:213
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
CreatureAI * GetAI(Creature *creature) const override
@ TYPE_SH_CATHELA
Definition: stratholme.h:59
@ TYPE_SH_AELMAR
Definition: stratholme.h:63
@ TYPE_SH_GREGOR
Definition: stratholme.h:60
@ TYPE_SH_NEMAS
Definition: stratholme.h:61
@ TYPE_SH_VICAR
Definition: stratholme.h:62
@ TYPE_SH_QUEST
Definition: stratholme.h:58
bool HealthBelowPct(uint32 pct) const