From 59367c14db083d0854ad48c7cbdecfe08f13389a Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 11 Nov 2021 11:21:27 +0000 Subject: [PATCH] Support for timed hunting zone exit (SoE) location. Contributed by Index. --- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- .../dist/game/data/xsd/TimedHuntingZoneData.xsd | 1 + .../gameserver/data/xml/TimedHuntingZoneData.java | 9 ++++++++- .../gameserver/instancemanager/MapRegionManager.java | 12 ++++++++++++ .../model/holders/TimedHuntingZoneHolder.java | 9 ++++++++- 32 files changed, 232 insertions(+), 16 deletions(-) diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 95b173e730..7fb23816fa 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 920d974e48..4d2d7eb4d9 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_08.2_Homunculus/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 95b173e730..7fb23816fa 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index bcf562cad9..d19d314ce9 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 95b173e730..7fb23816fa 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index bcf562cad9..d19d314ce9 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_10.0_MasterClass/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_10.0_MasterClass/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 95b173e730..7fb23816fa 100644 --- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index bcf562cad9..d19d314ce9 100644 --- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 5a6a640763..971b79ff25 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 97f2cf5b63..47553fa909 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 5a6a640763..971b79ff25 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index c01f5c6c3a..3089960c02 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 5a6a640763..971b79ff25 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index c01f5c6c3a..3089960c02 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX; diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/xsd/TimedHuntingZoneData.xsd b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/xsd/TimedHuntingZoneData.xsd index cdd1c77656..5e4408d5f8 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/xsd/TimedHuntingZoneData.xsd +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/xsd/TimedHuntingZoneData.xsd @@ -6,6 +6,7 @@ + diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java index 5a6a640763..971b79ff25 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/data/xml/TimedHuntingZoneData.java @@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader boolean soloInstance = true; boolean weekly = false; Location enterLocation = null; + Location exitLocation = null; for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) { switch (zoneNode.getNodeName()) @@ -101,6 +102,12 @@ public class TimedHuntingZoneData implements IXmlReader enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); break; } + case "exitLocation": + { + final String[] coordinates = zoneNode.getTextContent().split(","); + exitLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2])); + break; + } case "initialTime": { initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000; @@ -163,7 +170,7 @@ public class TimedHuntingZoneData implements IXmlReader } } } - _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation)); + _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, soloInstance, weekly, enterLocation, exitLocation)); } } } diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java index c01f5c6c3a..3089960c02 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; import org.l2jmobius.gameserver.model.interfaces.ILocational; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -322,6 +323,17 @@ public class MapRegionManager implements IXmlReader } } + // Timed Hunting zones. + final TimedHuntingZoneHolder timedHuntingZone = player.getTimedHuntingZone(); + if (timedHuntingZone != null) + { + final Location exitLocation = timedHuntingZone.getExitLocation(); + if (exitLocation != null) + { + return exitLocation; + } + } + // Karma player land out of city if (player.getReputation() < 0) { diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java index 32302e09dc..60dc7be542 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/TimedHuntingZoneHolder.java @@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder private final boolean _soloInstance; private final boolean _weekly; private final Location _enterLocation; + private final Location _exitLocation; private final int _mapX; private final int _mapY; - public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation) + public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation) { _id = id; _name = name; @@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder _soloInstance = soloInstance; _weekly = weekly; _enterLocation = enterLocation; + _exitLocation = exitLocation; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN; } @@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder return _enterLocation; } + public Location getExitLocation() + { + return _exitLocation; + } + public int getMapX() { return _mapX;