Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_order_of_silver_hand.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_Silver_Hand_Bosses
8SD%Complete: 40
9SDComment: 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)
10SDCategory: Stratholme
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "stratholme.h"
16#include "Player.h"
17
18/*#####
19# Additional:
20# Although this is a working solution, the correct would be in addition to check if Aurius is dead.
21# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile.
22# Once Aurius is defeated, he should be the one summoning the ghosts.
23#####*/
24
26{
27 SH_GREGOR = 17910,
28 SH_CATHELA = 17911,
29 SH_NEMAS = 17912,
30 SH_AELMAR = 17913,
31 SH_VICAR = 17914,
33};
34
36{
39};
40
42{
43public:
44 boss_silver_hand_bosses() : CreatureScript("boss_silver_hand_bosses") { }
45
47 {
48 return new boss_silver_hand_bossesAI(creature);
49 }
50
52 {
54 {
55 instance = creature->GetInstanceScript();
56 }
57
59
62
64 {
65 HolyLight_Timer = 20000;
66 DivineShield_Timer = 20000;
67
68 if (instance)
69 {
70 switch (me->GetEntry())
71 {
72 case SH_AELMAR:
73 instance->SetData(TYPE_SH_AELMAR, 0);
74 break;
75 case SH_CATHELA:
76 instance->SetData(TYPE_SH_CATHELA, 0);
77 break;
78 case SH_GREGOR:
79 instance->SetData(TYPE_SH_GREGOR, 0);
80 break;
81 case SH_NEMAS:
82 instance->SetData(TYPE_SH_NEMAS, 0);
83 break;
84 case SH_VICAR:
85 instance->SetData(TYPE_SH_VICAR, 0);
86 break;
87 }
88 }
89 }
90
91 void EnterCombat(Unit* /*who*/) OVERRIDE
92 {
93 }
94
95 void JustDied(Unit* killer) OVERRIDE
96 {
97 if (!instance)
98 return;
99
100 switch (me->GetEntry())
101 {
102 case SH_AELMAR:
103 instance->SetData(TYPE_SH_AELMAR, 2);
104 break;
105 case SH_CATHELA:
106 instance->SetData(TYPE_SH_CATHELA, 2);
107 break;
108 case SH_GREGOR:
109 instance->SetData(TYPE_SH_GREGOR, 2);
110 break;
111 case SH_NEMAS:
112 instance->SetData(TYPE_SH_NEMAS, 2);
113 break;
114 case SH_VICAR:
115 instance->SetData(TYPE_SH_VICAR, 2);
116 break;
117 }
118
119 if (instance->GetData(TYPE_SH_QUEST))
120 {
121 if (Player* player = killer->ToPlayer())
122 player->KilledMonsterCredit(SH_QUEST_CREDIT, 0);
123 }
124 }
125
127 {
128 //Return since we have no target
129 if (!UpdateVictim())
130 return;
131
132 if (HolyLight_Timer <= diff)
133 {
134 if (HealthBelowPct(20))
135 {
137 HolyLight_Timer = 20000;
138 }
139 } else HolyLight_Timer -= diff;
140
141 if (DivineShield_Timer <= diff)
142 {
143 if (HealthBelowPct(5))
144 {
146 DivineShield_Timer = 40000;
147 }
148 } else DivineShield_Timer -= diff;
149
151 }
152 };
153};
154
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
void AddSC_boss_order_of_silver_hand()
bool UpdateVictim()
CreatureScript(const char *name)
Player * ToPlayer()
Definition Object.h:204
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ TYPE_SH_CATHELA
Definition stratholme.h:24
@ TYPE_SH_AELMAR
Definition stratholme.h:28
@ TYPE_SH_GREGOR
Definition stratholme.h:25
@ TYPE_SH_NEMAS
Definition stratholme.h:26
@ TYPE_SH_VICAR
Definition stratholme.h:27
@ TYPE_SH_QUEST
Definition stratholme.h:23
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================