Improved support for instanced timed hunting zones.

This commit is contained in:
MobiusDevelopment 2021-05-25 21:39:09 +00:00
parent 0537478023
commit 432f235dc5
34 changed files with 232 additions and 24 deletions

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14292,6 +14292,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -19,6 +19,8 @@ package org.l2jmobius.gameserver.network.clientpackets.huntingzones;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos; import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
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.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@ -99,6 +101,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{
player.sendMessage("This transcendent instance has not reset yet.");
return;
}
final long currentTime = Chronos.currentTimeMillis(); final long currentTime = Chronos.currentTimeMillis();
long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
@ -132,7 +141,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
} }
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
player.teleToLocation(holder.getEnterLocation());
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
}
} }
else else
{ {

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14365,6 +14365,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -19,6 +19,8 @@ package org.l2jmobius.gameserver.network.clientpackets.huntingzones;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos; import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
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.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@ -99,6 +101,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{
player.sendMessage("This transcendent instance has not reset yet.");
return;
}
final long currentTime = Chronos.currentTimeMillis(); final long currentTime = Chronos.currentTimeMillis();
long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
@ -132,7 +141,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
} }
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
player.teleToLocation(holder.getEnterLocation());
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
}
} }
else else
{ {

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14403,6 +14403,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -19,6 +19,8 @@ package org.l2jmobius.gameserver.network.clientpackets.huntingzones;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos; import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
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.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@ -99,6 +101,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{
player.sendMessage("This transcendent instance has not reset yet.");
return;
}
final long currentTime = Chronos.currentTimeMillis(); final long currentTime = Chronos.currentTimeMillis();
long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
@ -132,7 +141,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
} }
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
player.teleToLocation(holder.getEnterLocation());
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
}
} }
else else
{ {

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14272,6 +14272,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -19,6 +19,8 @@ package org.l2jmobius.gameserver.network.clientpackets.huntingzones;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos; import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
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.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@ -99,6 +101,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{
player.sendMessage("This transcendent instance has not reset yet.");
return;
}
final long currentTime = Chronos.currentTimeMillis(); final long currentTime = Chronos.currentTimeMillis();
long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
@ -132,7 +141,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
} }
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
player.teleToLocation(holder.getEnterLocation());
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
}
} }
else else
{ {

View File

@ -55,6 +55,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>40</minLevel> <minLevel>40</minLevel>
<maxLevel>49</maxLevel> <maxLevel>49</maxLevel>
<instanceId>1101</instanceId>
</zone> </zone>
<zone id="102" name="Transcendent Instance Zone 2"> <zone id="102" name="Transcendent Instance Zone 2">
<enterLocation>125277,70262,-4408</enterLocation> <enterLocation>125277,70262,-4408</enterLocation>
@ -66,6 +67,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>50</minLevel> <minLevel>50</minLevel>
<maxLevel>59</maxLevel> <maxLevel>59</maxLevel>
<instanceId>1102</instanceId>
</zone> </zone>
<zone id="103" name="Transcendent Instance Zone 3"> <zone id="103" name="Transcendent Instance Zone 3">
<enterLocation>148724,-22366,-3436</enterLocation> <enterLocation>148724,-22366,-3436</enterLocation>
@ -77,6 +79,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>60</minLevel> <minLevel>60</minLevel>
<maxLevel>69</maxLevel> <maxLevel>69</maxLevel>
<instanceId>1103</instanceId>
</zone> </zone>
<zone id="104" name="Transcendent Instance Zone 4"> <zone id="104" name="Transcendent Instance Zone 4">
<enterLocation>167965,28800,-3606</enterLocation> <enterLocation>167965,28800,-3606</enterLocation>
@ -88,6 +91,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>70</minLevel> <minLevel>70</minLevel>
<maxLevel>79</maxLevel> <maxLevel>79</maxLevel>
<instanceId>1104</instanceId>
</zone> </zone>
<zone id="106" name="Transcendent Instance Zone 6"> <zone id="106" name="Transcendent Instance Zone 6">
<enterLocation>99797,110524,-3702</enterLocation> <enterLocation>99797,110524,-3702</enterLocation>
@ -99,6 +103,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>80</minLevel> <minLevel>80</minLevel>
<maxLevel>999</maxLevel> <maxLevel>999</maxLevel>
<instanceId>1106</instanceId>
</zone> </zone>
<zone id="107" name="Transcendent Instance Zone 7"> <zone id="107" name="Transcendent Instance Zone 7">
<enterLocation>-50416,145363,-2825</enterLocation> <enterLocation>-50416,145363,-2825</enterLocation>
@ -110,5 +115,6 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>85</minLevel> <minLevel>85</minLevel>
<maxLevel>999</maxLevel> <maxLevel>999</maxLevel>
<instanceId>1107</instanceId>
</zone> </zone>
</list> </list>

View File

@ -69,7 +69,7 @@ public class TranscendentZone extends AbstractInstance
{ {
if (event.startsWith("ENTER")) if (event.startsWith("ENTER"))
{ {
enterInstance(player, npc, 1000 + Integer.parseInt(event.split(" ")[1])); enterInstance(player, npc, Integer.parseInt(event.split(" ")[1]));
} }
else if (event.startsWith("FINISH")) else if (event.startsWith("FINISH"))
{ {

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14533,6 +14533,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -101,7 +101,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if ((_zoneId >= 101) && (_zoneId <= 107) && (InstanceManager.getInstance().getInstanceTime(player, 1000 + _zoneId) > Chronos.currentTimeMillis())) final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{ {
player.sendMessage("This transcendent instance has not reset yet."); player.sendMessage("This transcendent instance has not reset yet.");
return; return;
@ -141,13 +142,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
if ((_zoneId < 101) || (_zoneId > 107)) if (instanceId == 0)
{ {
player.teleToLocation(holder.getEnterLocation()); player.teleToLocation(holder.getEnterLocation());
} }
else // Transcendent zones. else // Transcendent zones.
{ {
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player); QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
} }
} }
else else

View File

@ -55,6 +55,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>40</minLevel> <minLevel>40</minLevel>
<maxLevel>49</maxLevel> <maxLevel>49</maxLevel>
<instanceId>1101</instanceId>
</zone> </zone>
<zone id="102" name="Transcendent Instance Zone 2"> <zone id="102" name="Transcendent Instance Zone 2">
<enterLocation>125277,70262,-4408</enterLocation> <enterLocation>125277,70262,-4408</enterLocation>
@ -66,6 +67,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>50</minLevel> <minLevel>50</minLevel>
<maxLevel>59</maxLevel> <maxLevel>59</maxLevel>
<instanceId>1102</instanceId>
</zone> </zone>
<zone id="103" name="Transcendent Instance Zone 3"> <zone id="103" name="Transcendent Instance Zone 3">
<enterLocation>148724,-22366,-3436</enterLocation> <enterLocation>148724,-22366,-3436</enterLocation>
@ -77,6 +79,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>60</minLevel> <minLevel>60</minLevel>
<maxLevel>69</maxLevel> <maxLevel>69</maxLevel>
<instanceId>1103</instanceId>
</zone> </zone>
<zone id="104" name="Transcendent Instance Zone 4"> <zone id="104" name="Transcendent Instance Zone 4">
<enterLocation>167965,28800,-3606</enterLocation> <enterLocation>167965,28800,-3606</enterLocation>
@ -88,6 +91,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>70</minLevel> <minLevel>70</minLevel>
<maxLevel>79</maxLevel> <maxLevel>79</maxLevel>
<instanceId>1104</instanceId>
</zone> </zone>
<zone id="106" name="Transcendent Instance Zone 6"> <zone id="106" name="Transcendent Instance Zone 6">
<enterLocation>99797,110524,-3702</enterLocation> <enterLocation>99797,110524,-3702</enterLocation>
@ -99,6 +103,7 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>80</minLevel> <minLevel>80</minLevel>
<maxLevel>999</maxLevel> <maxLevel>999</maxLevel>
<instanceId>1106</instanceId>
</zone> </zone>
<zone id="107" name="Transcendent Instance Zone 7"> <zone id="107" name="Transcendent Instance Zone 7">
<enterLocation>-50416,145363,-2825</enterLocation> <enterLocation>-50416,145363,-2825</enterLocation>
@ -110,5 +115,6 @@
<entryFee>10000</entryFee> <entryFee>10000</entryFee>
<minLevel>85</minLevel> <minLevel>85</minLevel>
<maxLevel>999</maxLevel> <maxLevel>999</maxLevel>
<instanceId>1107</instanceId>
</zone> </zone>
</list> </list>

View File

@ -69,7 +69,7 @@ public class TranscendentZone extends AbstractInstance
{ {
if (event.startsWith("ENTER")) if (event.startsWith("ENTER"))
{ {
enterInstance(player, npc, 1000 + Integer.parseInt(event.split(" ")[1])); enterInstance(player, npc, Integer.parseInt(event.split(" ")[1]));
} }
else if (event.startsWith("FINISH")) else if (event.startsWith("FINISH"))
{ {

View File

@ -15,6 +15,7 @@
<xs:element type="xs:int" name="entryFee" /> <xs:element type="xs:int" name="entryFee" />
<xs:element type="xs:short" name="minLevel" /> <xs:element type="xs:short" name="minLevel" />
<xs:element type="xs:short" name="maxLevel" /> <xs:element type="xs:short" name="maxLevel" />
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
<xs:element type="xs:boolean" name="weekly" minOccurs="0" /> <xs:element type="xs:boolean" name="weekly" minOccurs="0" />
</xs:sequence> </xs:sequence>
<xs:attribute type="xs:byte" name="id" use="optional" /> <xs:attribute type="xs:byte" name="id" use="optional" />

View File

@ -87,6 +87,7 @@ public class TimedHuntingZoneData implements IXmlReader
int maxLevel = 999; int maxLevel = 999;
int remainRefillTime = 3600; int remainRefillTime = 3600;
int refillTimeMax = 3600; int refillTimeMax = 3600;
int instanceId = 0;
boolean weekly = false; boolean weekly = false;
Location enterLocation = null; Location enterLocation = null;
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling()) for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
@ -144,6 +145,11 @@ public class TimedHuntingZoneData implements IXmlReader
refillTimeMax = Integer.parseInt(zoneNode.getTextContent()); refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break; break;
} }
case "instanceId":
{
refillTimeMax = Integer.parseInt(zoneNode.getTextContent());
break;
}
case "weekly": case "weekly":
{ {
weekly = Boolean.parseBoolean(zoneNode.getTextContent()); weekly = Boolean.parseBoolean(zoneNode.getTextContent());
@ -151,7 +157,7 @@ public class TimedHuntingZoneData implements IXmlReader
} }
} }
} }
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, weekly, enterLocation)); _timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
} }
} }
} }

View File

@ -14611,6 +14611,13 @@ public class PlayerInstance extends Playable
{ {
return false; return false;
} }
final int instanceId = holder.getInstanceId();
if (instanceId > 0)
{
return isInInstance() && (instanceId == getInstanceWorld().getTemplateId());
}
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN)); return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
} }

View File

@ -35,12 +35,13 @@ public class TimedHuntingZoneHolder
private final int _maxLevel; private final int _maxLevel;
private final int _remainRefillTime; private final int _remainRefillTime;
private final int _refillTimeMax; private final int _refillTimeMax;
private final int _instanceId;
private final boolean _weekly; private final boolean _weekly;
private final Location _enterLocation; private final Location _enterLocation;
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, 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 weekly, Location enterLocation)
{ {
_id = id; _id = id;
_name = name; _name = name;
@ -53,6 +54,7 @@ public class TimedHuntingZoneHolder
_maxLevel = maxLevel; _maxLevel = maxLevel;
_remainRefillTime = remainRefillTime; _remainRefillTime = remainRefillTime;
_refillTimeMax = refillTimeMax; _refillTimeMax = refillTimeMax;
_instanceId = instanceId;
_weekly = weekly; _weekly = weekly;
_enterLocation = enterLocation; _enterLocation = enterLocation;
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN; _mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
@ -114,6 +116,11 @@ public class TimedHuntingZoneHolder
return _refillTimeMax; return _refillTimeMax;
} }
public int getInstanceId()
{
return _instanceId;
}
public boolean isWeekly() public boolean isWeekly()
{ {
return _weekly; return _weekly;

View File

@ -101,7 +101,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if ((_zoneId >= 101) && (_zoneId <= 107) && (InstanceManager.getInstance().getInstanceTime(player, 1000 + _zoneId) > Chronos.currentTimeMillis())) final int instanceId = holder.getInstanceId();
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
{ {
player.sendMessage("This transcendent instance has not reset yet."); player.sendMessage("This transcendent instance has not reset yet.");
return; return;
@ -141,13 +142,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime); player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, endTime - currentTime);
if ((_zoneId < 101) || (_zoneId > 107)) if (instanceId == 0)
{ {
player.teleToLocation(holder.getEnterLocation()); player.teleToLocation(holder.getEnterLocation());
} }
else // Transcendent zones. else // Transcendent zones.
{ {
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player); QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
} }
} }
else else