Addition of TimedHuntingZone pvpZone and noPvpZone parameters.
This commit is contained in:
parent
15c38c6836
commit
fdfa144bfc
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/TimedHuntingZoneData.xsd">
|
||||
<zone id="1" name="Storm Isle">
|
||||
<enterLocation>194291,176604,-1888</enterLocation>
|
||||
<enterLocation>194284,176597,-1888</enterLocation>
|
||||
<exitLocation>110975,220094,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>36000</resetDelay> <!-- 10 hours -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -10,9 +11,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>100</minLevel>
|
||||
<maxLevel>120</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="6" name="Primeval Isle">
|
||||
<enterLocation>9400,-21720,-3634</enterLocation>
|
||||
<enterLocation>9365,-21407,-3584</enterLocation>
|
||||
<exitLocation>43792,-48928,-792</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>36000</resetDelay> <!-- 10 hours -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -21,5 +25,6 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>120</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
</list>
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
|
||||
<!-- No PvP Zones -->
|
||||
<zone name="storm_island" type="NoPvPZone" shape="NPoly" minZ="-4620" maxZ="50"> <!-- [25_23] -->
|
||||
<node X="166552" Y="161325" />
|
||||
<node X="196546" Y="161974" />
|
||||
<node X="198036" Y="195723" />
|
||||
<node X="164904" Y="195931" />
|
||||
</zone>
|
||||
</list>
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -153,6 +155,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -170,7 +182,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, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -43,7 +45,7 @@ public class TimedHuntingZoneHolder
|
||||
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, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -56,6 +58,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -120,6 +124,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/TimedHuntingZoneData.xsd">
|
||||
<zone id="1" name="Storm Isle">
|
||||
<enterLocation>194291,176604,-1888</enterLocation>
|
||||
<enterLocation>194284,176597,-1888</enterLocation>
|
||||
<exitLocation>110975,220094,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -10,9 +11,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>100</minLevel>
|
||||
<maxLevel>120</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="6" name="Primeval Isle">
|
||||
<enterLocation>9400,-21720,-3634</enterLocation>
|
||||
<enterLocation>9365,-21407,-3584</enterLocation>
|
||||
<exitLocation>43792,-48928,-792</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -21,9 +25,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>120</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="7" name="Golden Altar">
|
||||
<enterLocation>-122259,73678,-2872</enterLocation>
|
||||
<enterLocation>-122260,73669,-2872</enterLocation>
|
||||
<exitLocation>148353,28032,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -32,9 +38,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>107</minLevel>
|
||||
<maxLevel>120</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="11" name="Abandoned Coal Mines">
|
||||
<enterLocation>139411,-169382,-1600</enterLocation>
|
||||
<enterLocation>139405,-169389,-1600</enterLocation>
|
||||
<exitLocation>146561,28042,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -43,9 +51,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>99</minLevel>
|
||||
<maxLevel>105</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="8" name="Tower of Insolence">
|
||||
<enterLocation>-82014,16247,-15416</enterLocation>
|
||||
<exitLocation>147459,27019,-2207</exitLocation>
|
||||
<initialTime>36000</initialTime> <!-- 10 hours -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>36000</maxAddedTime> <!-- 12 hours -->
|
||||
@ -54,11 +65,13 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>110</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<weekly>true</weekly>
|
||||
<useWorldPrefix>true</useWorldPrefix>
|
||||
</zone>
|
||||
<zone id="12" name="Imperial Tomb">
|
||||
<enterLocation>181409,-78389,-2728</enterLocation>
|
||||
<enterLocation>181406,-78395,-2728</enterLocation>
|
||||
<exitLocation>147714,-55409,-2728</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>3600</maxAddedTime> <!-- 1 hour -->
|
||||
@ -67,5 +80,6 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
</list>
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
|
||||
<!-- No PvP Zones -->
|
||||
<zone name="storm_island" type="NoPvPZone" shape="NPoly" minZ="-4620" maxZ="50"> <!-- [25_23] -->
|
||||
<node X="166552" Y="161325" />
|
||||
<node X="196546" Y="161974" />
|
||||
<node X="198036" Y="195723" />
|
||||
<node X="164904" Y="195931" />
|
||||
</zone>
|
||||
<zone name="coal_mines" type="NoPvPZone" shape="NPoly" minZ="-4972" maxZ="3028"> <!-- Coal Mines -->
|
||||
<node X="131104" Y="-196675" />
|
||||
<node X="163713" Y="-196681" />
|
||||
<node X="163713" Y="-163915" />
|
||||
<node X="130947" Y="-163915" />
|
||||
</zone>
|
||||
</list>
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/TimedHuntingZoneData.xsd">
|
||||
<zone id="1" name="Storm Isle">
|
||||
<enterLocation>194291,176604,-1888</enterLocation>
|
||||
<enterLocation>194284,176597,-1888</enterLocation>
|
||||
<exitLocation>110975,220094,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -10,9 +11,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>100</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="6" name="Primeval Isle">
|
||||
<enterLocation>9400,-21720,-3634</enterLocation>
|
||||
<enterLocation>9365,-21407,-3584</enterLocation>
|
||||
<exitLocation>43792,-48928,-792</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -21,9 +25,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="7" name="Isle of Souls">
|
||||
<enterLocation>-122259,73678,-2872</enterLocation>
|
||||
<enterLocation>-122260,73669,-2872</enterLocation>
|
||||
<exitLocation>148353,28032,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>86400</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -36,7 +42,8 @@
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="11" name="Abandoned Coal Mines">
|
||||
<enterLocation>139411,-169382,-1600</enterLocation>
|
||||
<enterLocation>139405,-169389,-1600</enterLocation>
|
||||
<exitLocation>146561,28042,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -45,9 +52,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>99</minLevel>
|
||||
<maxLevel>105</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="8" name="Tower of Insolence">
|
||||
<enterLocation>-82014,16247,-15416</enterLocation>
|
||||
<exitLocation>147459,27019,-2207</exitLocation>
|
||||
<initialTime>36000</initialTime> <!-- 10 hours -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>36000</maxAddedTime> <!-- 12 hours -->
|
||||
@ -56,11 +66,13 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>110</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<weekly>true</weekly>
|
||||
<useWorldPrefix>true</useWorldPrefix>
|
||||
</zone>
|
||||
<zone id="12" name="Imperial Tomb">
|
||||
<enterLocation>181409,-78389,-2728</enterLocation>
|
||||
<enterLocation>181406,-78395,-2728</enterLocation>
|
||||
<exitLocation>147714,-55409,-2728</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>3600</maxAddedTime> <!-- 1 hour -->
|
||||
@ -69,9 +81,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="13" name="Corroded Fields">
|
||||
<enterLocation>90327,198818,-3280</enterLocation>
|
||||
<enterLocation>90359,198833,-3280</enterLocation>
|
||||
<exitLocation>111563,220512,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>36000</resetDelay> <!-- 10 hours -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 3 hours -->
|
||||
@ -84,7 +98,8 @@
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="14" name="Otherworldly Atelia Refinery">
|
||||
<enterLocation>-49013,15351,-8808</enterLocation>
|
||||
<enterLocation>-49020,15369,-8808</enterLocation>
|
||||
<exitLocation>82795,53888,-1488</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
<remainRefillTime>7200</remainRefillTime>
|
||||
@ -92,5 +107,7 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>112</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
</list>
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
|
||||
<!-- No PvP Zones -->
|
||||
<zone name="storm_island" type="NoPvPZone" shape="NPoly" minZ="-4620" maxZ="50"> <!-- [25_23] -->
|
||||
<node X="166552" Y="161325" />
|
||||
<node X="196546" Y="161974" />
|
||||
<node X="198036" Y="195723" />
|
||||
<node X="164904" Y="195931" />
|
||||
</zone>
|
||||
<zone name="coal_mines" type="NoPvPZone" shape="NPoly" minZ="-4972" maxZ="3028"> <!-- Coal Mines -->
|
||||
<node X="131104" Y="-196675" />
|
||||
<node X="163713" Y="-196681" />
|
||||
<node X="163713" Y="-163915" />
|
||||
<node X="130947" Y="-163915" />
|
||||
</zone>
|
||||
</list>
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/TimedHuntingZoneData.xsd">
|
||||
<zone id="1" name="Storm Isle">
|
||||
<enterLocation>194291,176604,-1888</enterLocation>
|
||||
<enterLocation>194284,176597,-1888</enterLocation>
|
||||
<exitLocation>110975,220094,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -10,9 +11,12 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>100</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="6" name="Primeval Isle">
|
||||
<enterLocation>9400,-21720,-3634</enterLocation>
|
||||
<enterLocation>9365,-21407,-3584</enterLocation>
|
||||
<exitLocation>43792,-48928,-792</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -21,9 +25,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="7" name="Isle of Souls">
|
||||
<enterLocation>-122259,73678,-2872</enterLocation>
|
||||
<enterLocation>-122260,73669,-2872</enterLocation>
|
||||
<exitLocation>148353,28032,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>86400</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -36,7 +42,8 @@
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="11" name="Abandoned Coal Mines">
|
||||
<enterLocation>139411,-169382,-1600</enterLocation>
|
||||
<enterLocation>139405,-169389,-1600</enterLocation>
|
||||
<exitLocation>146561,28042,-2264</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 6 hours -->
|
||||
@ -44,10 +51,13 @@
|
||||
<refillTimeMax>3600</refillTimeMax>
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>99</minLevel>
|
||||
<maxLevel>105</maxLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
</zone>
|
||||
<zone id="20" name="Tower of Insolence (01 - 09 flours)">
|
||||
<enterLocation>-82014,16247,-15416</enterLocation>
|
||||
<exitLocation>147459,27019,-2207</exitLocation>
|
||||
<initialTime>36000</initialTime> <!-- 10 hours -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>54000</maxAddedTime> <!-- 15 hours -->
|
||||
@ -62,7 +72,8 @@
|
||||
<useWorldPrefix>true</useWorldPrefix>
|
||||
</zone>
|
||||
<zone id="12" name="Imperial Tomb">
|
||||
<enterLocation>181409,-78389,-2728</enterLocation>
|
||||
<enterLocation>181406,-78395,-2728</enterLocation>
|
||||
<exitLocation>147714,-55409,-2728</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>3600</maxAddedTime> <!-- 1 hour -->
|
||||
@ -71,9 +82,11 @@
|
||||
<entryFee>150000</entryFee>
|
||||
<minLevel>105</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="13" name="Corroded Fields">
|
||||
<enterLocation>90327,198818,-3280</enterLocation>
|
||||
<enterLocation>90359,198833,-3280</enterLocation>
|
||||
<exitLocation>111563,220512,-3664</exitLocation>
|
||||
<initialTime>3600</initialTime> <!-- 1 hour -->
|
||||
<resetDelay>36000</resetDelay> <!-- 10 hours -->
|
||||
<maxAddedTime>21600</maxAddedTime> <!-- 3 hours -->
|
||||
@ -86,7 +99,8 @@
|
||||
<soloInstance>false</soloInstance>
|
||||
</zone>
|
||||
<zone id="15" name="Otherworldly Atelia Refinery">
|
||||
<enterLocation>-49013,15351,-8808</enterLocation>
|
||||
<enterLocation>-49020,15369,-8808</enterLocation>
|
||||
<exitLocation>82795,53888,-1488</exitLocation>
|
||||
<initialTime>36000</initialTime> <!-- 10 hour -->
|
||||
<resetDelay>864000</resetDelay> <!-- 10 days -->
|
||||
<maxAddedTime>43200</maxAddedTime> <!-- 12 hours -->
|
||||
@ -95,6 +109,8 @@
|
||||
<entryFee>1500000</entryFee>
|
||||
<minLevel>112</minLevel>
|
||||
<maxLevel>130</maxLevel>
|
||||
<soloInstance>false</soloInstance>
|
||||
<noPvpZone>true</noPvpZone>
|
||||
<weekly>true</weekly>
|
||||
</zone>
|
||||
</list>
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -1,18 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
|
||||
<!-- No PvP Zones -->
|
||||
<zone name="storm_island" type="NoPvPZone" shape="NPoly" minZ="-4620" maxZ="50"> <!-- [25_23] -->
|
||||
<node X="166552" Y="161325" />
|
||||
<node X="196546" Y="161974" />
|
||||
<node X="198036" Y="195723" />
|
||||
<node X="164904" Y="195931" />
|
||||
</zone>
|
||||
<zone name="coal_mines" type="NoPvPZone" shape="NPoly" minZ="-4972" maxZ="3028"> <!-- Coal Mines -->
|
||||
<node X="131104" Y="-196675" />
|
||||
<node X="163713" Y="-196681" />
|
||||
<node X="163713" Y="-163915" />
|
||||
<node X="130947" Y="-163915" />
|
||||
</zone>
|
||||
<zone name="toi_hz" type="NoPvPZone" shape="Cuboid" minZ="-16000" maxZ="10000"> <!-- TOI 01 - 03 -->
|
||||
<node X="-98304" Y="0" />
|
||||
<node X="-65537" Y="32767" />
|
||||
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -153,6 +155,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -170,7 +182,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, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -43,7 +45,7 @@ public class TimedHuntingZoneHolder
|
||||
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, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -56,6 +58,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -120,6 +124,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
<xs:element type="xs:int" name="entryFee" />
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:boolean" name="pvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="noPvpZone" minOccurs="0" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="soloInstance" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
|
@ -87,6 +87,8 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int maxLevel = 999;
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
boolean pvpZone = false;
|
||||
boolean noPvpZone = false;
|
||||
int instanceId = 0;
|
||||
boolean soloInstance = true;
|
||||
boolean weekly = false;
|
||||
@ -154,6 +156,16 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "pvpZone":
|
||||
{
|
||||
pvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "noPvpZone":
|
||||
{
|
||||
noPvpZone = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "instanceId":
|
||||
{
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
@ -176,7 +188,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, useWorldPrefix, enterLocation, exitLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, pvpZone, noPvpZone, instanceId, soloInstance, weekly, useWorldPrefix, enterLocation, exitLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class TimedHuntingZoneHolder
|
||||
private final int _maxLevel;
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final boolean _pvpZone;
|
||||
private final boolean _noPvpZone;
|
||||
private final int _instanceId;
|
||||
private final boolean _soloInstance;
|
||||
private final boolean _weekly;
|
||||
@ -44,7 +46,7 @@ public class TimedHuntingZoneHolder
|
||||
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, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
public TimedHuntingZoneHolder(int id, String name, int initialTime, int maximumAddedTime, int resetDelay, int entryItemId, int entryFee, int minLevel, int maxLevel, int remainRefillTime, int refillTimeMax, boolean pvpZone, boolean noPvpZone, int instanceId, boolean soloInstance, boolean weekly, boolean useWorldPrefix, Location enterLocation, Location exitLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -57,6 +59,8 @@ public class TimedHuntingZoneHolder
|
||||
_maxLevel = maxLevel;
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_pvpZone = pvpZone;
|
||||
_noPvpZone = noPvpZone;
|
||||
_instanceId = instanceId;
|
||||
_soloInstance = soloInstance;
|
||||
_weekly = weekly;
|
||||
@ -122,6 +126,16 @@ public class TimedHuntingZoneHolder
|
||||
return _refillTimeMax;
|
||||
}
|
||||
|
||||
public boolean isPvpZone()
|
||||
{
|
||||
return _pvpZone;
|
||||
}
|
||||
|
||||
public boolean isNoPvpZone()
|
||||
{
|
||||
return _noPvpZone;
|
||||
}
|
||||
|
||||
public int getInstanceId()
|
||||
{
|
||||
return _instanceId;
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneExit;
|
||||
|
||||
/**
|
||||
@ -63,6 +64,41 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.startTimedHuntingZone(holder.getZoneId(), remainingTime);
|
||||
player.getVariables().set(PlayerVariables.LAST_HUNTING_ZONE_ID, holder.getZoneId());
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
|
||||
}
|
||||
|
||||
player.setInsideZone(ZoneId.PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, true);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, true);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, true));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -88,11 +124,52 @@ public class TimedHuntingZone extends ZoneType
|
||||
{
|
||||
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
|
||||
|
||||
final int lastHuntingZoneId = player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0);
|
||||
final TimedHuntingZoneHolder holder = TimedHuntingZoneData.getInstance().getHuntingZone(lastHuntingZoneId);
|
||||
if (holder != null)
|
||||
{
|
||||
if (holder.isPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.PVP, false);
|
||||
}
|
||||
|
||||
if (!player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
creature.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
|
||||
}
|
||||
}
|
||||
else if (holder.isNoPvpZone())
|
||||
{
|
||||
player.setInsideZone(ZoneId.NO_PVP, false);
|
||||
if (player.hasServitors())
|
||||
{
|
||||
player.getServitors().values().forEach(s -> s.setInsideZone(ZoneId.NO_PVP, false));
|
||||
}
|
||||
if (player.hasPet())
|
||||
{
|
||||
player.getPet().setInsideZone(ZoneId.NO_PVP, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Send player info to nearby players.
|
||||
if (!player.isTeleporting())
|
||||
{
|
||||
player.broadcastInfo();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
player.sendPacket(new TimedHuntingZoneExit(lastHuntingZoneId));
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user