aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
index 69e84081c8f..8c06fa25d62 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -26,6 +26,7 @@
#define TIMER_TOMBOFTHESEVEN 15000
#define MAX_ENCOUNTER 6
+constexpr uint8 TOMB_OF_SEVEN_BOSS_NUM = 7;
enum Creatures
{
@@ -124,7 +125,7 @@ public:
uint32 BarAleCount;
uint32 GhostKillCount;
- ObjectGuid TombBossGUIDs[7];
+ ObjectGuid TombBossGUIDs[TOMB_OF_SEVEN_BOSS_NUM];
ObjectGuid TombEventStarterGUID;
uint32 TombTimer;
uint32 TombEventCounter;
@@ -170,7 +171,7 @@ public:
case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
case GO_TOMB_EXIT:
GoTombExitGUID = go->GetGUID();
- if (GhostKillCount >= 7)
+ if (GhostKillCount >= TOMB_OF_SEVEN_BOSS_NUM)
HandleGameObject(ObjectGuid::Empty, true, go);
else
HandleGameObject(ObjectGuid::Empty, false, go);
@@ -234,7 +235,7 @@ public:
break;
}
- if (data == DONE || GhostKillCount >= 7)
+ if (data == DONE || GhostKillCount >= TOMB_OF_SEVEN_BOSS_NUM)
{
OUT_SAVE_INST_DATA;
@@ -340,17 +341,17 @@ public:
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (encounter[i] == IN_PROGRESS)
encounter[i] = NOT_STARTED;
- if (GhostKillCount > 0 && GhostKillCount < 7)
+ if (GhostKillCount > 0 && GhostKillCount < TOMB_OF_SEVEN_BOSS_NUM)
GhostKillCount = 0;//reset tomb of seven event
- if (GhostKillCount >= 7)
- GhostKillCount = 7;
+ if (GhostKillCount >= TOMB_OF_SEVEN_BOSS_NUM)
+ GhostKillCount = TOMB_OF_SEVEN_BOSS_NUM;
OUT_LOAD_INST_DATA_COMPLETE;
}
void TombOfSevenEvent()
{
- if (GhostKillCount < 7 && !TombBossGUIDs[TombEventCounter].IsEmpty())
+ if (GhostKillCount < TOMB_OF_SEVEN_BOSS_NUM && !TombBossGUIDs[TombEventCounter].IsEmpty())
{
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
{
@@ -366,7 +367,7 @@ public:
{
HandleGameObject(GoTombExitGUID, false);//event reseted, close exit door
HandleGameObject(GoTombEnterGUID, true);//event reseted, open entrance door
- for (uint8 i = 0; i < 7; ++i)
+ for (uint8 i = 0; i < TOMB_OF_SEVEN_BOSS_NUM; ++i)
{
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
{
@@ -400,15 +401,19 @@ public:
}
void Update(uint32 diff) override
{
- if (!TombEventStarterGUID.IsEmpty() && GhostKillCount < 7)
+ if (!TombEventStarterGUID.IsEmpty() && GhostKillCount < TOMB_OF_SEVEN_BOSS_NUM)
{
if (TombTimer <= diff)
{
TombTimer = TIMER_TOMBOFTHESEVEN;
- ++TombEventCounter;
- TombOfSevenEvent();
+ if (TombEventCounter < TOMB_OF_SEVEN_BOSS_NUM)
+ {
+ TombOfSevenEvent();
+ ++TombEventCounter;
+ }
+
// Check Killed bosses
- for (uint8 i = 0; i < 7; ++i)
+ for (uint8 i = 0; i < TOMB_OF_SEVEN_BOSS_NUM; ++i)
{
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
{
@@ -420,7 +425,7 @@ public:
}
} else TombTimer -= diff;
}
- if (GhostKillCount >= 7 && !TombEventStarterGUID.IsEmpty())
+ if (GhostKillCount >= TOMB_OF_SEVEN_BOSS_NUM && !TombEventStarterGUID.IsEmpty())
TombOfSevenEnd();
}
};