Intrepid Posted February 21, 2009 Posted February 21, 2009 disable or enable the trade for you. credits to me. For L2J CT2.2 /* * 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; /** * @author Intrepid * */ public class tradeoff implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "tradeoff", "tradeon" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if ((command.startsWith("tradeoff"))) { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled"); } if ((command.startsWith("tradeon"))) { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled"); } return true; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }
CriticalError Posted February 21, 2009 Posted February 21, 2009 ohhh very nice info man thanks for script really helpfull =)
StarChild Posted February 21, 2009 Posted February 21, 2009 Really nice idea! Thank you for sharing this, but... How can I use this on L2JFree? PS: Why all you ppl share thisns for L2JServer? :P Thank you in advice.
Intrepid Posted February 21, 2009 Author Posted February 21, 2009 Really nice idea! Thank you for sharing this, but... How can I use this on L2JFree? PS: Why all you ppl share thisns for L2JServer? :P Thank you in advice. everybody share it for l2j because l2j have better support than l2jfree and if something wrong you can get help faster to make it compatible with l2jfree change the imports from net.sf.l2j to com.l2jfree
CriticalError Posted February 21, 2009 Posted February 21, 2009 very grateful for the info man continues making good job ;)
StarChild Posted February 21, 2009 Posted February 21, 2009 Thank you ^^ Hmm, I can't get it... I need to create new .java file or edit existing? If new, then which name I need to use and if existing, which one?
sτrίkε- Posted February 21, 2009 Posted February 21, 2009 huh we start refusals now ? :D:D Very Nice job Mate!
Intrepid Posted February 21, 2009 Author Posted February 21, 2009 Thank you ^^ Hmm, I can't get it... I need to create new .java file or edit existing? If new, then which name I need to use and if existing, which one? You need new one the name is what you want but the name of the file need to be the same like in that line: public class tradeoff implements IVoicedCommandHandler so in my share tradeoff.java and you need to register that name if you dont know how to register: http://www.maxcheaters.com/forum/index.php?topic=44325.0
StarChild Posted February 21, 2009 Posted February 21, 2009 Thank you again :) Allready got this working ^^
KaL Posted June 30, 2009 Posted June 30, 2009 Well, I'm not sure if it works...need test, but I set this in the code ( Nothing exeptional...just for information to the player, not needed ) /* * 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.l2jfree.gameserver.handler.voicedcommandhandlers; import com.l2jfree.gameserver.handler.IVoicedCommandHandler; import com.l2jfree.gameserver.model.actor.instance.L2PcInstance; import com.l2jfree.gameserver.network.SystemMessageId; import com.l2jfree.gameserver.network.serverpackets.SystemMessage; /** * @author Intrepid * */ public class TradeOff implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "tradeoff", "tradeon" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if ((command.startsWith("tradeoff"))) { if(activeChar.getTradeRefusal()) { activeChar.sendMessage("Trade refusal is already enabled!"); } else { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled"); } } if ((command.startsWith("tradeon"))) { if(!activeChar.getTradeRefusal()) { activeChar.sendMessage("Trade refusal is already disabled!"); } else { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled"); } } return true; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }
Recommended Posts