From c1ba5c8587dec1205df4ef9aa308f62532dde6af Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 26 Mar 2012 22:07:22 +0200 Subject: [PATCH] Arenas/Ring of Valor: fire lines should only be lit when the arena battle begins. --- .../Battlegrounds/Zones/BattlegroundRV.cpp | 46 +++++++++---------- .../game/Battlegrounds/Zones/BattlegroundRV.h | 15 +++--- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 98bb704661e0c..6869a8993054f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -32,7 +32,7 @@ BattlegroundRV::BattlegroundRV() StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -46,40 +46,32 @@ BattlegroundRV::~BattlegroundRV() void BattlegroundRV::PostUpdateImpl(uint32 diff) { + if (GetStatus() != STATUS_IN_PROGRESS) + return; + if (getTimer() < diff) { switch (getState()) { case BG_RV_STATE_OPEN_FENCES: - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); + // Open fire (only at game start) + for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) + DoorOpen(i); + setTimer(BG_RV_CLOSE_FIRE_TIMER); setState(BG_RV_STATE_CLOSE_FIRE); break; case BG_RV_STATE_CLOSE_FIRE: for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) DoorClose(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_OPEN_PILARS); + // Fire got closed after five seconds, leaves twenty seconds before toggling pillars + setTimer(BG_RV_FIRE_TO_PILLAR_TIMER); + setState(BG_RV_STATE_SWITCH_PILLARS); break; - case BG_RV_STATE_OPEN_PILARS: + case BG_RV_STATE_SWITCH_PILLARS: for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) DoorOpen(i); - TogglePillarCollision(false); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_OPEN_FIRE); - break; - case BG_RV_STATE_OPEN_FIRE: - // FIXME: after 3.2.0 it's only decorative and should be opened only one time at battle start - for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) - DoorOpen(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_CLOSE_PILARS); - break; - case BG_RV_STATE_CLOSE_PILARS: - for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) - DoorOpen(i); - TogglePillarCollision(true); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_CLOSE_FIRE); + TogglePillarCollision(); + setTimer(BG_RV_PILLAR_SWITCH_TIMER); break; } } @@ -103,7 +95,9 @@ void BattlegroundRV::StartingEventOpenDoors() setState(BG_RV_STATE_OPEN_FENCES); setTimer(BG_RV_FIRST_TIMER); - TogglePillarCollision(true); + // Should be false at first, TogglePillarCollision will do it. + SetPillarCollision(true); + TogglePillarCollision(); } void BattlegroundRV::AddPlayer(Player* player) @@ -227,8 +221,10 @@ bool BattlegroundRV::SetupBattleground() } -void BattlegroundRV::TogglePillarCollision(bool apply) +void BattlegroundRV::TogglePillarCollision() { + bool apply = GetPillarCollision(); + for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PILAR_COLLISION_4; ++i) { if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[i])) @@ -249,4 +245,6 @@ void BattlegroundRV::TogglePillarCollision(bool apply) gob->SendUpdateToPlayer(player); } } + + SetPillarCollision(!apply); } \ No newline at end of file diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 1dfd4825c8f93..8c5746931e302 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -79,12 +79,12 @@ enum BattlegroundRVObjects enum BattlegroundRVData { BG_RV_STATE_OPEN_FENCES, - BG_RV_STATE_OPEN_PILARS, - BG_RV_STATE_CLOSE_PILARS, - BG_RV_STATE_OPEN_FIRE, + BG_RV_STATE_SWITCH_PILLARS, BG_RV_STATE_CLOSE_FIRE, - BG_RV_FIRE_TO_PILAR_TIMER = 20000, - BG_RV_PILAR_TO_FIRE_TIMER = 5000, + + BG_RV_PILLAR_SWITCH_TIMER = 25000, + BG_RV_FIRE_TO_PILLAR_TIMER = 20000, + BG_RV_CLOSE_FIRE_TIMER = 5000, BG_RV_FIRST_TIMER = 20133, BG_RV_WORLD_STATE_A = 0xe10, BG_RV_WORLD_STATE_H = 0xe11, @@ -120,6 +120,7 @@ class BattlegroundRV : public Battleground private: uint32 Timer; uint32 State; + bool PillarCollision; virtual void PostUpdateImpl(uint32 diff); @@ -129,6 +130,8 @@ class BattlegroundRV : public Battleground uint32 getState() { return State; }; void setState(uint32 state) { State = state; }; - void TogglePillarCollision(bool apply); + void TogglePillarCollision(); + bool GetPillarCollision() { return PillarCollision; } + void SetPillarCollision(bool apply) { PillarCollision = apply; } }; #endif