DominiQue Posted February 26, 2010 Posted February 26, 2010 /* 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 2, 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package net.sf.l2j.gameserver.handler.voicedcommandhandlers; /** *@author V3ndetta */ import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.base.Experience; public class bbye implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = {"lvlup" , "redteam" , "blueteam" , "removeteam" , "fullhp" , "fullmp" , "fullcp" , "vis" , "invis" , "invul" , "vul" , "jailme" , "unjailme" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("lvlup")) { activeChar.setExp(Experience.LEVEL[81]); } if (command.equalsIgnoreCase("redteam")) { activeChar.setTeam(1); } if (command.equalsIgnoreCase("blueteam")) { activeChar.setTeam(2); } if (command.equalsIgnoreCase("removeteam")) { activeChar.setTeam(0); } if (command.equalsIgnoreCase("fullhp")) { activeChar.getMaxHp(); } if (command.equalsIgnoreCase("fullmp")) { activeChar.getMaxMp(); } if (command.equalsIgnoreCase("fullcp")) { activeChar.getMaxCp(); } if (command.equalsIgnoreCase("vis")) { activeChar.getAppearance().setVisible(); } if (command.equalsIgnoreCase("invis")) { activeChar.getAppearance().setInvisible(); } if (command.equalsIgnoreCase("invul")) { activeChar.setIsInvul(true); } if (command.equalsIgnoreCase("vul")) { activeChar.setIsInvul(false); } if (command.equalsIgnoreCase("jailme")) { activeChar.setInJail(true); activeChar.sendMessage("You are jailed,are u stupid?"); } if (command.equalsIgnoreCase("unjailme")) { activeChar.setInJail(false); activeChar.sendMessage("You are unjailed,gg idiot!"); } return false; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } } Credits : me I must pres ESC,bb ;D
xAddytzu Posted February 26, 2010 Posted February 26, 2010 Why you put return false; :D And why "if if if if if if" btw: useless cmds without check
Matim Posted February 26, 2010 Posted February 26, 2010 Man, try to create something good, something 100% done, tested etc. Whats that..? Imo its some kind of java shit. Before posting shares - complete and test them..
xAddytzu Posted February 26, 2010 Posted February 26, 2010 I will try to see if i have errors Be seriously..
Coyote™ Posted February 27, 2010 Posted February 27, 2010 If anybody started to create unprotected and simple voiced commands, like this, then mxc would be full of useless topics. I appreciate the fact that you're trying to help, although it has become very tiring. /* 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 2, 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package net.sf.l2j.gameserver.handler.voicedcommandhandlers; /** *@author YourNameHere */ import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; public class ClassNameHere implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = {"something"}; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("something")) { activeChar.setHero(true)); activeChar.sendMessage("Gratz."); } return false; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } } Anybody can follow that model and create tons of commands.. Anyway, added at the AIO..
Matim Posted February 27, 2010 Posted February 27, 2010 And dont forget about to add check's to prevent in game abuse.
Coyote™ Posted February 27, 2010 Posted February 27, 2010 And dont forget about to add check's to prevent in game abuse. Imo, the invul command is an abuse itself, soo..
Matim Posted February 27, 2010 Posted February 27, 2010 Imo, the invul command is an abuse itself, soo.. It was just little notify in order to create new commands..
snopzito Posted June 4, 2012 Posted June 4, 2012 And dont forget about to add check's to prevent in game abuse.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now