Jump to content

Recommended Posts

  • 8 months later...
Posted

here is a working code for l2j

 

Nobless.java

command : .nobless

 

/*

* 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 handlers.voicedcommandhandlers;

 

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

 

/**

* @author Goldendawn

*/

public class Nobless implements IVoicedCommandHandler

{

private static final String[] VOICED_COMMANDS = {"nobless"};

 

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)

{

if (command.equalsIgnoreCase("nobless"))

{

  if (activeChar.isNoble())

            {

            activeChar.sendMessage("You are allready Nobless.");

            return true;

            }

           else if (activeChar.getLevel() < 76)

            {

            activeChar.sendMessage(" can't make you noblesse you have to be 75lvl .");

            return true;

            }

           else if (activeChar.getSubClasses().isEmpty())

           {

            activeChar.sendMessage("Come back with SubClass.");

            return true;

           }

           else if(activeChar.getInventory().getItemByItemId(57) != null && activeChar.getInventory().getItemByItemId(57).getCount() >= 500000000)

           {

            activeChar.getInventory().destroyItemByItemId("Noblesse", 57, 1500000000, activeChar, activeChar.getTarget());

               activeChar.setNoble(true);

               activeChar.broadcastUserInfo();

 

           }

           else

           {

              activeChar.sendMessage("i need 1,5 bilion to make you noblesse.");

               return true;

           }

}

return false;

}

public String[] getVoicedCommandList()

{

return VOICED_COMMANDS;

}

}

 

then you go to masterhandler.java and you register it and complie and you are done

 

i thing i am helpfull for people that need it for l2j

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...