Weekly hunting zone.
Contributed by Sero.
This commit is contained in:
@@ -6,14 +6,26 @@
|
|||||||
# Default: 3600000 (1 hour)
|
# Default: 3600000 (1 hour)
|
||||||
InitialTime = 3600000
|
InitialTime = 3600000
|
||||||
|
|
||||||
|
# Initial free time.
|
||||||
|
# Default: 36000000 (10 hour)
|
||||||
|
InitialTimeWeekly = 36000000
|
||||||
|
|
||||||
# Maximum added time.
|
# Maximum added time.
|
||||||
# Default: 18000000 (5 hours)
|
# Default: 18000000 (6 hours)
|
||||||
MaximumAddedTime = 18000000
|
MaximumAddedTime = 21600000
|
||||||
|
|
||||||
|
# Maximum added time Weekly.
|
||||||
|
# Default: 43200000 (12 hours)
|
||||||
|
MaximumAddedTimeWeekly = 43200000
|
||||||
|
|
||||||
# Reset delay.
|
# Reset delay.
|
||||||
# Default: 36000000 (10 hours)
|
# Default: 36000000 (10 hours)
|
||||||
ResetDelay = 36000000
|
ResetDelay = 36000000
|
||||||
|
|
||||||
|
# Reset Weekly.
|
||||||
|
# Default: 604800000 (7 Days)
|
||||||
|
ResetWeekly = 604800000
|
||||||
|
|
||||||
# Teleport fee.
|
# Teleport fee.
|
||||||
# Default: 150000
|
# Default: 150000
|
||||||
TeleportFee = 150000
|
TeleportFee = 150000
|
||||||
|
@@ -57,7 +57,13 @@ public class AddHuntingTime extends AbstractEffect
|
|||||||
|
|
||||||
final long currentTime = System.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
|
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
|
||||||
if ((endTime > currentTime) && (((endTime - currentTime) + _time) >= Config.TIME_LIMITED_MAX_ADDED_TIME))
|
if ((_zoneId == 8) && (endTime > currentTime) && (((endTime - currentTime) + _time) >= Config.TIME_LIMITED_MAX_ADDED_TIME_WEEKLY))
|
||||||
|
{
|
||||||
|
player.getInventory().addItem("AddHuntingTime effect refund", item.getId(), 1, player, player);
|
||||||
|
player.sendMessage("You cannot exceed the time zone limit.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if ((endTime > currentTime) && (((endTime - currentTime) + _time) >= Config.TIME_LIMITED_MAX_ADDED_TIME))
|
||||||
{
|
{
|
||||||
player.getInventory().addItem("AddHuntingTime effect refund", item.getId(), 1, player, player);
|
player.getInventory().addItem("AddHuntingTime effect refund", item.getId(), 1, player, player);
|
||||||
player.sendMessage("You cannot exceed the time zone limit.");
|
player.sendMessage("You cannot exceed the time zone limit.");
|
||||||
@@ -72,7 +78,11 @@ public class AddHuntingTime extends AbstractEffect
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((_zoneId == 8) && ((endTime + Config.TIME_LIMITED_ZONE_RESET_WEEKLY) < currentTime))
|
||||||
|
{
|
||||||
|
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY;
|
||||||
|
}
|
||||||
|
else if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME;
|
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME;
|
||||||
}
|
}
|
||||||
|
@@ -834,8 +834,11 @@ public class Config
|
|||||||
public static List<String> TELNET_HOSTS;
|
public static List<String> TELNET_HOSTS;
|
||||||
public static int TELNET_PORT;
|
public static int TELNET_PORT;
|
||||||
public static long TIME_LIMITED_ZONE_INITIAL_TIME;
|
public static long TIME_LIMITED_ZONE_INITIAL_TIME;
|
||||||
|
public static long TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY;
|
||||||
public static long TIME_LIMITED_MAX_ADDED_TIME;
|
public static long TIME_LIMITED_MAX_ADDED_TIME;
|
||||||
|
public static long TIME_LIMITED_MAX_ADDED_TIME_WEEKLY;
|
||||||
public static long TIME_LIMITED_ZONE_RESET_DELAY;
|
public static long TIME_LIMITED_ZONE_RESET_DELAY;
|
||||||
|
public static long TIME_LIMITED_ZONE_RESET_WEEKLY;
|
||||||
public static long TIME_LIMITED_ZONE_TELEPORT_FEE;
|
public static long TIME_LIMITED_ZONE_TELEPORT_FEE;
|
||||||
public static boolean TRAINING_CAMP_ENABLE;
|
public static boolean TRAINING_CAMP_ENABLE;
|
||||||
public static boolean TRAINING_CAMP_PREMIUM_ONLY;
|
public static boolean TRAINING_CAMP_PREMIUM_ONLY;
|
||||||
@@ -1985,8 +1988,11 @@ public class Config
|
|||||||
// Load Time Limited Zone config file (if exists)
|
// Load Time Limited Zone config file (if exists)
|
||||||
final PropertiesParser timeLimitedZoneSettings = new PropertiesParser(TIME_LIMITED_ZONE_CONFIG_FILE);
|
final PropertiesParser timeLimitedZoneSettings = new PropertiesParser(TIME_LIMITED_ZONE_CONFIG_FILE);
|
||||||
TIME_LIMITED_ZONE_INITIAL_TIME = timeLimitedZoneSettings.getLong("InitialTime", 3600000);
|
TIME_LIMITED_ZONE_INITIAL_TIME = timeLimitedZoneSettings.getLong("InitialTime", 3600000);
|
||||||
TIME_LIMITED_MAX_ADDED_TIME = timeLimitedZoneSettings.getLong("MaximumAddedTime", 18000000);
|
TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY = timeLimitedZoneSettings.getLong("InitialTimeWeekly", 36000000);
|
||||||
|
TIME_LIMITED_MAX_ADDED_TIME = timeLimitedZoneSettings.getLong("MaximumAddedTime", 21600000);
|
||||||
|
TIME_LIMITED_MAX_ADDED_TIME_WEEKLY = timeLimitedZoneSettings.getLong("MaximumAddedTimeWeekly", 43200000);
|
||||||
TIME_LIMITED_ZONE_RESET_DELAY = timeLimitedZoneSettings.getLong("ResetDelay", 36000000);
|
TIME_LIMITED_ZONE_RESET_DELAY = timeLimitedZoneSettings.getLong("ResetDelay", 36000000);
|
||||||
|
TIME_LIMITED_ZONE_RESET_WEEKLY = timeLimitedZoneSettings.getLong("ResetWeekly", 604800000);
|
||||||
TIME_LIMITED_ZONE_TELEPORT_FEE = timeLimitedZoneSettings.getLong("TeleportFee", 150000);
|
TIME_LIMITED_ZONE_TELEPORT_FEE = timeLimitedZoneSettings.getLong("TeleportFee", 150000);
|
||||||
|
|
||||||
// Load Training Camp config file (if exists)
|
// Load Training Camp config file (if exists)
|
||||||
|
@@ -97,7 +97,12 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
|||||||
|
|
||||||
final long currentTime = System.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
|
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
|
||||||
|
if ((_zoneId == 8) && ((endTime + Config.TIME_LIMITED_ZONE_RESET_WEEKLY) < currentTime))
|
||||||
|
{
|
||||||
|
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY;
|
||||||
|
}
|
||||||
|
else if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME;
|
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME;
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(1); // zone id
|
packet.writeD(1); // zone id
|
||||||
packet.writeD(100); // min level
|
packet.writeD(100); // min level
|
||||||
packet.writeD(120); // max level
|
packet.writeD(120); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(6); // zone id
|
packet.writeD(6); // zone id
|
||||||
packet.writeD(105); // min level
|
packet.writeD(105); // min level
|
||||||
packet.writeD(120); // max level
|
packet.writeD(120); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
@@ -97,7 +97,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(7); // zone id
|
packet.writeD(7); // zone id
|
||||||
packet.writeD(107); // min level
|
packet.writeD(107); // min level
|
||||||
packet.writeD(120); // max level
|
packet.writeD(120); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 7, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 7, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
@@ -118,7 +118,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(11); // zone id
|
packet.writeD(11); // zone id
|
||||||
packet.writeD(99); // min level
|
packet.writeD(99); // min level
|
||||||
packet.writeD(105); // max level
|
packet.writeD(105); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 11, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 11, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
@@ -135,18 +135,18 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(1); // required item count
|
packet.writeD(1); // required item count
|
||||||
packet.writeD(57); // item id
|
packet.writeD(57); // item id
|
||||||
packet.writeQ(Config.TIME_LIMITED_ZONE_TELEPORT_FEE); // item count
|
packet.writeQ(Config.TIME_LIMITED_ZONE_TELEPORT_FEE); // item count
|
||||||
packet.writeD(1); // reset cycle
|
packet.writeD(0); // reset cycle
|
||||||
packet.writeD(8); // zone id
|
packet.writeD(8); // zone id
|
||||||
packet.writeD(110); // min level
|
packet.writeD(110); // min level
|
||||||
packet.writeD(130); // max level
|
packet.writeD(130); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 8, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 8, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_WEEKLY) < currentTime)
|
||||||
{
|
{
|
||||||
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME;
|
endTime = currentTime + Config.TIME_LIMITED_ZONE_INITIAL_TIME_WEEKLY;
|
||||||
}
|
}
|
||||||
packet.writeD((int) (Math.max(endTime - currentTime, 0)) / 1000); // remain time
|
packet.writeD((int) (Math.max(endTime - currentTime, 0)) / 1000); // remain time
|
||||||
packet.writeD((int) (Config.TIME_LIMITED_MAX_ADDED_TIME / 1000));
|
packet.writeD((int) (Config.TIME_LIMITED_MAX_ADDED_TIME_WEEKLY / 1000));
|
||||||
packet.writeD(3600); // remain refill time
|
packet.writeD(3600); // remain refill time
|
||||||
packet.writeD(3600); // refill time max
|
packet.writeD(3600); // refill time max
|
||||||
packet.writeD(_isInTimedHuntingZone ? 0 : 1); // field activated (272 C to D)
|
packet.writeD(_isInTimedHuntingZone ? 0 : 1); // field activated (272 C to D)
|
||||||
@@ -160,7 +160,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
|
|||||||
packet.writeD(12); // zone id
|
packet.writeD(12); // zone id
|
||||||
packet.writeD(105); // min level
|
packet.writeD(105); // min level
|
||||||
packet.writeD(130); // max level
|
packet.writeD(130); // max level
|
||||||
packet.writeD(0); // remain time base?
|
packet.writeD((int) (Config.TIME_LIMITED_ZONE_INITIAL_TIME / 1000)); // remain time base?
|
||||||
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 12, 0);
|
endTime = _player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 12, 0);
|
||||||
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user