Jump to content

Recommended Posts

Posted

Hello there, this is my latest share which with some editing by yourself can do many things. A player pays a fee set by you, and he places and a trap with a selected message. If someone steps on the trap, this message displays at the announcements. That means you can write something humiliating. Also by using %player in your message, the victim's name is being displayed in the message. If you have some basic knowledge you can make it do more stuff. For example, if user steps on the trap and he is not in combat, the player will be teleported to a location that the owner has set, or be paralyzed for some seconds.

 

Coded and tested on l2jpes. (interlude)

 

### Eclipse Workspace Patch 1.0
#P gameserver
Index: java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java
===================================================================
--- java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java	(revision 0)
+++ java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java	(working copy)
@@ -0,0 +1,69 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.handler.voicedcommandhandlers;
+
+import com.l2jpes.Config;
+import com.l2jpes.gameserver.custom.TrapEvent;
+import com.l2jpes.gameserver.handler.IVoicedCommandHandler;
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+/**
+ * @author Pauler
+ */
+public class TrapCmd implements IVoicedCommandHandler
+{
+
+	private String[] commands = {
+		"settrap"
+	};
+	
+	@Override
+	public boolean useVoicedCommand(String command, L2PlayerInstance activeChar, String[] commandParams)
+	{
+		if (!TrapEvent.checkIfUserHasTooManytraps(activeChar)) {
+			if (activeChar.getInventory().getInventoryItemCount(Config.TRAP_COST_ID, 0) >= Config.TRAP_COST_QUANTITY) {
+				if (!activeChar.isInCombat()) {
+					if (commandParams != null && commandParams.length != 0) {
+						activeChar.getInventory().destroyItemByItemId("Buying Traps.", Config.TRAP_COST_ID, Config.TRAP_COST_QUANTITY, activeChar, activeChar);
+						
+						activeChar.sendMessage("You placed a trap.");
+						
+						String message = "";
+						
+						for (String string: commandParams) {
+							message = message + " " + string;
+						}
+						
+						TrapEvent.placetrap(activeChar, message);
+					}else
+						activeChar.sendMessage("You have to write a message after the command");
+				}else
+					activeChar.sendMessage("You cannot be in combat while you are placing a trap.");
+			}else
+				activeChar.sendMessage("You don't have enough items.");
+		}else
+			activeChar.sendMessage("You have already placed too many traps.");
+		
+		return false;
+	}
+
+
+	@Override
+	public String[] getVoicedCommandList()
+	{
+		return commands;
+	}
+	
+}
Index: java/com/l2jpes/Config.java
===================================================================
--- java/com/l2jpes/Config.java	(revision 5)
+++ java/com/l2jpes/Config.java	(working copy)
@@ -223,6 +223,12 @@
	public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
	public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;

+	/** Traps */
+	public static int TRAP_COST_ID;
+	public static int TRAP_COST_QUANTITY;
+	public static int TRAP_RADIUS;
+	public static int MAX_TRAPS_PER_USER;
+	
	// --------------------------------------------------
	// HexID
	// --------------------------------------------------
@@ -875,6 +881,11 @@
			ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000);
			ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000);

+			TRAP_COST_ID = events.getProperty("TrapCostId", 57);
+			TRAP_COST_QUANTITY = events.getProperty("TrapCostQuantity", 1000);
+			TRAP_RADIUS = events.getProperty("TrapRadius", 20);
+			MAX_TRAPS_PER_USER = events.getProperty("MaxTrapsPerUser", 5);
+			
			// FloodProtector
			ExProperties security = load(FLOOD_PROTECTOR_FILE);
			loadFloodProtectorConfig(security, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
Index: java/com/l2jpes/gameserver/custom/Trap.java
===================================================================
--- java/com/l2jpes/gameserver/custom/Trap.java	(revision 0)
+++ java/com/l2jpes/gameserver/custom/Trap.java	(working copy)
@@ -0,0 +1,55 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.custom;
+
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+/**
+ * @author Pauler
+ */
+public class Trap
+{
+	private L2PlayerInstance _owner;
+	private int _x, _y, _z;
+	private String _message;
+	
+	public Trap(L2PlayerInstance owner, String message) {
+		_owner = owner;
+		_x = owner.getX();
+		_y = owner.getY();
+		_z = owner.getZ();
+		_message = message;
+	}
+	
+	public L2PlayerInstance getOwner() {
+		return _owner;
+	}
+	
+	public int getX() {
+		return _x;
+	}
+	
+	public int getY() {
+		return _y;
+	}
+	
+	public int getZ() {
+		return _z;
+	}
+	
+	public String getMessage() {
+		return _message;
+	}
+}
Index: java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java	(revision 13)
+++ java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java	(working copy)
@@ -20,6 +20,7 @@

import com.l2jpes.Config;
import com.l2jpes.gameserver.handler.voicedcommandhandlers.L2JPesCmd;
+import com.l2jpes.gameserver.handler.voicedcommandhandlers.TrapCmd;

public class VoicedCommandHandler
{
@@ -35,7 +36,7 @@
     {
         _datatable = new TIntObjectHashMap<>();
         registerVoicedCommandHandler(new L2JPesCmd());
-        
+        registerVoicedCommandHandler(new TrapCmd());
     }

     private void registerVoicedCommandHandler(IVoicedCommandHandler handler)
Index: config/events.properties
===================================================================
--- config/events.properties	(revision 5)
+++ config/events.properties	(working copy)
@@ -245,4 +245,21 @@
AltFishChampionshipReward2 = 500000
AltFishChampionshipReward3 = 300000
AltFishChampionshipReward4 = 200000
-AltFishChampionshipReward5 = 100000
\ No newline at end of file
+AltFishChampionshipReward5 = 100000
+
+#=============================================================
+#                     Traps By Pauler
+#=============================================================
+
+#The id of the item you need to give
+#to set a trap.
+TrapCostId = 57
+
+#The quantity of this item.
+TrapCostQuantity = 1000
+
+#The max distance between you and the trap to activate it.
+TrapRadius = 20
+
+#Max traps that a user can place.
+MaxTrapsPerUser = 5
Index: java/com/l2jpes/gameserver/GameServer.java
===================================================================
--- java/com/l2jpes/gameserver/GameServer.java	(revision 13)
+++ java/com/l2jpes/gameserver/GameServer.java	(working copy)
@@ -20,6 +20,7 @@
import com.l2jpes.gameserver.cache.CrestCache;
import com.l2jpes.gameserver.cache.HtmCache;
import com.l2jpes.gameserver.communitybbs.Manager.ForumsBBSManager;
+import com.l2jpes.gameserver.custom.TrapEvent;
import com.l2jpes.gameserver.datatables.AccessLevels;
import com.l2jpes.gameserver.datatables.AdminCommandAccessRights;
import com.l2jpes.gameserver.datatables.ArmorSetsTable;
@@ -181,6 +182,10 @@
		GmListTable.getInstance();
		RaidBossPointsManager.getInstance();

+		Util.printSection("Custom");
+		TrapEvent.getInstance();
+		_log.info("Trap Event has started.");
+		
		Util.printSection("Community server");
		if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
			ForumsBBSManager.getInstance().initRoot();
Index: java/com/l2jpes/gameserver/custom/TrapEvent.java
===================================================================
--- java/com/l2jpes/gameserver/custom/TrapEvent.java	(revision 0)
+++ java/com/l2jpes/gameserver/custom/TrapEvent.java	(working copy)
@@ -0,0 +1,80 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.custom;
+
+import com.l2jpes.Config;
+import com.l2jpes.gameserver.Announcements;
+import com.l2jpes.gameserver.ThreadPoolManager;
+import com.l2jpes.gameserver.model.L2World;
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * @author Pauler
+ */
+public class TrapEvent
+{
+	public static List<Trap> placedtraps;
+	
+	public static void getInstance() {
+		placedtraps = new CopyOnWriteArrayList<>();
+		
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable() {
+			
+			@Override
+			public void run() {			
+				for (Trap trap:placedtraps) {
+					for (L2PlayerInstance player: L2World.getInstance().getAllPlayers().values()) {
+						if (player.isInsideRadius(trap.getX(), trap.getY(), Config.TRAP_RADIUS, false) && player != trap.getOwner()) {
+							player.sendMessage("You stepped on a trap.");
+							
+							String message = trap.getMessage();
+							message = message.replaceAll("%player", player.getName());
+							
+							Announcements.announceToAll(message);
+							
+							removetrap(trap);
+						}
+					}
+				}	
+			}
+			
+		}, 10000, 1000);
+	}
+	
+	public static boolean checkIfUserHasTooManytraps(L2PlayerInstance player) {
+		int placedtrapsByUser = 0;
+		
+		for (Trap trap:placedtraps) {
+			if (trap.getOwner() == player)
+				placedtrapsByUser++;
+		}
+		
+		if (placedtrapsByUser < Config.MAX_TRAPS_PER_USER)
+			return false;
+		
+		return true;
+	}
+	
+	public static void placetrap(L2PlayerInstance player, String message) {
+		placedtraps.add(new Trap(player, message));
+	}
+	
+	public static void removetrap(Trap trap) {
+		placedtraps.remove(trap);
+	}
+}

 

If I stop being so lazy, I will upload a video.

Posted

I was sure from the first time that you use threadpool to trigger the trap before even reading, if you want to get rid of it use validateposition or something. Nevermind its a nice share

Posted

Hello there, this is my latest share which with some editing by yourself can do many things. A player pays a fee set by you, and he places and a trap with a selected message. If someone steps on the trap, this message displays at the announcements. That means you can write something humiliating. Also by using %player in your message, the victim's name is being displayed in the message. If you have some basic knowledge you can make it do more stuff. For example, if user steps on the trap and he is not in combat, the player will be teleported to a location that the owner has set, or be paralyzed for some seconds.

 

Coded and tested on l2jpes. (interlude)

 

### Eclipse Workspace Patch 1.0
#P gameserver
Index: java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java
===================================================================
--- java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java	(revision 0)
+++ java/com/l2jpes/gameserver/handler/voicedcommandhandlers/TrapCmd.java	(working copy)
@@ -0,0 +1,69 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.handler.voicedcommandhandlers;
+
+import com.l2jpes.Config;
+import com.l2jpes.gameserver.custom.TrapEvent;
+import com.l2jpes.gameserver.handler.IVoicedCommandHandler;
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+/**
+ * @author Pauler
+ */
+public class TrapCmd implements IVoicedCommandHandler
+{
+
+	private String[] commands = {
+		"settrap"
+	};
+	
+	@Override
+	public boolean useVoicedCommand(String command, L2PlayerInstance activeChar, String[] commandParams)
+	{
+		if (!TrapEvent.checkIfUserHasTooManytraps(activeChar)) {
+			if (activeChar.getInventory().getInventoryItemCount(Config.TRAP_COST_ID, 0) >= Config.TRAP_COST_QUANTITY) {
+				if (!activeChar.isInCombat()) {
+					if (commandParams != null && commandParams.length != 0) {
+						activeChar.getInventory().destroyItemByItemId("Buying Traps.", Config.TRAP_COST_ID, Config.TRAP_COST_QUANTITY, activeChar, activeChar);
+						
+						activeChar.sendMessage("You placed a trap.");
+						
+						String message = "";
+						
+						for (String string: commandParams) {
+							message = message + " " + string;
+						}
+						
+						TrapEvent.placetrap(activeChar, message);
+					}else
+						activeChar.sendMessage("You have to write a message after the command");
+				}else
+					activeChar.sendMessage("You cannot be in combat while you are placing a trap.");
+			}else
+				activeChar.sendMessage("You don't have enough items.");
+		}else
+			activeChar.sendMessage("You have already placed too many traps.");
+		
+		return false;
+	}
+
+
+	@Override
+	public String[] getVoicedCommandList()
+	{
+		return commands;
+	}
+	
+}
Index: java/com/l2jpes/Config.java
===================================================================
--- java/com/l2jpes/Config.java	(revision 5)
+++ java/com/l2jpes/Config.java	(working copy)
@@ -223,6 +223,12 @@
	public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
	public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;

+	/** Traps */
+	public static int TRAP_COST_ID;
+	public static int TRAP_COST_QUANTITY;
+	public static int TRAP_RADIUS;
+	public static int MAX_TRAPS_PER_USER;
+	
	// --------------------------------------------------
	// HexID
	// --------------------------------------------------
@@ -875,6 +881,11 @@
			ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000);
			ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000);

+			TRAP_COST_ID = events.getProperty("TrapCostId", 57);
+			TRAP_COST_QUANTITY = events.getProperty("TrapCostQuantity", 1000);
+			TRAP_RADIUS = events.getProperty("TrapRadius", 20);
+			MAX_TRAPS_PER_USER = events.getProperty("MaxTrapsPerUser", 5);
+			
			// FloodProtector
			ExProperties security = load(FLOOD_PROTECTOR_FILE);
			loadFloodProtectorConfig(security, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
Index: java/com/l2jpes/gameserver/custom/Trap.java
===================================================================
--- java/com/l2jpes/gameserver/custom/Trap.java	(revision 0)
+++ java/com/l2jpes/gameserver/custom/Trap.java	(working copy)
@@ -0,0 +1,55 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.custom;
+
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+/**
+ * @author Pauler
+ */
+public class Trap
+{
+	private L2PlayerInstance _owner;
+	private int _x, _y, _z;
+	private String _message;
+	
+	public Trap(L2PlayerInstance owner, String message) {
+		_owner = owner;
+		_x = owner.getX();
+		_y = owner.getY();
+		_z = owner.getZ();
+		_message = message;
+	}
+	
+	public L2PlayerInstance getOwner() {
+		return _owner;
+	}
+	
+	public int getX() {
+		return _x;
+	}
+	
+	public int getY() {
+		return _y;
+	}
+	
+	public int getZ() {
+		return _z;
+	}
+	
+	public String getMessage() {
+		return _message;
+	}
+}
Index: java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java	(revision 13)
+++ java/com/l2jpes/gameserver/handler/VoicedCommandHandler.java	(working copy)
@@ -20,6 +20,7 @@

import com.l2jpes.Config;
import com.l2jpes.gameserver.handler.voicedcommandhandlers.L2JPesCmd;
+import com.l2jpes.gameserver.handler.voicedcommandhandlers.TrapCmd;

public class VoicedCommandHandler
{
@@ -35,7 +36,7 @@
     {
         _datatable = new TIntObjectHashMap<>();
         registerVoicedCommandHandler(new L2JPesCmd());
-        
+        registerVoicedCommandHandler(new TrapCmd());
     }

     private void registerVoicedCommandHandler(IVoicedCommandHandler handler)
Index: config/events.properties
===================================================================
--- config/events.properties	(revision 5)
+++ config/events.properties	(working copy)
@@ -245,4 +245,21 @@
AltFishChampionshipReward2 = 500000
AltFishChampionshipReward3 = 300000
AltFishChampionshipReward4 = 200000
-AltFishChampionshipReward5 = 100000
\ No newline at end of file
+AltFishChampionshipReward5 = 100000
+
+#=============================================================
+#                     Traps By Pauler
+#=============================================================
+
+#The id of the item you need to give
+#to set a trap.
+TrapCostId = 57
+
+#The quantity of this item.
+TrapCostQuantity = 1000
+
+#The max distance between you and the trap to activate it.
+TrapRadius = 20
+
+#Max traps that a user can place.
+MaxTrapsPerUser = 5
Index: java/com/l2jpes/gameserver/GameServer.java
===================================================================
--- java/com/l2jpes/gameserver/GameServer.java	(revision 13)
+++ java/com/l2jpes/gameserver/GameServer.java	(working copy)
@@ -20,6 +20,7 @@
import com.l2jpes.gameserver.cache.CrestCache;
import com.l2jpes.gameserver.cache.HtmCache;
import com.l2jpes.gameserver.communitybbs.Manager.ForumsBBSManager;
+import com.l2jpes.gameserver.custom.TrapEvent;
import com.l2jpes.gameserver.datatables.AccessLevels;
import com.l2jpes.gameserver.datatables.AdminCommandAccessRights;
import com.l2jpes.gameserver.datatables.ArmorSetsTable;
@@ -181,6 +182,10 @@
		GmListTable.getInstance();
		RaidBossPointsManager.getInstance();

+		Util.printSection("Custom");
+		TrapEvent.getInstance();
+		_log.info("Trap Event has started.");
+		
		Util.printSection("Community server");
		if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
			ForumsBBSManager.getInstance().initRoot();
Index: java/com/l2jpes/gameserver/custom/TrapEvent.java
===================================================================
--- java/com/l2jpes/gameserver/custom/TrapEvent.java	(revision 0)
+++ java/com/l2jpes/gameserver/custom/TrapEvent.java	(working copy)
@@ -0,0 +1,80 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jpes.gameserver.custom;
+
+import com.l2jpes.Config;
+import com.l2jpes.gameserver.Announcements;
+import com.l2jpes.gameserver.ThreadPoolManager;
+import com.l2jpes.gameserver.model.L2World;
+import com.l2jpes.gameserver.model.actor.instance.L2PlayerInstance;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * @author Pauler
+ */
+public class TrapEvent
+{
+	public static List<Trap> placedtraps;
+	
+	public static void getInstance() {
+		placedtraps = new CopyOnWriteArrayList<>();
+		
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable() {
+			
+			@Override
+			public void run() {			
+				for (Trap trap:placedtraps) {
+					for (L2PlayerInstance player: L2World.getInstance().getAllPlayers().values()) {
+						if (player.isInsideRadius(trap.getX(), trap.getY(), Config.TRAP_RADIUS, false) && player != trap.getOwner()) {
+							player.sendMessage("You stepped on a trap.");
+							
+							String message = trap.getMessage();
+							message = message.replaceAll("%player", player.getName());
+							
+							Announcements.announceToAll(message);
+							
+							removetrap(trap);
+						}
+					}
+				}	
+			}
+			
+		}, 10000, 1000);
+	}
+	
+	public static boolean checkIfUserHasTooManytraps(L2PlayerInstance player) {
+		int placedtrapsByUser = 0;
+		
+		for (Trap trap:placedtraps) {
+			if (trap.getOwner() == player)
+				placedtrapsByUser++;
+		}
+		
+		if (placedtrapsByUser < Config.MAX_TRAPS_PER_USER)
+			return false;
+		
+		return true;
+	}
+	
+	public static void placetrap(L2PlayerInstance player, String message) {
+		placedtraps.add(new Trap(player, message));
+	}
+	
+	public static void removetrap(Trap trap) {
+		placedtraps.remove(trap);
+	}
+}

 

If I stop being so lazy, I will upload a video.

Good idea! Keep Sharing...! Thanks You :)

Posted

I was sure from the first time that you use threadpool to trigger the trap before even reading, if you want to get rid of it use validateposition or something. Nevermind its a nice share

Good for ya genius.
Posted

This should have been done in ValidatePosition packet, like xdem said, otherwise it can be inaccurate.

 

Good share though.

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hey everyone, I was wondering if anyone knows where the client loads all the .dat files. Is there some kind of manifest or list you can specify which dat files the client loads?
    • 🔥 Welcome to Lineage 2 Haruna x3 – True Classic Interlude Experience 🔥 At Haruna x3, we’re bringing back the true essence of Interlude – slow, meaningful progression where every level matters, every item has value, and PvP is real. We’re not about fast servers, pay-to-win advantages, or fake populations. Our goal is simple: create a fair, stable, and long-term server where players can enjoy real competition, strategic clan warfare, and the thrill of open-world PvP. 💎 What Makes Haruna x3 Special? x3 Rates – Perfect for steady, rewarding progression Classic Interlude Mechanics – Relive the nostalgia of Interlude Stable & Lag-Free Gameplay – Optimized for thousands of players online Fair & Balanced – No pay-to-win, every victory is earned PvP & Clan Warfare Focused – Every battle counts 🌟 Quality of Life Features to Enhance Your Experience We keep the classic feel while adding features that make the game more convenient and enjoyable, including: Shift + Click to view monster droplists Free item mail and buy/sell via Adena Daily login rewards & Stream Rewards ALT+K Skill Panel & Alt+Click buffs removal Offline shop system Captcha for security Donate Coins currency (cannot be traded, dropped, or destroyed) Classic P110 client – no custom interface 🏰 Our Philosophy We believe Lineage 2 is about the journey, not just the destination. Haruna x3 is designed for months and years of growth, not weeks. We provide a community-driven environment where honest gameplay, fair competition, and strategic teamwork are at the forefront. 🌍 Join Our Community Whether you’re a veteran of Interlude or a returning player seeking a true classic experience, Haruna x3 offers a place to fight, trade, and grow alongside dedicated players. Step into the world of Haruna x3 – where every decision matters, every fight counts, and every victory is yours to earn. Discord: https://discord.gg/7DDC9Dsxnh Website : www.l2haruna.com
    • No, the real purpose is cheating and custom  development for games.  I'm building a custom AI moderator specially for checking illegal activity and flag current topica.
    • Hello trying to edit Armorgrp_Classic.dat using L2ClientDat Editor - l2jmobius edition I can normally open a file but can't save, even can't save "clean" version of file (just open and then click save) Other files i can normally open, edit and save. but there is problem with Armorgrp_Classic.dat Anyone find solution, or other Editor for protocol 166 ?   [25/12 15:10:11] --------------------------------------- [25/12 15:10:11] Open file: Armorgrp_Classic.dat [25/12 15:10:11] File Armorgrp_Classic.dat encrypted. Lineage2Ver413 decrypt ... [25/12 15:10:11] Decrypt Armorgrp_Classic.dat file successfully by v413_encdec decrypter. [25/12 15:10:11] Read the file structure ... [25/12 15:10:11] Unpacking [L2GameDataName.dat] [25/12 15:10:11] GameDataName: Load 97534 count. [25/12 15:10:11] Completed. [25/12 15:11:32] Wrong param count for wrapper: fertheia_mesh_add, paramIndex: 1, params: {{{[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11;[none]};{{109;114};{0;-1};{109;114};{0;-1};{109;114}}};{[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None]};[None]} -node: fertheia_mesh_add[WRAPPER][null][null] param: {{{[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11;[none]};{{109;114};{0;-1};{109;114};{0;-1};{109;114}}};{[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None]};[None]} org.l2jmobius.xml.exceptions.PackDataException: Wrong param count for wrapper: fertheia_mesh_add, paramIndex: 1, params: {{{[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11;[none]};{{109;114};{0;-1};{109;114};{0;-1};{109;114}}};{[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None]};[None]} -node: fertheia_mesh_add[WRAPPER][null][null] param: {{{[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11];[None];[LineageAccessory3.fertheia_pvp_Hrm_ad11;[none]};{{109;114};{0;-1};{109;114};{0;-1};{109;114}}};{[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None];[Mantleguild.kingdom.E_elmd_1_t00];[None]};[None]} at org.l2jmobius.xml.DescriptorWriter.packData(DescriptorWriter.java:275) at org.l2jmobius.xml.DescriptorWriter.packData(DescriptorWriter.java:184) at org.l2jmobius.xml.DescriptorWriter.parseData(DescriptorWriter.java:100) at org.l2jmobius.actions.SaveDat.action(SaveDat.java:70) at org.l2jmobius.actions.ActionTask.doInBackground(ActionTask.java:48) at org.l2jmobius.actions.ActionTask.doInBackground(ActionTask.java:27) at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:303) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328) at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:340) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619) at java.base/java.lang.Thread.run(Thread.java:1447) [25/12 15:11:32] buff == null.  
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock