This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
XtreMpOweR
Hello guys. I have imp,emented the nobess command. It work partial. It set you nobless but don't delete the items needed for nobless. Here is the code:
package handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 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("You need level 75 for Nobless"); return true; } else if (activeChar.getSubClasses().isEmpty()) { activeChar.sendMessage("Try again when you make a subclass"); return true; } else if(activeChar.getInventory().getItemByItemId(20191) != null && activeChar.getInventory().getItemByItemId(20191).getCount() >= 30) { activeChar.getInventory().destroyItemByItemId("Noblesse", 20191, 30, activeChar, activeChar.getTarget()); activeChar.setNoble(true); activeChar.broadcastUserInfo(); } else { activeChar.sendMessage("You need 30 Valentine Cake Recipe for have Nobless Status."); return true; } } return false; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }5 answers to this question
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