Core/Arenas: Remove doors in RL, NA and BE when arena has begun

Port From (https://github.com/TrinityCore/TrinityCore/commit/46c0f0d8fe9c9880b7e8cf12b589b06aa757fc80)
This commit is contained in:
hondacrx
2022-01-01 17:52:36 -05:00
parent 7c14a1754a
commit f564667466
4 changed files with 52 additions and 4 deletions
+4 -1
View File
@@ -16,6 +16,7 @@
*/
using Framework.Constants;
using Framework.Dynamic;
using Game.BattleGrounds;
using Game.Entities;
using Game.Guilds;
@@ -26,7 +27,9 @@ using System.Collections.Generic;
namespace Game.Arenas
{
public class Arena : Battleground
{
{
protected TaskScheduler taskScheduler = new();
public Arena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate)
{
StartDelayTimes[BattlegroundConst.EventIdFirst] = BattlegroundStartTimeIntervals.Delay1m;
+16 -1
View File
@@ -16,9 +16,10 @@
*/
using Framework.Constants;
using Game.BattleGrounds;
using Game.Entities;
using Game.Networking.Packets;
using Game.BattleGrounds;
using System;
namespace Game.Arenas
{
@@ -26,6 +27,14 @@ namespace Game.Arenas
{
public BladesEdgeArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
public override void PostUpdateImpl(uint diff)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
taskScheduler.Update(diff);
}
public override void StartingEventCloseDoors()
{
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
@@ -40,6 +49,12 @@ namespace Game.Arenas
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
DoorOpen(i);
taskScheduler.Schedule(TimeSpan.FromSeconds(5), task =>
{
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door2; ++i)
DelObject(i);
});
for (int i = BladeEdgeObjectTypes.Buff1; i <= BladeEdgeObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}
+16 -1
View File
@@ -16,9 +16,10 @@
*/
using Framework.Constants;
using Game.BattleGrounds;
using Game.Entities;
using Game.Networking.Packets;
using Game.BattleGrounds;
using System;
namespace Game.Arenas
{
@@ -26,6 +27,14 @@ namespace Game.Arenas
{
public NagrandArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
public override void PostUpdateImpl(uint diff)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
taskScheduler.Update(diff);
}
public override void StartingEventCloseDoors()
{
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
@@ -37,6 +46,12 @@ namespace Game.Arenas
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
DoorOpen(i);
taskScheduler.Schedule(TimeSpan.FromSeconds(5), task =>
{
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door2; ++i)
DelObject(i);
});
for (int i = NagrandArenaObjectTypes.Buff1; i <= NagrandArenaObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}
+16 -1
View File
@@ -16,9 +16,10 @@
*/
using Framework.Constants;
using Game.BattleGrounds;
using Game.Entities;
using Game.Networking.Packets;
using Game.BattleGrounds;
using System;
namespace Game.Arenas
{
@@ -26,6 +27,14 @@ namespace Game.Arenas
{
public RuinsofLordaeronArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
public override void PostUpdateImpl(uint diff)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
taskScheduler.Update(diff);
}
public override bool SetupBattleground()
{
bool result = true;
@@ -59,6 +68,12 @@ namespace Game.Arenas
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
DoorOpen(i);
taskScheduler.Schedule(TimeSpan.FromSeconds(5), task =>
{
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
DelObject(i);
});
for (int i = RuinsofLordaeronObjectTypes.Buff1; i <= RuinsofLordaeronObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}