From 9b7b3b03048bd9bfb447e3e238faf88094cf9c1f Mon Sep 17 00:00:00 2001 From: balrok Date: Thu, 10 Sep 2009 09:53:15 +0200 Subject: [PATCH] corrected spawning of buffobjects in arena they are spawned in all arenas 60 seconds after start so i implemented this function in BattleGround.cpp maybe we should use BattleGroundAA for such things then we also can drop all arena-files, cause all arenas are working in the same way (at least those which are currently implemented) --- src/game/BattleGround.cpp | 19 +++++++++++++++++++ src/game/BattleGround.h | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 245c3a696..49ae49e45 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -360,10 +360,24 @@ void BattleGround::Update(uint32 diff) } m_PrematureCountDownTimer = newtime; } + } else if (m_PrematureCountDown) m_PrematureCountDown = false; + /*********************************************************/ + /*** ARENA BUFF OBJECT SPAWNING ***/ + /*********************************************************/ + if (isArena() && !m_ArenaBuffSpawned) + { + // 60 seconds after start the buffobjects in arena should get spawned + if (m_StartTime > uint32(m_StartDelayTimes[BG_STARTING_EVENT_FIRST] + ARENA_SPAWN_BUFF_OBJECTS)) + { + SpawnEvent(ARENA_BUFF_EVENT, 0, true); + m_ArenaBuffSpawned = true; + } + } + /*********************************************************/ /*** BATTLEGROUND STARTING SYSTEM ***/ /*********************************************************/ @@ -1085,6 +1099,11 @@ void BattleGround::Reset() // door-event2 is always 0 m_ActiveEvents[BG_EVENT_DOOR] = 0; + if (isArena()) + { + m_ActiveEvents[ARENA_BUFF_EVENT] = BG_EVENT_NONE; + m_ArenaBuffSpawned = false; + } if (m_InvitedAlliance > 0 || m_InvitedHorde > 0) sLog.outError("BattleGround system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde); diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index a16d4243e..1239cbae0 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -26,6 +26,9 @@ #define BG_EVENT_NONE 255 // those generic events should get a high event id #define BG_EVENT_DOOR 254 +// only arena event +// cause this buff apears 90sec after start in every bg i implement it here +#define ARENA_BUFF_EVENT 252 class Creature; @@ -105,6 +108,7 @@ enum BattleGroundTimeIntervals RESPAWN_ONE_DAY = 86400, // secs RESPAWN_IMMEDIATELY = 0, // secs BUFF_RESPAWN_TIME = 180, // secs + ARENA_SPAWN_BUFF_OBJECTS = 90000, // ms - 90sec after start }; enum BattleGroundStartTimeIntervals @@ -589,6 +593,7 @@ class BattleGround BattleGroundStatus m_Status; uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; + bool m_ArenaBuffSpawned; // to cache if arenabuff event is started (cause bool is faster than checking IsActiveEvent) int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself uint32 m_LastResurrectTime; BGQueueIdBasedOnLevel m_QueueId;