Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects
Port From (https://github.com/TrinityCore/TrinityCore/commit/073a036d84365dae60a70064eb67e68f0447bd72)
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Game.BattleFields
|
||||
|
||||
public class BattleField : ZoneScript
|
||||
{
|
||||
public BattleField()
|
||||
public BattleField(Map map)
|
||||
{
|
||||
m_IsEnabled = true;
|
||||
m_DefenderTeam = TeamId.Neutral;
|
||||
@@ -47,6 +47,9 @@ namespace Game.BattleFields
|
||||
|
||||
m_LastResurectTimer = 30 * Time.InMilliseconds;
|
||||
|
||||
m_Map = map;
|
||||
m_MapId = map.GetId();
|
||||
|
||||
for (byte i = 0; i < 2; ++i)
|
||||
{
|
||||
m_players[i] = new List<ObjectGuid>();
|
||||
|
||||
@@ -19,11 +19,16 @@ using Framework.Database;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Game.BattleFields
|
||||
{
|
||||
public class BattleFieldManager : Singleton<BattleFieldManager>
|
||||
{
|
||||
static uint[] BattlefieldIdToMapId = { 0, 571, 732 };
|
||||
static uint[] BattlefieldIdToZoneId = { 0, 4197, 5095 }; // imitate World_PVP_Area.db2
|
||||
static uint[] BattlefieldIdToScriptId = { 0, 0, 0 };
|
||||
|
||||
BattleFieldManager() { }
|
||||
|
||||
public void InitBattlefield()
|
||||
@@ -43,20 +48,7 @@ namespace Game.BattleFields
|
||||
continue;
|
||||
}
|
||||
|
||||
uint scriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(1));
|
||||
|
||||
var bf = Global.ScriptMgr.CreateBattlefield(scriptId);
|
||||
if (bf == null)
|
||||
continue;
|
||||
|
||||
if (!bf.SetupBattlefield())
|
||||
{
|
||||
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {typeId} failed.");
|
||||
continue;
|
||||
}
|
||||
|
||||
_battlefieldSet.Add(bf);
|
||||
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {typeId} succeeded.");
|
||||
BattlefieldIdToScriptId[(int)typeId] = Global.ObjectMgr.GetScriptId(result.Read<string>(1));
|
||||
++count;
|
||||
|
||||
} while (result.NextRow());
|
||||
@@ -65,14 +57,44 @@ namespace Game.BattleFields
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {count} battlefields in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
public void CreateBattlefieldsForMap(Map map)
|
||||
{
|
||||
for (uint i = 0; i < (int)BattleFieldTypes.Max; ++i)
|
||||
{
|
||||
if (BattlefieldIdToScriptId[i] == 0)
|
||||
continue;
|
||||
|
||||
if (BattlefieldIdToMapId[i] != map.GetId())
|
||||
continue;
|
||||
|
||||
BattleField bf = Global.ScriptMgr.CreateBattlefield(BattlefieldIdToScriptId[i], map);
|
||||
if (bf == null)
|
||||
continue;
|
||||
|
||||
if (!bf.SetupBattlefield())
|
||||
{
|
||||
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {(BattleFieldTypes)i} on map {map.GetId()} instance id {map.GetInstanceId()} failed.");
|
||||
continue;
|
||||
}
|
||||
|
||||
_battlefieldsByMap.Add(map, bf);
|
||||
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {(BattleFieldTypes)i} on map {map.GetId()} instance id {map.GetInstanceId()} succeeded.");
|
||||
}
|
||||
}
|
||||
|
||||
public void DestroyBattlefieldsForMap(Map map)
|
||||
{
|
||||
_battlefieldsByMap.Remove(map);
|
||||
}
|
||||
|
||||
public void AddZone(uint zoneId, BattleField bf)
|
||||
{
|
||||
_battlefieldMap[zoneId] = bf;
|
||||
_battlefieldsByZone[(bf.GetMap(), zoneId)] = bf;
|
||||
}
|
||||
|
||||
public void HandlePlayerEnterZone(Player player, uint zoneId)
|
||||
{
|
||||
var bf = _battlefieldMap.LookupByKey(zoneId);
|
||||
var bf = _battlefieldsByZone.LookupByKey((player.GetMap(), zoneId));
|
||||
if (bf == null)
|
||||
return;
|
||||
|
||||
@@ -85,7 +107,7 @@ namespace Game.BattleFields
|
||||
|
||||
public void HandlePlayerLeaveZone(Player player, uint zoneId)
|
||||
{
|
||||
var bf = _battlefieldMap.LookupByKey(zoneId);
|
||||
var bf = _battlefieldsByZone.LookupByKey((player.GetMap(), zoneId));
|
||||
if (bf == null)
|
||||
return;
|
||||
|
||||
@@ -97,9 +119,14 @@ namespace Game.BattleFields
|
||||
Log.outDebug(LogFilter.Battlefield, "Player {0} left battlefield id {1}", player.GetGUID().ToString(), bf.GetTypeId());
|
||||
}
|
||||
|
||||
public BattleField GetBattlefieldToZoneId(uint zoneId)
|
||||
public bool IsWorldPvpArea(uint zoneId)
|
||||
{
|
||||
var bf = _battlefieldMap.LookupByKey(zoneId);
|
||||
return BattlefieldIdToZoneId.Contains(zoneId);
|
||||
}
|
||||
|
||||
public BattleField GetBattlefieldToZoneId(Map map, uint zoneId)
|
||||
{
|
||||
var bf = _battlefieldsByZone.LookupByKey((map, zoneId));
|
||||
if (bf == null)
|
||||
{
|
||||
// no handle for this zone, return
|
||||
@@ -112,30 +139,12 @@ namespace Game.BattleFields
|
||||
return bf;
|
||||
}
|
||||
|
||||
public BattleField GetBattlefieldByBattleId(uint battleId)
|
||||
public BattleField GetBattlefieldByBattleId(Map map, uint battleId)
|
||||
{
|
||||
foreach (var bf in _battlefieldSet)
|
||||
{
|
||||
if (bf.GetBattleId() == battleId)
|
||||
return bf;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BattleField GetBattlefieldByQueueId(ulong queueId)
|
||||
{
|
||||
foreach (var bf in _battlefieldSet)
|
||||
if (bf.GetQueueId() == queueId)
|
||||
return bf;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
ZoneScript GetZoneScript(uint zoneId)
|
||||
{
|
||||
var bf = _battlefieldMap.LookupByKey(zoneId);
|
||||
if (bf != null)
|
||||
return bf;
|
||||
var battlefields = _battlefieldsByMap.LookupByKey(map);
|
||||
foreach (var battlefield in battlefields)
|
||||
if (battlefield.GetBattleId() == battleId)
|
||||
return battlefield;
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -145,19 +154,20 @@ namespace Game.BattleFields
|
||||
_updateTimer += diff;
|
||||
if (_updateTimer > 1000)
|
||||
{
|
||||
foreach (var bf in _battlefieldSet)
|
||||
if (bf.IsEnabled())
|
||||
bf.Update(_updateTimer);
|
||||
foreach (var (map, battlefield) in _battlefieldsByMap)
|
||||
if (battlefield.IsEnabled())
|
||||
battlefield.Update(_updateTimer);
|
||||
|
||||
_updateTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// contains all initiated battlefield events
|
||||
// used when initing / cleaning up
|
||||
List<BattleField> _battlefieldSet = new();
|
||||
MultiMap<Map, BattleField> _battlefieldsByMap = new();
|
||||
// maps the zone ids to an battlefield event
|
||||
// used in player event handling
|
||||
Dictionary<uint, BattleField> _battlefieldMap = new();
|
||||
Dictionary<(Map map, uint zoneId), BattleField> _battlefieldsByZone = new();
|
||||
// update interval
|
||||
uint _updateTimer;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Game.Chat
|
||||
[Command("enable", RBACPermissions.CommandBfEnable)]
|
||||
static bool HandleBattlefieldEnable(CommandHandler handler, uint battleId)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(battleId);
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(handler.GetPlayer().GetMap(), battleId);
|
||||
if (bf == null)
|
||||
return false;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Game.Chat
|
||||
[Command("start", RBACPermissions.CommandBfStart)]
|
||||
static bool HandleBattlefieldStart(CommandHandler handler, uint battleId)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(battleId);
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(handler.GetPlayer().GetMap(), battleId);
|
||||
if (bf == null)
|
||||
return false;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Game.Chat
|
||||
[Command("stop", RBACPermissions.CommandBfStop)]
|
||||
static bool HandleBattlefieldEnd(CommandHandler handler, uint battleId)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(battleId);
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(handler.GetPlayer().GetMap(), battleId);
|
||||
if (bf == null)
|
||||
return false;
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Game.Chat
|
||||
[Command("switch", RBACPermissions.CommandBfSwitch)]
|
||||
static bool HandleBattlefieldSwitch(CommandHandler handler, uint battleId)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(battleId);
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(handler.GetPlayer().GetMap(), battleId);
|
||||
if (bf == null)
|
||||
return false;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Game.Chat
|
||||
[Command("timer", RBACPermissions.CommandBfTimer)]
|
||||
static bool HandleBattlefieldTimer(CommandHandler handler, uint battleId, uint time)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(battleId);
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByBattleId(handler.GetPlayer().GetMap(), battleId);
|
||||
if (bf == null)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ namespace Game.Chat
|
||||
nearestLoc = bg.GetClosestGraveYard(player);
|
||||
else
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
|
||||
if (bf != null)
|
||||
nearestLoc = bf.GetClosestGraveYard(player);
|
||||
else
|
||||
|
||||
@@ -1434,7 +1434,7 @@ namespace Game.Entities
|
||||
return (ZoneScript)instanceMap.GetInstanceScript();
|
||||
else if (!map.IsBattlegroundOrArena())
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(map, GetZoneId());
|
||||
if (bf != null)
|
||||
return bf;
|
||||
else
|
||||
|
||||
@@ -374,7 +374,7 @@ namespace Game.Entities
|
||||
if (area.HasFlag(AreaFlags.Arena))
|
||||
return true;
|
||||
|
||||
if (Global.BattleFieldMgr.GetBattlefieldToZoneId(area.Id) != null)
|
||||
if (Global.BattleFieldMgr.IsWorldPvpArea(area.Id))
|
||||
return true;
|
||||
|
||||
area = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
|
||||
|
||||
@@ -4018,7 +4018,7 @@ namespace Game.Entities
|
||||
ClosestGrave = bg.GetClosestGraveYard(this);
|
||||
else
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetMap(), GetZoneId());
|
||||
if (bf != null)
|
||||
ClosestGrave = bf.GetClosestGraveYard(this);
|
||||
else
|
||||
|
||||
@@ -967,7 +967,7 @@ namespace Game.Entities
|
||||
if (pvp != null)
|
||||
pvp.HandleKill(player, victim);
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
|
||||
if (bf != null)
|
||||
bf.HandleKill(player, victim);
|
||||
}
|
||||
|
||||
@@ -643,7 +643,7 @@ namespace Game
|
||||
if (bg != null)
|
||||
Global.BattlegroundMgr.SendAreaSpiritHealerQuery(GetPlayer(), bg, areaSpiritHealerQuery.HealerGuid);
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetMap(), GetPlayer().GetZoneId());
|
||||
if (bf != null)
|
||||
bf.SendAreaSpiritHealerQuery(GetPlayer(), areaSpiritHealerQuery.HealerGuid);
|
||||
}
|
||||
@@ -662,7 +662,7 @@ namespace Game
|
||||
if (bg)
|
||||
bg.AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, GetPlayer().GetGUID());
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetMap(), GetPlayer().GetZoneId());
|
||||
if (bf != null)
|
||||
bf.AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, GetPlayer().GetGUID());
|
||||
}
|
||||
@@ -673,7 +673,7 @@ namespace Game
|
||||
if (GetPlayer().IsInFlight())
|
||||
return;
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(GetPlayer().GetMap(), GetPlayer().GetZoneId());
|
||||
if (bf != null)
|
||||
{
|
||||
bf.PlayerAskToLeave(_player);
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace Game.Maps
|
||||
_worldStateValues = Global.WorldStateMgr.GetInitialWorldStatesForMap(this);
|
||||
|
||||
Global.OutdoorPvPMgr.CreateOutdoorPvPForMap(this);
|
||||
Global.BattleFieldMgr.CreateBattlefieldsForMap(this);
|
||||
|
||||
Global.ScriptMgr.OnCreateMap(this);
|
||||
}
|
||||
@@ -114,6 +115,7 @@ namespace Game.Maps
|
||||
Global.MapMgr.DecreaseScheduledScriptCount((uint)m_scriptSchedule.Count);
|
||||
|
||||
Global.OutdoorPvPMgr.DestroyOutdoorPvPForMap(this);
|
||||
Global.BattleFieldMgr.DestroyBattlefieldsForMap(this);
|
||||
|
||||
if (m_parentMap == this)
|
||||
m_childTerrainMaps = null;
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace Game.Scripting
|
||||
|
||||
public override bool IsDatabaseBound() { return true; }
|
||||
|
||||
public virtual BattleField GetBattlefield() { return null; }
|
||||
public virtual BattleField GetBattlefield(Map map) { return null; }
|
||||
}
|
||||
|
||||
public class BattlegroundScript : ScriptObject
|
||||
|
||||
@@ -715,9 +715,9 @@ namespace Game.Scripting
|
||||
}
|
||||
|
||||
//BattlefieldScript
|
||||
public BattleField CreateBattlefield(uint scriptId)
|
||||
public BattleField CreateBattlefield(uint scriptId, Map map)
|
||||
{
|
||||
return RunScriptRet<BattlefieldScript, BattleField>(p => p.GetBattlefield(), scriptId, null);
|
||||
return RunScriptRet<BattlefieldScript, BattleField>(p => p.GetBattlefield(map), scriptId, null);
|
||||
}
|
||||
|
||||
//BattlegroundScript
|
||||
|
||||
@@ -4275,7 +4275,7 @@ namespace Game.Spells
|
||||
Battleground bg = target.ToPlayer().GetBattleground();
|
||||
if (bg)
|
||||
bg.RemovePlayerFromResurrectQueue(target.GetGUID());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(target.GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(target.GetMap(), target.GetZoneId());
|
||||
if (bf != null)
|
||||
bf.RemovePlayerFromResurrectQueue(target.GetGUID());
|
||||
}
|
||||
|
||||
@@ -5731,7 +5731,7 @@ namespace Game.Spells
|
||||
// allow always ghost flight spells
|
||||
if (m_originalCaster != null && m_originalCaster.IsTypeId(TypeId.Player) && m_originalCaster.IsAlive())
|
||||
{
|
||||
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(m_originalCaster.GetZoneId());
|
||||
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(m_originalCaster.GetMap(), m_originalCaster.GetZoneId());
|
||||
var area = CliDB.AreaTableStorage.LookupByKey(m_originalCaster.GetAreaId());
|
||||
if (area != null)
|
||||
if (area.HasFlag(AreaFlags.NoFlyZone) || (Bf != null && !Bf.CanFlyIn()))
|
||||
|
||||
@@ -4922,7 +4922,7 @@ namespace Game.Entities
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetZoneId());
|
||||
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
|
||||
if (Bf == null || Bf.CanFlyIn() || (!player.HasAuraType(AuraType.ModIncreaseMountedFlightSpeed) && !player.HasAuraType(AuraType.Fly)))
|
||||
return false;
|
||||
break;
|
||||
@@ -4933,7 +4933,7 @@ namespace Game.Entities
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
|
||||
|
||||
if (bf == null || bf.GetTypeId() != (int)BattleFieldTypes.WinterGrasp)
|
||||
return false;
|
||||
@@ -4953,7 +4953,7 @@ namespace Game.Entities
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
BattleField battlefieldWG = Global.BattleFieldMgr.GetBattlefieldByBattleId(1);
|
||||
BattleField battlefieldWG = Global.BattleFieldMgr.GetBattlefieldByBattleId(player.GetMap(), 1);
|
||||
if (battlefieldWG != null)
|
||||
return battlefieldWG.IsEnabled() && (player.GetTeamId() == battlefieldWG.GetDefenderTeam()) && !battlefieldWG.IsWarTime();
|
||||
break;
|
||||
@@ -4963,7 +4963,7 @@ namespace Game.Entities
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetZoneId());
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
|
||||
if (bf != null)
|
||||
return bf.IsWarTime();
|
||||
break;
|
||||
|
||||
@@ -16,25 +16,25 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
using Game.Scripting;
|
||||
using Game.AI;
|
||||
|
||||
namespace Game.BattleFields
|
||||
{
|
||||
class BattlefieldWG : BattleField
|
||||
{
|
||||
public BattlefieldWG(Map map) : base(map) { }
|
||||
|
||||
public override bool SetupBattlefield()
|
||||
{
|
||||
m_TypeId = (uint)BattleFieldTypes.WinterGrasp; // See enum BattlefieldTypes
|
||||
m_BattleId = BattlefieldIds.WG;
|
||||
m_ZoneId = (uint)AreaId.Wintergrasp;
|
||||
m_MapId = WGConst.MapId;
|
||||
m_Map = Global.MapMgr.CreateBaseMap(m_MapId);
|
||||
|
||||
InitStalker(WGNpcs.Stalker, WGConst.WintergraspStalkerPos);
|
||||
|
||||
@@ -1149,6 +1149,26 @@ namespace Game.BattleFields
|
||||
}
|
||||
|
||||
_state = (WGGameObjectState)Global.WorldStateMgr.GetValue((int)_worldState, _wg.GetMap());
|
||||
if (_state == WGGameObjectState.None)
|
||||
{
|
||||
// set to default state based on type
|
||||
switch (_teamControl)
|
||||
{
|
||||
case TeamId.Alliance:
|
||||
_state = WGGameObjectState.AllianceIntact;
|
||||
break;
|
||||
case TeamId.Horde:
|
||||
_state = WGGameObjectState.HordeIntact;
|
||||
break;
|
||||
case TeamId.Neutral:
|
||||
_state = WGGameObjectState.NeutralIntact;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Global.WorldStateMgr.SetValueAndSaveInDb((int)_worldState, (int)_state, false, _wg.GetMap());
|
||||
}
|
||||
|
||||
switch (_state)
|
||||
{
|
||||
case WGGameObjectState.NeutralIntact:
|
||||
@@ -1556,9 +1576,9 @@ namespace Game.BattleFields
|
||||
{
|
||||
public Battlefield_wintergrasp() : base("battlefield_wg") { }
|
||||
|
||||
public override BattleField GetBattlefield()
|
||||
public override BattleField GetBattlefield(Map map)
|
||||
{
|
||||
return new BattlefieldWG();
|
||||
return new BattlefieldWG(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1572,7 +1592,7 @@ namespace Game.BattleFields
|
||||
if (!killer || !killer.IsPlayer())
|
||||
return;
|
||||
|
||||
BattlefieldWG wintergrasp = (BattlefieldWG)Global.BattleFieldMgr.GetBattlefieldByBattleId(BattlefieldIds.WG);
|
||||
BattlefieldWG wintergrasp = (BattlefieldWG)Global.BattleFieldMgr.GetBattlefieldByBattleId(killer.GetMap(), BattlefieldIds.WG);
|
||||
if (wintergrasp == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user