+
+
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java
index d17921338b..e06f9e07fd 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java
@@ -63,19 +63,23 @@ public class AdminZone implements IAdminCommandHandler
getGeoRegionXY(activeChar);
activeChar.sendMessage("Closest Town: " + MapRegionManager.getInstance().getClosestTownName(activeChar));
- Location loc;
-
- loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE);
- activeChar.sendMessage("TeleToLocation (Castle): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
-
- loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL);
- activeChar.sendMessage("TeleToLocation (ClanHall): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
-
- loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG);
- activeChar.sendMessage("TeleToLocation (SiegeFlag): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
-
- loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN);
- activeChar.sendMessage("TeleToLocation (Town): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
+ // Prevent exit instance variable deletion.
+ if (!activeChar.isInInstance())
+ {
+ Location loc;
+
+ loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE);
+ activeChar.sendMessage("TeleToLocation (Castle): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
+
+ loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL);
+ activeChar.sendMessage("TeleToLocation (ClanHall): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
+
+ loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG);
+ activeChar.sendMessage("TeleToLocation (SiegeFlag): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
+
+ loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN);
+ activeChar.sendMessage("TeleToLocation (Town): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
+ }
}
else if (actualCommand.equalsIgnoreCase("admin_zone_visual"))
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/custom.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/custom.xml
index 5b2d3489b1..c9b6b84f6c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/custom.xml
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/custom.xml
@@ -1,23 +1,5 @@
-
- ELEMENTAL
- FEMALE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ANIMALMALE
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/tvt_event.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/tvt_event.xml
new file mode 100644
index 0000000000..a867441b79
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/custom/tvt_event.xml
@@ -0,0 +1,22 @@
+
+
+
+ HUMAN
+ MALE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 7163ac783b..4e61159d0b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -674,6 +674,7 @@ public final class L2PcInstance extends L2Playable
@SuppressWarnings("rawtypes")
private volatile Map, AbstractEvent>> _events;
+ private boolean _isOnCustomEvent = false;
public boolean isSpawnProtected()
{
@@ -8149,7 +8150,12 @@ public final class L2PcInstance extends L2Playable
return false;
}
- // Check if the attacker is in TvT and TvT is started
+ if (isOnCustomEvent() && (getTeam() == attacker.getTeam()))
+ {
+ return false;
+ }
+
+ // CoC needs this check?
if (isOnEvent())
{
return true;
@@ -13116,12 +13122,26 @@ public final class L2PcInstance extends L2Playable
_canRevive = val;
}
+ public boolean isOnCustomEvent()
+ {
+ return _isOnCustomEvent;
+ }
+
+ public void setOnCustomEvent(boolean value)
+ {
+ _isOnCustomEvent = value;
+ }
+
/**
* @return {@code true} if player is on event, {@code false} otherwise.
*/
@Override
public boolean isOnEvent()
{
+ if (_isOnCustomEvent)
+ {
+ return true;
+ }
if (_events != null)
{
for (AbstractEvent> listener : _events.values())
@@ -13137,6 +13157,10 @@ public final class L2PcInstance extends L2Playable
public boolean isBlockedFromExit()
{
+ if (_isOnCustomEvent)
+ {
+ return true;
+ }
if (_events != null)
{
for (AbstractEvent> listener : _events.values())
@@ -13152,6 +13176,10 @@ public final class L2PcInstance extends L2Playable
public boolean isBlockedFromDeathPenalty()
{
+ if (_isOnCustomEvent)
+ {
+ return true;
+ }
if (_events != null)
{
for (AbstractEvent> listener : _events.values())
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
index c3686c67be..d1bb6ffa75 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
@@ -63,6 +63,10 @@ public class ConditionPlayerCanEscape extends Condition
{
canTeleport = false;
}
+ else if (player.isOnCustomEvent())
+ {
+ canTeleport = false;
+ }
return (_val == canTeleport);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
index 4ed6708e7f..679e38bdb6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
@@ -64,6 +64,11 @@ public class ConditionPlayerCanTransform extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_TRANSFORM_WHILE_RIDING_A_PET);
canTransform = false;
}
+ else if (player.isOnCustomEvent())
+ {
+ player.sendMessage("You cannot transform while registered on an event.");
+ canTransform = false;
+ }
return (_val == canTransform);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 77c2468437..70464afd7c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -888,19 +888,22 @@ public final class Instance implements IIdentifiable, INamable
*/
public void onDeath(L2PcInstance player)
{
- // Send message
- final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
- sm.addInt(_template.getEjectTime());
- player.sendPacket(sm);
-
- // Start eject task
- _ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.schedule(() ->
+ if (!player.isOnCustomEvent())
{
- if (player.isDead())
+ // Send message
+ final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
+ sm.addInt(_template.getEjectTime());
+ player.sendPacket(sm);
+
+ // Start eject task
+ _ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.schedule(() ->
{
- ejectPlayer(player.getActingPlayer());
- }
- }, _template.getEjectTime() * 60 * 1000)); // minutes to milliseconds
+ if (player.isDead())
+ {
+ ejectPlayer(player.getActingPlayer());
+ }
+ }, _template.getEjectTime() * 60 * 1000)); // minutes to milliseconds
+ }
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index f4fa7592ad..409678ea5a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -365,6 +365,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
public Location getExitLocation(L2PcInstance player)
{
Location location = null;
+
switch (_exitLocationType)
{
case RANDOM:
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java
index 13d16edd56..07d3e538f9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java
@@ -173,8 +173,8 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_BOOKMARK_PACKET(0x4E, ExBookmarkPacket::new, ConnectionState.IN_GAME),
REQUEST_WITHDRAW_PREMIUM_ITEM(0x4F, RequestWithDrawPremiumItem::new, ConnectionState.IN_GAME),
REQUEST_EX_JUMP(0x50, null, ConnectionState.IN_GAME),
- REQUEST_EX_START_SHOW_CRATAE_CUBE_RANK(0x51, null, ConnectionState.IN_GAME),
- REQUEST_EX_STOP_SHOW_CRATAE_CUBE_RANK(0x52, null, ConnectionState.IN_GAME),
+ REQUEST_EX_START_SHOW_CRATAE_CUBE_RANK(0x51, RequestStartShowKrateisCubeRank::new, ConnectionState.IN_GAME),
+ REQUEST_EX_STOP_SHOW_CRATAE_CUBE_RANK(0x52, RequestStopShowKrateisCubeRank::new, ConnectionState.IN_GAME),
NOTIFY_START_MINI_GAME(0x53, null, ConnectionState.IN_GAME),
REQUEST_EX_JOIN_DOMINION_WAR(0x54, null, ConnectionState.IN_GAME),
REQUEST_EX_DOMINION_INFO(0x55, null, ConnectionState.IN_GAME),
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 6c7ebff02e..31e80f64fb 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -29,7 +29,10 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.model.entity.ClanHall;
import com.l2jmobius.gameserver.model.entity.Fort;
+import com.l2jmobius.gameserver.model.events.EventType;
+import com.l2jmobius.gameserver.model.events.listeners.AbstractEventListener;
import com.l2jmobius.gameserver.model.instancezone.Instance;
+import com.l2jmobius.gameserver.model.quest.Event;
import com.l2jmobius.gameserver.model.residences.AbstractResidence;
import com.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import com.l2jmobius.gameserver.network.L2GameClient;
@@ -92,6 +95,19 @@ public final class RequestRestartPoint implements IClientIncomingPacket
return;
}
+ // Custom event resurrection management.
+ if (activeChar.isOnCustomEvent())
+ {
+ for (AbstractEventListener listener : activeChar.getListeners(EventType.ON_CREATURE_DEATH))
+ {
+ if (listener.getOwner() instanceof Event)
+ {
+ ((Event) listener.getOwner()).notifyEvent("ResurrectPlayer", null, activeChar);
+ return;
+ }
+ }
+ }
+
final Castle castle = CastleManager.getInstance().getCastle(activeChar.getX(), activeChar.getY(), activeChar.getZ());
if ((castle != null) && castle.getSiege().isInProgress())
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStartShowKrateisCubeRank.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStartShowKrateisCubeRank.java
new file mode 100644
index 0000000000..d2213e55b6
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStartShowKrateisCubeRank.java
@@ -0,0 +1,39 @@
+/*
+ * 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 com.l2jmobius.gameserver.network.clientpackets;
+
+import com.l2jmobius.commons.network.PacketReader;
+import com.l2jmobius.gameserver.network.L2GameClient;
+
+/**
+ * @author Mobius
+ */
+public class RequestStartShowKrateisCubeRank implements IClientIncomingPacket
+{
+ @Override
+ public boolean read(L2GameClient client, PacketReader packet)
+ {
+ return false;
+ }
+
+ @Override
+ public void run(L2GameClient client)
+ {
+ // TODO: Implement.
+ System.out.println("RequestStartShowKrateisCubeRank");
+ }
+}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStopShowKrateisCubeRank.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStopShowKrateisCubeRank.java
new file mode 100644
index 0000000000..51ca3ea99b
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestStopShowKrateisCubeRank.java
@@ -0,0 +1,39 @@
+/*
+ * 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 com.l2jmobius.gameserver.network.clientpackets;
+
+import com.l2jmobius.commons.network.PacketReader;
+import com.l2jmobius.gameserver.network.L2GameClient;
+
+/**
+ * @author Mobius
+ */
+public class RequestStopShowKrateisCubeRank implements IClientIncomingPacket
+{
+ @Override
+ public boolean read(L2GameClient client, PacketReader packet)
+ {
+ return false;
+ }
+
+ @Override
+ public void run(L2GameClient client)
+ {
+ // TODO: Implement.
+ System.out.println("RequestStopShowKrateisCubeRank");
+ }
+}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCMyRecord.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCMyRecord.java
new file mode 100644
index 0000000000..57547b985e
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCMyRecord.java
@@ -0,0 +1,41 @@
+/*
+ * 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 com.l2jmobius.gameserver.network.serverpackets;
+
+import com.l2jmobius.commons.network.PacketWriter;
+import com.l2jmobius.gameserver.network.OutgoingPackets;
+
+/**
+ * @author Mobius
+ */
+public class ExPVPMatchCCMyRecord implements IClientOutgoingPacket
+{
+ private final int _points;
+
+ public ExPVPMatchCCMyRecord(int points)
+ {
+ _points = points;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_PVP_MATCH_CCMY_RECORD.writeId(packet);
+ packet.writeD(_points);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCRecord.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCRecord.java
new file mode 100644
index 0000000000..b199a7443c
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExPVPMatchCCRecord.java
@@ -0,0 +1,57 @@
+/*
+ * 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 com.l2jmobius.gameserver.network.serverpackets;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import com.l2jmobius.commons.network.PacketWriter;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jmobius.gameserver.network.OutgoingPackets;
+
+/**
+ * @author Mobius
+ */
+public class ExPVPMatchCCRecord implements IClientOutgoingPacket
+{
+ public static final int INITIALIZE = 0;
+ public static final int UPDATE = 1;
+ public static final int FINISH = 2;
+
+ private final int _state;
+ private final Map _players;
+
+ public ExPVPMatchCCRecord(int state, Map players)
+ {
+ _state = state;
+ _players = players;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_PVP_MATCH_CCRECORD.writeId(packet);
+ packet.writeD(_state); // 0 - initialize, 1 - update, 2 - finish
+ packet.writeD(_players.size());
+ for (Entry entry : _players.entrySet())
+ {
+ packet.writeS(entry.getKey().getName());
+ packet.writeD(entry.getValue());
+ }
+ return true;
+ }
+}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
index e551224ab8..850ae469e6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
@@ -31,6 +31,8 @@ import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Locale;
+import java.util.Map;
+import java.util.TreeMap;
import java.util.logging.Logger;
import com.l2jmobius.Config;
@@ -788,4 +790,15 @@ public final class Util
return (input < min) ? min : (input > max) ? max : input;
}
+ /**
+ * Short an map by its integer values.
+ * @param unsortedMap
+ * @return
+ */
+ public static Map sortByValue(Map unsortedMap)
+ {
+ Map sortedMap = new TreeMap<>(new ValueComparator(unsortedMap));
+ sortedMap.putAll(unsortedMap);
+ return sortedMap;
+ }
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/ValueComparator.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/ValueComparator.java
new file mode 100644
index 0000000000..32c494218d
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/ValueComparator.java
@@ -0,0 +1,46 @@
+/*
+ * 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 com.l2jmobius.gameserver.util;
+
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ * @author Mobius
+ */
+public class ValueComparator implements Comparator