Support for timed hunting zone exit (SoE) location.
Contributed by Index.
This commit is contained in:
parent
c29621c886
commit
59367c14db
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element type="xs:string" name="enterLocation" />
|
<xs:element type="xs:string" name="enterLocation" />
|
||||||
|
<xs:element type="xs:string" name="exitLocation" minOccurs="0"/>
|
||||||
<xs:element type="xs:int" name="initialTime" />
|
<xs:element type="xs:int" name="initialTime" />
|
||||||
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
<xs:element type="xs:int" name="resetDelay" minOccurs="0" />
|
||||||
<xs:element type="xs:int" name="maxAddedTime" />
|
<xs:element type="xs:int" name="maxAddedTime" />
|
||||||
|
@ -91,6 +91,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
|||||||
boolean soloInstance = true;
|
boolean soloInstance = true;
|
||||||
boolean weekly = false;
|
boolean weekly = false;
|
||||||
Location enterLocation = null;
|
Location enterLocation = null;
|
||||||
|
Location exitLocation = null;
|
||||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||||
{
|
{
|
||||||
switch (zoneNode.getNodeName())
|
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]));
|
enterLocation = new Location(Integer.parseInt(coordinates[0]), Integer.parseInt(coordinates[1]), Integer.parseInt(coordinates[2]));
|
||||||
break;
|
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":
|
case "initialTime":
|
||||||
{
|
{
|
||||||
initialTime = Integer.parseInt(zoneNode.getTextContent()) * 1000;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
|
|||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
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.instancezone.Instance;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
import org.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
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
|
// Karma player land out of city
|
||||||
if (player.getReputation() < 0)
|
if (player.getReputation() < 0)
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ public class TimedHuntingZoneHolder
|
|||||||
private final boolean _soloInstance;
|
private final boolean _soloInstance;
|
||||||
private final boolean _weekly;
|
private final boolean _weekly;
|
||||||
private final Location _enterLocation;
|
private final Location _enterLocation;
|
||||||
|
private final Location _exitLocation;
|
||||||
private final int _mapX;
|
private final int _mapX;
|
||||||
private final int _mapY;
|
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;
|
_id = id;
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -59,6 +60,7 @@ public class TimedHuntingZoneHolder
|
|||||||
_soloInstance = soloInstance;
|
_soloInstance = soloInstance;
|
||||||
_weekly = weekly;
|
_weekly = weekly;
|
||||||
_enterLocation = enterLocation;
|
_enterLocation = enterLocation;
|
||||||
|
_exitLocation = exitLocation;
|
||||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||||
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
_mapY = ((_enterLocation.getY() - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN;
|
||||||
}
|
}
|
||||||
@ -138,6 +140,11 @@ public class TimedHuntingZoneHolder
|
|||||||
return _enterLocation;
|
return _enterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getExitLocation()
|
||||||
|
{
|
||||||
|
return _exitLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMapX()
|
public int getMapX()
|
||||||
{
|
{
|
||||||
return _mapX;
|
return _mapX;
|
||||||
|
Loading…
Reference in New Issue
Block a user