Jump to content
  • 0

[Help] .delevel command


Question

Posted

Okay so I've read this http://www.maxcheaters.com/forum/index.php?topic=76205.0 share.

 

It's for l2emu, so I tried to make it into my L2jserver (freya).

 

Now I don't have L2PcInstance, instead it's named L2Player. Don't bother asking why.

 

And mine looks like this:

 

package com.l2jserver.gameserver.handler.voicedcommandhandlers;

 

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;

import com.l2jserver.gameserver.model.actor.L2Player;

import com.l2jserver.gameserver.model.base.Experience;

 

 

public class delevel implements IVoicedCommandHandler

{

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

 

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

{

if (command.equalsIgnoreCase("delevel"))

{

activeChar.destroyItemByItemId("Consume", 57, 1, activeChar, true);

activeChar.getStat().removeExpAndSp((activeChar.getExp() - Experience.LEVEL[activeChar.getStat().getLevel() - 1]), 0);

}

return true;

 

}

public String[] getVoicedCommandList()

{

return VOICED_COMMANDS;

}

}

 

When I add it in eclipse, it gives me 2 errors, and that's on:

 

public class delevel implements IVoicedCommandHandler

"The public type delevel must be defined in its own file"

 

and

 

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

"The return type is incompatible with IVoicedCommandHandler.useVoicedCommand(String, L2Player, String)"

 

Can anyone give me a working code for this command, or just tell me simply how to do in this case?

Thanks in advance!

3 answers to this question

Recommended Posts

  • 0
Posted

package handlers.voicedcommandhandlers;

instead of

package com.l2jserver.gameserver.handler.voicedcommandhandlers;

The L2Emu code was from the era where handlers were in the core, and not separated in datapack.

 

 

 

The L2Player thing remembers me Archid :D. Anyway, it is nothing related to your problem.

Guest
This topic is now closed to further replies.


×
×
  • Create New...