Addition of checkInstanceTime timed hunting zone parameter.
This commit is contained in:
parent
cbbc21cf2e
commit
35632e82a8
@ -16,6 +16,7 @@
|
||||
<xs:element type="xs:short" name="minLevel" />
|
||||
<xs:element type="xs:short" name="maxLevel" />
|
||||
<xs:element type="xs:int" name="instanceId" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="checkInstanceTime" minOccurs="0" />
|
||||
<xs:element type="xs:boolean" name="weekly" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="id" use="optional" />
|
||||
|
@ -88,6 +88,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
int remainRefillTime = 3600;
|
||||
int refillTimeMax = 3600;
|
||||
int instanceId = 0;
|
||||
boolean checkInstanceTime = true;
|
||||
boolean weekly = false;
|
||||
Location enterLocation = null;
|
||||
for (Node zoneNode = listNode.getFirstChild(); zoneNode != null; zoneNode = zoneNode.getNextSibling())
|
||||
@ -150,6 +151,11 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
instanceId = Integer.parseInt(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "checkInstanceTime":
|
||||
{
|
||||
checkInstanceTime = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
break;
|
||||
}
|
||||
case "weekly":
|
||||
{
|
||||
weekly = Boolean.parseBoolean(zoneNode.getTextContent());
|
||||
@ -157,7 +163,7 @@ public class TimedHuntingZoneData implements IXmlReader
|
||||
}
|
||||
}
|
||||
}
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, weekly, enterLocation));
|
||||
_timedHuntingZoneData.put(id, new TimedHuntingZoneHolder(id, name, initialTime, maxAddedTime, resetDelay, entryItemId, entryFee, minLevel, maxLevel, remainRefillTime, refillTimeMax, instanceId, checkInstanceTime, weekly, enterLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,12 +36,13 @@ public class TimedHuntingZoneHolder
|
||||
private final int _remainRefillTime;
|
||||
private final int _refillTimeMax;
|
||||
private final int _instanceId;
|
||||
private final boolean _checkInstanceTime;
|
||||
private final boolean _weekly;
|
||||
private final Location _enterLocation;
|
||||
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 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 checkInstanceTime, boolean weekly, Location enterLocation)
|
||||
{
|
||||
_id = id;
|
||||
_name = name;
|
||||
@ -55,6 +56,7 @@ public class TimedHuntingZoneHolder
|
||||
_remainRefillTime = remainRefillTime;
|
||||
_refillTimeMax = refillTimeMax;
|
||||
_instanceId = instanceId;
|
||||
_checkInstanceTime = checkInstanceTime;
|
||||
_weekly = weekly;
|
||||
_enterLocation = enterLocation;
|
||||
_mapX = ((_enterLocation.getX() - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN;
|
||||
@ -121,6 +123,11 @@ public class TimedHuntingZoneHolder
|
||||
return _instanceId;
|
||||
}
|
||||
|
||||
public boolean checkInstanceTime()
|
||||
{
|
||||
return _checkInstanceTime;
|
||||
}
|
||||
|
||||
public boolean isWeekly()
|
||||
{
|
||||
return _weekly;
|
||||
|
@ -102,7 +102,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final int instanceId = holder.getInstanceId();
|
||||
if ((instanceId > 0) && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
|
||||
if ((instanceId > 0) && holder.checkInstanceTime() && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
|
||||
{
|
||||
player.sendMessage("This transcendent instance has not reset yet.");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user