diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 9688896fa7..9573785855 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14557,9 +14557,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index 199d3a6e4b..bde26e3e9d 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -841,7 +841,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22C),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22D),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22E),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22F),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22F),
EX_RANKING_CHAR_INFO(0xFE, 0x230),
EX_RANKING_CHAR_HISTORY(0xFE, 0x231),
EX_RANKING_CHAR_RANKERS(0xFE, 0x232),
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index 102c77cf97..1e67dd9d33 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -151,11 +153,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 01681a070f..35a79249ee 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14627,9 +14627,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index 1a03aa4e8b..7ba1885b82 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -840,7 +840,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22A),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22B),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22C),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22D),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22D),
EX_RANKING_CHAR_INFO(0xFE, 0x22E),
EX_RANKING_CHAR_HISTORY(0xFE, 0x22F),
EX_RANKING_CHAR_RANKERS(0xFE, 0x230),
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index 102c77cf97..1e67dd9d33 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -151,11 +153,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 6a17d751d8..b50ced9b98 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14664,9 +14664,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index 92bd4bd150..5416968a48 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -840,7 +840,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22A),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22B),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22C),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22D),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22D),
EX_RANKING_CHAR_INFO(0xFE, 0x22E),
EX_RANKING_CHAR_HISTORY(0xFE, 0x22F),
EX_RANKING_CHAR_RANKERS(0xFE, 0x230),
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index 102c77cf97..1e67dd9d33 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -151,11 +153,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 402ce38945..edc97604eb 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14554,9 +14554,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index 199d3a6e4b..bde26e3e9d 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -841,7 +841,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22C),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22D),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22E),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22F),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22F),
EX_RANKING_CHAR_INFO(0xFE, 0x230),
EX_RANKING_CHAR_HISTORY(0xFE, 0x231),
EX_RANKING_CHAR_RANKERS(0xFE, 0x232),
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index f874df6924..ebcf57564e 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -151,11 +153,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 7c6f669d7b..fdacd30049 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14815,9 +14815,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index f071f10c83..55b6f3791e 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -840,7 +840,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22A),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22B),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22C),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22D),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22D),
EX_RANKING_CHAR_INFO(0xFE, 0x22E),
EX_RANKING_CHAR_HISTORY(0xFE, 0x22F),
EX_RANKING_CHAR_RANKERS(0xFE, 0x230),
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index 51951469ea..47ff71c2b7 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -159,11 +161,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 7b82279b8b..b141521a17 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneList;
/**
@@ -76,6 +77,7 @@ public class AddHuntingTime extends AbstractEffect
{
player.getVariables().set(PlayerVariables.HUNTING_ZONE_TIME + _zoneId, _time + player.getTimedHuntingZoneRemainingTime(_zoneId));
player.startTimedHuntingZone(_zoneId, endTime);
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else
{
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index e951e87d68..eb222018d9 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14892,9 +14892,7 @@ public class PlayerInstance extends Playable
// Stop previous task.
stopTimedHuntingZoneTask();
- // TODO: Delay window.
- // sendPacket(new TimedHuntingZoneEnter((int) (delay / 60 / 1000)));
- sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
+ // sendMessage("You have " + (delay / 60 / 1000) + " minutes left for this timed zone.");
_timedHuntingZoneTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (isInTimedHuntingZone(zoneId))
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
index 4b35500bcb..6304be0fc7 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/OutgoingPackets.java
@@ -840,7 +840,7 @@ public enum OutgoingPackets
EX_TIME_RESTRICT_FIELD_USER_ENTER(0xFE, 0x22A),
EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT(0xFE, 0x22B),
EX_TIME_RESTRICT_FIELD_USER_ALARM(0xFE, 0x22C),
- EX_TIME_RESTRICT_FIELD_USER_EXIT(0xFE, 0x22D),
+ EX_TIME_RESTRICT_FIELD_USER_CLOSE(0xFE, 0x22D),
EX_RANKING_CHAR_INFO(0xFE, 0x22E),
EX_RANKING_CHAR_HISTORY(0xFE, 0x22F),
EX_RANKING_CHAR_RANKERS(0xFE, 0x230),
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
index 51951469ea..47ff71c2b7 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java
@@ -30,6 +30,8 @@ import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneClose;
+import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZoneEnter;
/**
* @author Mobius
@@ -159,11 +161,15 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
if (instanceId == 0)
{
player.teleToLocation(holder.getEnterLocation());
+ player.sendPacket(new TimedHuntingZoneEnter(player, _zoneId));
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
+
+ // Close window.
+ player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET);
}
else
{
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
new file mode 100644
index 0000000000..24bb180c20
--- /dev/null
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneClose.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class TimedHuntingZoneClose implements IClientOutgoingPacket
+{
+ public static final TimedHuntingZoneClose STATIC_PACKET = new TimedHuntingZoneClose();
+
+ public TimedHuntingZoneClose()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CLOSE.writeId(packet);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
index b30fe94754..bfa61f2576 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneEnter.java
@@ -17,26 +17,33 @@
package org.l2jmobius.gameserver.network.serverpackets.huntingzones;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index, NasSeKa`, Serenitty
*/
public class TimedHuntingZoneEnter implements IClientOutgoingPacket
{
- private final int _remainingTime;
+ private final PlayerInstance _player;
+ private final int _zoneId;
- public TimedHuntingZoneEnter(int remainingTime)
+ public TimedHuntingZoneEnter(PlayerInstance player, int zoneId)
{
- _remainingTime = remainingTime;
+ _player = player;
+ _zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
- packet.writeC(_remainingTime);
+ packet.writeC(0x01); // bEnterSuccess
+ packet.writeD(_zoneId);
+ packet.writeD((int) ((Chronos.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
+ packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
return true;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
index 5acc701e4e..2c93f25c76 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/huntingzones/TimedHuntingZoneExit.java
@@ -21,7 +21,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
- * @author Mobius
+ * @author Mobius, Index
*/
public class TimedHuntingZoneExit implements IClientOutgoingPacket
{
@@ -34,7 +34,8 @@ public class TimedHuntingZoneExit implements IClientOutgoingPacket
@Override
public boolean write(PacketWriter packet)
{
- OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_EXIT.writeId(packet);
+ OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
+ packet.writeC(0x00); // bEnterSuccess
return true;
}
}
\ No newline at end of file