From 90e0eb7a94a46f7218bebad5b8aac82fc3658e5c Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 20 Apr 2021 23:17:09 +0000 Subject: [PATCH] Store olympiad stadium id. --- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- .../model/olympiad/OlympiadStadium.java | 15 ++++++++++----- 19 files changed, 190 insertions(+), 95 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java index add4d7bb59..7cfac36fe3 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java @@ -43,14 +43,17 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class OlympiadStadium { private static final Logger LOGGER = Logger.getLogger(OlympiadStadium.class.getName()); + private final OlympiadStadiumZone _zone; + private final int _stadiumId; private final Instance _instance; private final List _buffers; private OlympiadGameTask _task = null; - protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadium) + protected OlympiadStadium(OlympiadStadiumZone olyzone, int stadiumId) { _zone = olyzone; + _stadiumId = stadiumId; _instance = InstanceManager.getInstance().createInstance(olyzone.getInstanceTemplateId(), null); _buffers = _instance.getNpcs().stream().map(Npc::getSpawn).collect(Collectors.toList()); _buffers.stream().map(Spawn::getLastSpawn).forEach(Npc::deleteMe); @@ -177,15 +180,17 @@ public class OlympiadStadium return; } - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId()); - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + final List spectatorSpawns = getZone().getSpectatorSpawns(); if (spectatorSpawns.isEmpty()) { - LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + LOGGER.warning(getClass().getSimpleName() + ": Zone: " + getZone() + " doesn't have specatator spawns defined!"); return; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - player.enterOlympiadObserverMode(loc, player.getOlympiadGameId()); + player.enterOlympiadObserverMode(loc, _stadiumId); + + _task.getGame().sendOlympiadInfo(player); } } } \ No newline at end of file