Jump to content

Recommended Posts

Posted

Diff/patch files are always appreciated over finished code, but thanks, just what I was looking for (since some players like having AL on, and some do not).

 

And lol at people not understanding how the loot distribution will work in partys. Silly kids. If the person with last hit has autoloot on, that means everyone in the party autoloots from that kill. At least that's how I understand it to work.

Posted

Cleaned up (this is for L2J Core/DP = 2941/5975)

 

autoloot.java in L2JServer\gameserver\data\scripts\handlers\voicedcommandhandlers

package handlers.voicedcommandhandlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

/**
* @author Cobra
*/

public class autoloot implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS =
private static String[] _voicedCommands =
{
	"autolooton",
	"autolootoff"
};

public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	if (command.equalsIgnoreCase("autolooton"))
	{
		activeChar.setAutoLootEnabled(true);
		activeChar.sendMessage("Auto loot is now enabled.");
	}
	else if (command.equalsIgnoreCase("autolootoff"))
	{
		activeChar.setAutoLootEnabled(false);
		activeChar.sendMessage("Auto loot is now disabled.");
	}
	return true;
}
}

 

 

Master handler patch (DP):

Index: D:/Documents/workspace/L2JDP/datapack_development/data/scripts/handlers/MasterHandler.java
===================================================================
--- D:/Documents/workspace/L2JDP/datapack_development/data/scripts/handlers/MasterHandler.java	(revision 5990)
+++ D:/Documents/workspace/L2JDP/datapack_development/data/scripts/handlers/MasterHandler.java	(working copy)
@@ -176,6 +176,7 @@
import handlers.voicedcommandhandlers.Banking;
import handlers.voicedcommandhandlers.Wedding;
import handlers.voicedcommandhandlers.stats;
+import handlers.voicedcommandhandlers.autoloot;

import java.util.logging.Logger;

@@ -382,6 +383,7 @@
	private static void loadVoicedHandlers()
	{
		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());
+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new autoloot());
		if (Config.L2JMOD_ALLOW_WEDDING)
			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());
		if (Config.BANKING_SYSTEM_ENABLED)

 

 

Edit: you didn't close the comment tag on the gnu license, so bleh, removed it. Plus it wasn't the standard license text that I know, so I was just like "meh, too lazy to copy the new one".

 

Edit2: You forgot to include the code for L2Pcinstance. This just shows that most people replying in contrib threads never bother to try stuff out first. They just want to get their post count up.

  • 2 weeks later...
  • 1 year later...
Posted

please patch diff scoria!!!

 

You don't know how to add simple voiced command, and you need diff for it? Pff.

  • Vision changed the title to Voiced Command [autoloot on off]
  • Vision locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...