Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro


Alpha Servers
Resultados 1 a 1 de 1
  1. #1

    Avatar de Inspector
    Data de Ingresso
    May 2010
    Localização
    Na Frente do PC
    Idade
    37
    Posts
    84
    Agradecido
    3
    Agradeceu
    3
    Peso da Avaliação
    8

    Post MOD .cl Go To Leader

    MOD que teleporta o membro ate onde esta seu lider


    crie um arquivo Cl.java em net.sf.l2j.gameserver.handler.voicedcommandhandler s

    Código:
    package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
    
    import net.sf.l2j.Config;
    import net.sf.l2j.gameserver.GameTimeController;
    import net.sf.l2j.gameserver.ThreadPoolManager;
    import net.sf.l2j.gameserver.datatables.MapRegionTable;
    import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding.EscapeFinalizer;
    import net.sf.l2j.gameserver.instancemanager.CastleManager;
    import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
    import net.sf.l2j.gameserver.model.L2World;
    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.serverpackets.SystemMessage;
    
    public class Cl implements IVoicedCommandHandler
    {
        private static final String[] VOICED_COMMANDS = { "cl" };
    
        public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
        {   
           
            if (command.equalsIgnoreCase("cl"))
            {
    
               if (activeChar.getClan() == null)
                  {
                     return false;
                  }
           
                L2PcInstance leader;
                leader = (L2PcInstance)L2World.getInstance().findObject(activeChar.getClan().getLeaderId());
    
                if(leader == null)
                {
                    activeChar.sendMessage("Your partner is not online.");
                    return false;
                }
                else if(leader.isInJail())
                {
                    activeChar.sendMessage("Your leader is in Jail.");
                    return false;
                }
                else if(leader.isInOlympiadMode())
                {
                    activeChar.sendMessage("Your leader is in the Olympiad now.");
                    return false;
                }
                else if(leader.atEvent)
                {
                    activeChar.sendMessage("Your leader is in an event.");
                    return false;
                }
                else  if (leader.isInDuel())
                {
                    activeChar.sendMessage("Your leader is in a duel.");
                    return false;
                }
                else if (leader.isFestivalParticipant())
                {
                    activeChar.sendMessage("Your leader is in a festival.");
                    return false;
                }
                else if (leader.isInParty() && leader.getParty().isInDimensionalRift())
                {
                    activeChar.sendMessage("Your leader is in dimensional rift.");
                    return false;
                }
                else if (leader.inObserverMode())
                {
                   activeChar.sendMessage("Your leader is in the observation.");
                }
                else if(leader.getClan() != null
                      && CastleManager.getInstance().getCastleByOwner(leader.getClan()) != null
                      && CastleManager.getInstance().getCastleByOwner(leader.getClan()).getSiege().getIsInProgress())
                {
                   activeChar.sendMessage("Your leader 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._inEventVIP)
                         {
                              activeChar.sendPacket(SystemMessage.sendString("Your leader is in a VIP event."));
                            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 leader.");
                   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 == leader)
                {
                    activeChar.sendMessage("You cannot teleport to yourself.");
                    return false;
                }
               if(activeChar.getInventory().getItemByItemId(3470) == null)
               {
                  activeChar.sendMessage("You need one or more Gold Bars to use the cl-teleport system.");
                 return false;
               }
                   int leaderx;
                   int leadery;
                   int leaderz;
                   
                   leaderx = leader.getX();
                   leadery = leader.getY();
                   leaderz = leader.getZ();
                   
                   activeChar.teleToLocation(leaderx, leadery, leaderz);
         activeChar.sendMessage("You have been teleported to your leader!");
        activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());
        activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");
            }
            return true;
        }
        public String[] getVoicedCommandList()
        {
            return VOICED_COMMANDS;
        }
    
    }
    net.sf.l2j.gameserver.GameServer.java

    Código:
    +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Cl;
    import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
    Código:
    +      _voicedCommandHandler.registerVoicedCommandHandler(new Cl());   
          _log.config("VoicedCommandHandler: Loaded .cl VoiceCommand handler.");
          
          _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
    Última edição por Inspector; 01-08-2011 às 02:50 AM.

 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tags para este Tópico

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •