nomz Posted April 29, 2009 Posted April 29, 2009 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.
nomz Posted April 29, 2009 Posted April 29, 2009 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.
Matim Posted May 21, 2010 Posted May 21, 2010 please patch diff scoria!!! You don't know how to add simple voiced command, and you need diff for it? Pff.
webdes27 Posted May 21, 2010 Posted May 21, 2010 In scoria class lacks any differently named. So I can not screw))
Setekh Posted May 21, 2010 Posted May 21, 2010 In scoria class lacks any differently named. So I can not screw)) cant be different >.>
FearDuck Posted May 25, 2010 Posted May 25, 2010 if use mode autoloot in server with this command, bug? ty for share this command and code.
Recommended Posts