Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.    


Início Postados Hoje Marcar Fóruns Como Lidos Álbums Banidos SE Team Medalhas
Voltar   Secret Experience > Área L2J > [L2J] Downloads > [Lineage] Java Mods
Registrar Loteria VIPStaff SERegras do fórum Comunidade Arcade Postados Hoje Pesquisar Experience
   

Secret Experience.NET   Secret Experience Corporation - Welcome To The Real World
     Anúncios SE

Resposta
 
Ferramentas do Tópico Modos de Exibição
Antigo 01-10-2013, 10:02 PM   #1
Setokaiba
Jesus Te Ama, Mas EU Não!
 
Avatar de Setokaiba
 
Registrado em: Oct 2008
Localização: 45º 33º 34º N | 122º 41º 41º W DESTINATION: ANYWHERE Adidas
Posts: 4,133
Agradeceu: 837
Agradecido 6,058 Vezes em 2,106 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
Pontos: 20,442, Nível: 90
Pontos: 20,442, Nível: 90 Pontos: 20,442, Nível: 90 Pontos: 20,442, Nível: 90
Atividade: 99%
Atividade: 99% Atividade: 99% Atividade: 99%

Nome Real: Anderson Andrade

Inventório de Setokaiba Usuário possui 1x Lock Fan Usuário possui 1x Oakley Usuário possui 1x Apple Inc. Fan/User Usuário possui 1x Honda Usuário possui 1x Windows Seven User

Padrão .Valakas Comando de Teleporte

Descrição: Esse é um código para adicionar o comando .Valakas. Esse comando permite que o personagem seja movido para o Lair of Valakas.

Adicione o seguinte código em voicedcommandhandlers/Valakas.java:

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package com.l2jfree.gameserver.handler.voicedcommandhandlers;

import com.l2jfree.gameserver.handler.IVoicedCommandHandler;
import com.l2jfree.gameserver.instancemanager.SiegeManager;
import com.l2jfree.gameserver.instancemanager.ValakasManager;
import com.l2jfree.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfree.gameserver.model.entity.Siege;
import com.l2jfree.gameserver.model.zone.L2Zone;

/**
 * @author Horus
 *
 */
public class Valakas implements IVoicedCommandHandler
{
	private static final String[]	VOICED_COMMANDS	=
													{ "valakas" };

	/* (non-Javadoc)
	 * @see com.l2jfree.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(String, com.l2jfree.gameserver.model.L2PcInstance), String)
	 */
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String text)
	{
		if (command.startsWith("valakas"))
			return valakas(activeChar);
		return false;
	}

	/* (non-Javadoc)
	 * @see com.l2jfree.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
	 */

	private boolean valakas(L2PcInstance activeChar)
	{
		Siege siege = SiegeManager.getInstance().getSiege(activeChar);
		

		if (activeChar.isTransformed())
		{
			activeChar.sendMessage("You can't teleport to valakas while transformed");
			return false;
		}
		//check player is dead or using fake death and has his movement disabled
		if (activeChar.isMovementDisabled() || activeChar.isAlikeDead())
		{
			activeChar.sendMessage("You can't teleport to valakas with fake death nor rooted");
			return false;
		}
		// Check if the player is currently in Siege
		if (siege != null && siege.getIsInProgress())
		{
			activeChar.sendMessage("You are in siege, cannot teleport to Valakas.");
			return false;
		}
		// Check if the player is a Cursed Weapon owner
		if (activeChar.isCursedWeaponEquipped())
		{
			activeChar.sendMessage("You cannot teleport to Valakas! You are currently holding a cursed weapon.");
			return false;
		}
		// Check if the player is in Duel
		if (activeChar.isInDuel())
		{
			activeChar.sendMessage("You cannot teleport to Valakas! You are in a duel!");
			return false;
		}
		//check if the player is in a DimensionalRift
		if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())
		{
			activeChar.sendMessage("You cannot teleport to Valakas! You are in the dimensional rift.");
			return false;
		}
		// Check if the player is in an event
		if (activeChar.isInFunEvent())
		{
			activeChar.sendMessage("You cannot teleport to Valakas since you are in an event.");
			return false;
		}
		//check player is in Olympiad
		if (activeChar.isInOlympiadMode() || activeChar.getOlympiadGameId() != -1)
		{
			activeChar.sendMessage("Teleporting to Valakas whilst in Olympiad isn't allowed.");
			return false;
		}
		// Check if player is in observer mode
		if (activeChar.inObserverMode())
		{
			activeChar.sendMessage("You cannot teleport to Valakas in Observer mode!");
			return false;
		}
		//check player has karma/pk/pvp status
		if (activeChar.getKarma() > 0 || activeChar.getPvpFlag() > 0)
		{
			activeChar.sendMessage("Flagged Players & Karma Players cannot use this command.");
			return false;
		}
		//Check if player is immobilized
		if (activeChar.isImmobilized())
		{
			activeChar.sendMessage("Immobilized players cannot use this command.");
			return false;
		}
		if (!(activeChar.getAdena() >= 500000))
			activeChar.sendMessage("You do not hold enough adena to teleport.");
		// check if no one is targeted
		if (activeChar.getTarget() == null)
			ValakasManager.getInstance().Teleport(activeChar);
		return true;
	}


	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}
Agora em instancemanager/ValakasManager.java adicione:
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package com.l2jfree.gameserver.instancemanager;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.l2jfree.Config;
import com.l2jfree.gameserver.ThreadPoolManager;
import com.l2jfree.gameserver.ai.CtrlIntention;
import com.l2jfree.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jfree.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfree.gameserver.network.serverpackets.SetupGauge;
import com.l2jfree.gameserver.network.serverpackets.SocialAction;

/**
 * @author Horus
 *
 */
public final class ValakasManager
{
	private static final Log				_log	= LogFactory.getLog(ValakasManager.class.getName());
	private static ValakasManager				_instance;

	public static final ValakasManager getInstance()
	{
		if (_instance == null)
		{
			_instance = new ValakasManager();
			_log.info("ValakasManager: initialized.");
		}
		return _instance;
	}

	

	/**
	 * @param activeChar
	 * @param text
	 */
	public void Teleport(L2PcInstance activeChar)
	{
		activeChar.startAbnormalEffect(L2MonsterInstance.ABNORMAL_EFFECT_MAGIC_CIRCLE);
		activeChar.sendMessage("You will be teleported in " + 120 + " Seconds.");
		activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
		if(activeChar.isSitting())
		{
			activeChar.sendMessage("You cannot be sitting while teleporting to Valakas.");
			return;
		}
		SetupGauge sg = new SetupGauge(SetupGauge.BLUE, 120 * 1000);
		activeChar.sendPacket(sg);
		activeChar.setIsImmobilized(true);
		ThreadPoolManager.getInstance().scheduleGeneral(new PlayerTeleportTask(activeChar), 120 * 1000);
	}

	/**
	 * @param activeChar
	 */


	class PlayerTeleportTask implements Runnable
	{

		private final L2PcInstance	_activeChar;

		PlayerTeleportTask(L2PcInstance activeChar)
		{
			_activeChar = activeChar;
		}

		public void run()
		{
			if (_activeChar == null)
				return;
			if (_activeChar.isAttackingNow() || _activeChar.isCastingNow())
			{
				_activeChar.sendMessage("Cannot teleport if you are Casting or Attacking.");
				return;
			}
			_activeChar.stopAbnormalEffect(L2MonsterInstance.ABNORMAL_EFFECT_MAGIC_CIRCLE);
			_activeChar.getInventory().reduceAdena("ValakasManager", 500000, _activeChar, null);
			_activeChar.setIsImmobilized(false);
			_activeChar.teleToLocation(2138*** -115436, -1639);
			_activeChar.sendMessage("You have successfully teleported to Valakas.");
_activeChar.sendMessage("horusicarus@gmail.com");
			_log.info("ValakasManager: Player " + _activeChar.getName() + " was sucessfully ported.");

		}
	}
E por último, mas não menos importante adicione em handler/voicedcommandhandler.java

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
registerVoicedCommandHandler(new Valakas());
Credits by Horus

Setokaiba está online agora  
Links Patrocinados
Resposta


Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não

Ir para...


Horários baseados na GMT -3. Agora são 12:53 AM.