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
+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);
}