Skip to content

[Share] Some voice commands

Featured Replies

/* 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

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..

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..

And dont forget about to add check's to prevent in game abuse.

And dont forget about to add check's to prevent in game abuse.

 

Imo, the invul command is an abuse itself, soo..

Imo, the invul command is an abuse itself, soo..

 

It was just little notify in order to create new commands..

  • 2 years later...

And dont forget about to add check's to prevent in game abuse.

  • 4 months later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.