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)
This commit is contained in:
balrok 2009-09-10 09:53:15 +02:00 committed by balrok
parent d249e9550a
commit 9b7b3b0304
2 changed files with 24 additions and 0 deletions

View file

@ -360,10 +360,24 @@ void BattleGround::Update(uint32 diff)
} }
m_PrematureCountDownTimer = newtime; m_PrematureCountDownTimer = newtime;
} }
} }
else if (m_PrematureCountDown) else if (m_PrematureCountDown)
m_PrematureCountDown = false; 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 ***/ /*** BATTLEGROUND STARTING SYSTEM ***/
/*********************************************************/ /*********************************************************/
@ -1085,6 +1099,11 @@ void BattleGround::Reset()
// door-event2 is always 0 // door-event2 is always 0
m_ActiveEvents[BG_EVENT_DOOR] = 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) if (m_InvitedAlliance > 0 || m_InvitedHorde > 0)
sLog.outError("BattleGround system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde); sLog.outError("BattleGround system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde);

View file

@ -26,6 +26,9 @@
#define BG_EVENT_NONE 255 #define BG_EVENT_NONE 255
// those generic events should get a high event id // those generic events should get a high event id
#define BG_EVENT_DOOR 254 #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; class Creature;
@ -105,6 +108,7 @@ enum BattleGroundTimeIntervals
RESPAWN_ONE_DAY = 86400, // secs RESPAWN_ONE_DAY = 86400, // secs
RESPAWN_IMMEDIATELY = 0, // secs RESPAWN_IMMEDIATELY = 0, // secs
BUFF_RESPAWN_TIME = 180, // secs BUFF_RESPAWN_TIME = 180, // secs
ARENA_SPAWN_BUFF_OBJECTS = 90000, // ms - 90sec after start
}; };
enum BattleGroundStartTimeIntervals enum BattleGroundStartTimeIntervals
@ -589,6 +593,7 @@ class BattleGround
BattleGroundStatus m_Status; BattleGroundStatus m_Status;
uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use
uint32 m_StartTime; 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 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
uint32 m_LastResurrectTime; uint32 m_LastResurrectTime;
BGQueueIdBasedOnLevel m_QueueId; BGQueueIdBasedOnLevel m_QueueId;