Ir para conteúdo
  • Cadastre-se
  • 0

Mod teleport vip por coordenadas


Manxa

Pergunta

Então pessoal este mod esta configurado para poder viajar pelo comando .teleport x y z quem tiver um número X no acesslevel, queria saber se alguém que entenda de sobre os mods alterasse para que ele funciona-se através do vip que o player tem, que seria pelo comando //setvip name days (que no caso é outro mod), fazer com que eles fossem de certa forma "interligados"

 

 

/*

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

O conteúdo está oculto, favor efetuar login ou se cadastrar!

* else if (SiegeManager.getInstance().getSieges() != null)
* {
* activeChar.sendMessage("You are in siege!");
* return false;
* }
*/

package handlers.voicedcommandhandlers;

import java.util.NoSuchElementException;
import java.util.StringTokenizer;

import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class VIPTeleport implements IVoicedCommandHandler
{
private static final String[] _voicedCommands =
{
"teleport"
};

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String tlp)
{
if (command.equalsIgnoreCase("teleport"))
{
if (activeChar == null)
{
return false;
}
else if(activeChar.atEvent)
{
activeChar.sendMessage("You are an Event.");
return false;
}
else if(activeChar.isInDuel())
{
activeChar.sendMessage("You are on Duel.");
return false;
}
else if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("You are in Olympiad.");
return false;
}
else if(activeChar.isInCombat())
{
activeChar.sendMessage("You can't teleport in Combat Mod.");
return false;
}
else if (activeChar.isFestivalParticipant())
{
activeChar.sendMessage("You are in a festival.");
return false;
}
else if (activeChar.isInJail())
{
activeChar.sendMessage("You are in Jail.");
return false;
}
else if (activeChar.inObserverMode())
{
activeChar.sendMessage("You are in Observ Mode.");
return false;
}
else if (activeChar.isDead())
{
activeChar.sendMessage("You Dead. Can't Teleport.");
return false;
}
else if (activeChar.isFakeDeath())
{
activeChar.sendMessage("You are Dead? week up :D");
return false;
}
else if (activeChar.getKarma() > 0)
{
activeChar.sendMessage("You can't use teleport command when you have karma.");
return false;
}
else if (activeChar.getAccessLevel().getLevel() != 3)
{
activeChar.sendMessage("You Need Account VIP To Use This.");
return false;
}
if(tlp != null)
{
teleportTo(activeChar, tlp);
}
else
{
activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");
activeChar.sendMessage("Ex: .teleport <x> <y> <z>");
return false;
}
}
return true;
}

private void teleportTo(L2PcInstance activeChar, String Cords)
{
try
{
StringTokenizer st = new StringTokenizer(Cords);
String x1 = st.nextToken();
int x = Integer.parseInt(x1);
String y1 = st.nextToken();
int y = Integer.parseInt(y1);
String z1 = st.nextToken();
int z = Integer.parseInt(z1);

activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(x, y, z, false);

activeChar.sendMessage("You have been teleported to " + Cords);
}
catch (NoSuchElementException nsee)
{
activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");
activeChar.sendMessage("Ex: .teleport <x> <y> <z>");
}
}

public String[] getVoicedCommandList()
{
return _voicedCommands;
}

}

 

 

scripts/handlers/MasterHandler.java

 

 

VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPTeleport());

 

 

MasterHandler.java

 

 

linha-222 VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());

linha-223 VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPTeleport());

 

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts recomendados

Experimenta trocar essa linha:

 

O conteúdo está oculto, favor efetuar login ou se cadastrar!

 

Por:

O conteúdo está oculto, favor efetuar login ou se cadastrar!

 

Lembrando que assim vai precisa o sistema vip by khayruss.

Link para o comentário
Compartilhar em outros sites


  • 0
Em 03/09/2014 at 01:02, Manxa disse:

Então pessoal este mod esta configurado para poder viajar pelo comando .teleport x y z quem tiver um número X no acesslevel, queria saber se alguém que entenda de sobre os mods alterasse para que ele funciona-se através do vip que o player tem, que seria pelo comando //setvip name days (que no caso é outro mod), fazer com que eles fossem de certa forma "interligados"

  Ocultar conteúdo

/*

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

O conteúdo está oculto, favor efetuar login ou se cadastrar!

* else if (SiegeManager.getInstance().getSieges() != null)
* {
* activeChar.sendMessage("You are in siege!");
* return false;
* }
*/

package handlers.voicedcommandhandlers;

import java.util.NoSuchElementException;
import java.util.StringTokenizer;

import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class VIPTeleport implements IVoicedCommandHandler
{
private static final String[] _voicedCommands =
{
"teleport"
};

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String tlp)
{
if (command.equalsIgnoreCase("teleport"))
{
if (activeChar == null)
{
return false;
}
else if(activeChar.atEvent)
{
activeChar.sendMessage("You are an Event.");
return false;
}
else if(activeChar.isInDuel())
{
activeChar.sendMessage("You are on Duel.");
return false;
}
else if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("You are in Olympiad.");
return false;
}
else if(activeChar.isInCombat())
{
activeChar.sendMessage("You can't teleport in Combat Mod.");
return false;
}
else if (activeChar.isFestivalParticipant())
{
activeChar.sendMessage("You are in a festival.");
return false;
}
else if (activeChar.isInJail())
{
activeChar.sendMessage("You are in Jail.");
return false;
}
else if (activeChar.inObserverMode())
{
activeChar.sendMessage("You are in Observ Mode.");
return false;
}
else if (activeChar.isDead())
{
activeChar.sendMessage("You Dead. Can't Teleport.");
return false;
}
else if (activeChar.isFakeDeath())
{
activeChar.sendMessage("You are Dead? week up :D");
return false;
}
else if (activeChar.getKarma() > 0)
{
activeChar.sendMessage("You can't use teleport command when you have karma.");
return false;
}
else if (activeChar.getAccessLevel().getLevel() != 3)
{
activeChar.sendMessage("You Need Account VIP To Use This.");
return false;
}
if(tlp != null)
{
teleportTo(activeChar, tlp);
}
else
{
activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");
activeChar.sendMessage("Ex: .teleport <x> <y> <z>");
return false;
}
}
return true;
}

private void teleportTo(L2PcInstance activeChar, String Cords)
{
try
{
StringTokenizer st = new StringTokenizer(Cords);
String x1 = st.nextToken();
int x = Integer.parseInt(x1);
String y1 = st.nextToken();
int y = Integer.parseInt(y1);
String z1 = st.nextToken();
int z = Integer.parseInt(z1);

activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(x, y, z, false);

activeChar.sendMessage("You have been teleported to " + Cords);
}
catch (NoSuchElementException nsee)
{
activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");
activeChar.sendMessage("Ex: .teleport <x> <y> <z>");
}
}

public String[] getVoicedCommandList()
{
return _voicedCommands;
}

}

scripts/handlers/MasterHandler.java

  Ocultar conteúdo

VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPTeleport());

MasterHandler.java

  Ocultar conteúdo

linha-222 VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());

linha-223 VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPTeleport());

Eu precisava do script para teleportar pra outras cidades.. tipo .giran .oren e por ae vai..

Link para o comentário
Compartilhar em outros sites

Experimenta trocar essa linha:

O conteúdo está oculto, favor efetuar login ou se cadastrar!

Por:

O conteúdo está oculto, favor efetuar login ou se cadastrar!

Lembrando que assim vai precisa o sistema vip by khayruss.

Irei fazer o teste, obrigado.

Link para o comentário
Compartilhar em outros sites

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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...




×
×
  • Criar Novo...

Important Information

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.