Index: data/scripts/commands/admin/AdminInstance.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/data/scripts/commands/admin/AdminInstance.java b/data/scripts/commands/admin/AdminInstance.java
--- a/data/scripts/commands/admin/AdminInstance.java
+++ b/data/scripts/commands/admin/AdminInstance.java (date 1715339112448)
@@ -3,6 +3,7 @@
import l2open.extensions.scripts.ScriptFile;
import l2open.gameserver.handler.AdminCommandHandler;
import l2open.gameserver.handler.IAdminCommandHandler;
+import l2open.gameserver.instancemanager.InstancedZoneManager;
import l2open.gameserver.model.L2ObjectsStorage;
import l2open.gameserver.model.L2Player;
import l2open.gameserver.model.Reflection;
@@ -14,7 +15,8 @@
private static enum Commands
{
admin_instance,
- admin_instance_id
+ admin_instance_id,
+ admin_instances_reset
}
public boolean useAdminCommand(Enum comm, String[] wordList, String fullString, L2Player activeChar)
@@ -33,6 +35,11 @@
if(wordList.length > 1)
listOfCharsForInstance(activeChar, wordList[1]);
break;
+ case admin_instances_reset:
+ {
+ L2Player player = activeChar.getPlayer().getTarget() == null || !activeChar.getPlayer().getTarget().isPlayer() ? activeChar : activeChar.getPlayer().getTarget().getPlayer();
+ resetInstancesForTarget(player);
+ }
}
return true;
@@ -99,6 +106,18 @@
activeChar.sendPacket(adminReply);
}
+ private void resetInstancesForTarget(L2Player target)
+ {
+ if (target == null)
+ {
+ return;
+ }
+ for (String instanceName : InstancedZoneManager.getInstance().getNames())
+ {
+ target.unsetVar(instanceName);
+ }
+ }
+
public void onLoad()
{
AdminCommandHandler.getInstance().registerAdminCommandHandler(this);