Jump to content
  • 0

some body can repair this code?? please :S


Question

Posted

this code doesn't work some body can repair for l2j gracia final please :S thanks

 

 

package handlers.voicedcommandhandler;

 

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;

import net.sf.l2j.gameserver.instancemanager.CastleManager;

import net.sf.l2j.gameserver.model.L2World;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

 

 

public class wannapwn implements IVoicedCommandHandler

{

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

 

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

    { 

     

        if (command.equalsIgnoreCase("wannapwn"))

        {

 

          if (activeChar == null)

              {

                return false;

              }

     

            L2PcInstance player;

            String targetName = command.substring(17);

            player =  L2World.getInstance().getPlayer(targetName);

 

            if(player == null)

            {

                activeChar.sendMessage("Your target is not online.");

                return false;

            }

            else if(player.isInJail())

            {

                activeChar.sendMessage("Your target is in Jail.");

                return false;

            }

            else if(player.isInOlympiadMode())

            {

                activeChar.sendMessage("Your target is in the Olympiad now.");

                return false;

            }

            else if(player.atEvent)

            {

                activeChar.sendMessage("Your target is in an event.");

                return false;

            }

            else  if (player.isInDuel())

            {

                activeChar.sendMessage("Your target is in a duel.");

                return false;

            }

            else if (player.isFestivalParticipant())

            {

                activeChar.sendMessage("Your target is in a festival.");

                return false;

            }

            else if (player.isInParty() && player.getParty().isInDimensionalRift())

            {

                activeChar.sendMessage("Your target is in dimensional rift.");

                return false;

            }

            else if (player.inObserverMode())

            {

              activeChar.sendMessage("Your target is in the observation.");

            }

            else if(player.getClan() != null

                  && CastleManager.getInstance().getCastleByOwner(player.getClan()) != null

                  && CastleManager.getInstance().getCastleByOwner(player.getClan()).getSiege().getIsInProgress())

            {

              activeChar.sendMessage("Your target is in siege, you can't go to your leader.");

              return false;

            }

 

            else if(activeChar.isInJail())

            {

                activeChar.sendMessage("You are in Jail!");

                return false;

            }

            else if(activeChar.isInOlympiadMode())

            {

                activeChar.sendMessage("You are in the Olympiad now.");

                return false;

            }

            else if(activeChar.atEvent)

            {

                activeChar.sendMessage("You are in an event.");

                return false;

            }

            else  if (activeChar.isInDuel())

            {

                activeChar.sendMessage("You are in a duel!");

                return false;

            }

            else if (activeChar.inObserverMode())

            {

              activeChar.sendMessage("You are in the observation.");

            }

            else if(activeChar.getClan() != null

                  && CastleManager.getInstance().getCastleByOwner(activeChar.getClan()) != null

                  && CastleManager.getInstance().getCastleByOwner(activeChar.getClan()).getSiege().getIsInProgress())

            {

              activeChar.sendMessage("You are in siege, you can't go to your target.");

              return false;

            }

            else if (activeChar.isFestivalParticipant())

            {

                activeChar.sendMessage("You are in a festival.");

                return false;

            }

            else if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())

            {

                activeChar.sendMessage("You are in the dimensional rift.");

                return false;

            }

            else if (activeChar == player)

            {

                activeChar.sendMessage("You cannot teleport to yourself.");

                return false;

            }

            else if (player.getPvpKills() == 10)

            {

            activeChar.sendMessage("Your target doesn´t have 10 pvp kills");

            }

           

              int playerx;

              int playery;

              int playerz;

             

              playerx = player.getX();

              playery = player.getY();

              playerz = player.getZ();

             

              activeChar.teleToLocation(playerx,playery,playerz);

    activeChar.sendMessage("You have been teleported to fight!");

        }

        return true;

    }

    public String[] getVoicedCommandList()

    {

        return VOICED_COMMANDS;

    }

 

}

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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