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:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
|
using Framework.Dynamic;
|
||||||
using Game.BattleGrounds;
|
using Game.BattleGrounds;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using Game.Guilds;
|
using Game.Guilds;
|
||||||
@@ -26,7 +27,9 @@ using System.Collections.Generic;
|
|||||||
namespace Game.Arenas
|
namespace Game.Arenas
|
||||||
{
|
{
|
||||||
public class Arena : Battleground
|
public class Arena : Battleground
|
||||||
{
|
{
|
||||||
|
protected TaskScheduler taskScheduler = new();
|
||||||
|
|
||||||
public Arena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate)
|
public Arena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate)
|
||||||
{
|
{
|
||||||
StartDelayTimes[BattlegroundConst.EventIdFirst] = BattlegroundStartTimeIntervals.Delay1m;
|
StartDelayTimes[BattlegroundConst.EventIdFirst] = BattlegroundStartTimeIntervals.Delay1m;
|
||||||
|
|||||||
@@ -16,9 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
|
using Game.BattleGrounds;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using Game.Networking.Packets;
|
using Game.Networking.Packets;
|
||||||
using Game.BattleGrounds;
|
using System;
|
||||||
|
|
||||||
namespace Game.Arenas
|
namespace Game.Arenas
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,14 @@ namespace Game.Arenas
|
|||||||
{
|
{
|
||||||
public BladesEdgeArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
public BladesEdgeArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
||||||
|
|
||||||
|
public override void PostUpdateImpl(uint diff)
|
||||||
|
{
|
||||||
|
if (GetStatus() != BattlegroundStatus.InProgress)
|
||||||
|
return;
|
||||||
|
|
||||||
|
taskScheduler.Update(diff);
|
||||||
|
}
|
||||||
|
|
||||||
public override void StartingEventCloseDoors()
|
public override void StartingEventCloseDoors()
|
||||||
{
|
{
|
||||||
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
|
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)
|
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
|
||||||
DoorOpen(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)
|
for (int i = BladeEdgeObjectTypes.Buff1; i <= BladeEdgeObjectTypes.Buff2; ++i)
|
||||||
SpawnBGObject(i, 60);
|
SpawnBGObject(i, 60);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
|
using Game.BattleGrounds;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using Game.Networking.Packets;
|
using Game.Networking.Packets;
|
||||||
using Game.BattleGrounds;
|
using System;
|
||||||
|
|
||||||
namespace Game.Arenas
|
namespace Game.Arenas
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,14 @@ namespace Game.Arenas
|
|||||||
{
|
{
|
||||||
public NagrandArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
public NagrandArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
||||||
|
|
||||||
|
public override void PostUpdateImpl(uint diff)
|
||||||
|
{
|
||||||
|
if (GetStatus() != BattlegroundStatus.InProgress)
|
||||||
|
return;
|
||||||
|
|
||||||
|
taskScheduler.Update(diff);
|
||||||
|
}
|
||||||
|
|
||||||
public override void StartingEventCloseDoors()
|
public override void StartingEventCloseDoors()
|
||||||
{
|
{
|
||||||
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
|
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)
|
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
|
||||||
DoorOpen(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)
|
for (int i = NagrandArenaObjectTypes.Buff1; i <= NagrandArenaObjectTypes.Buff2; ++i)
|
||||||
SpawnBGObject(i, 60);
|
SpawnBGObject(i, 60);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
|
using Game.BattleGrounds;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using Game.Networking.Packets;
|
using Game.Networking.Packets;
|
||||||
using Game.BattleGrounds;
|
using System;
|
||||||
|
|
||||||
namespace Game.Arenas
|
namespace Game.Arenas
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,14 @@ namespace Game.Arenas
|
|||||||
{
|
{
|
||||||
public RuinsofLordaeronArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
public RuinsofLordaeronArena(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate) { }
|
||||||
|
|
||||||
|
public override void PostUpdateImpl(uint diff)
|
||||||
|
{
|
||||||
|
if (GetStatus() != BattlegroundStatus.InProgress)
|
||||||
|
return;
|
||||||
|
|
||||||
|
taskScheduler.Update(diff);
|
||||||
|
}
|
||||||
|
|
||||||
public override bool SetupBattleground()
|
public override bool SetupBattleground()
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
@@ -59,6 +68,12 @@ namespace Game.Arenas
|
|||||||
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
|
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
|
||||||
DoorOpen(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)
|
for (int i = RuinsofLordaeronObjectTypes.Buff1; i <= RuinsofLordaeronObjectTypes.Buff2; ++i)
|
||||||
SpawnBGObject(i, 60);
|
SpawnBGObject(i, 60);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user