Jump to content

[Share].Valakas Command


Recommended Posts

This post has been done by pankostrelos in greek section.

 

With this command (.valakas) you  get ported to valakas lair!

 

ADD THE FOLLOWING CODE TO: voicedcommandhandlers/Valakas.java

 

 

/*
* 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;
}
}

 

 

 

ADD THE FOLLOWING CODE TO: instancemanager/ValakasManager.java

 

/*
* 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.");

	}
}

 

 

ADD THE FOLLOWING CODE TO: handler/voicedcommandhandler.java

 

registerVoicedCommandHandler(new Valakas());

 

It works on L2jfree

Credits go to Horus for the guide

 

Credits to me for translating

Link to comment
Share on other sites

  • 1 month later...

reshare? xaxa

anyway, if u can make for valakas, could u make and for baium? it would be more useful :P

Just so that you know, that is actually my work, I shared it on RZ and someone just copied over here and claimed it as their own. And yup I can do it, if you aint lazy just read through the code and you'll see that all you have to do is change the coordinates.

 

Original Share was made "Here" .

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • totally agree, the problem started with professionals who made easy to open a server, specially interlude has been abused unstoppably since you can open a server with few clicks now days making fewer players for many servers, while back in time when "compile" was a secret and opening a server was going max players but true things are changing and this has become a job but dont lie everyone knows what is going on, lying is showing desperation, better go and work. i've worked with lots of people with kids that invest huge amounts of money into this and fail while they needed the money its an addiction.
    • well,we all know that everyone is doing it for money. And it's acceptable since you put much more effort than the usual admins. If you're proffesional on l2 servers,i don't find a reason to not see it as a job. Ofc it's job,but all jobs has their own prides. I'll talk about me,i'm a guy that working 10 +/- hours per day. I have 2-3 free hours on my daily activity and sometimes i enjoy playing Lineage because nostalgia hits me everyday. If you are many years on scene,u'll understand that lineage will never be the same like old days. Days that we was gathering at internet cafes,and the battle was daily. Anyway, some people perfer to pay big clans and provide them black market with special prices and benefits that a casual player wont have. Also big clans means big wars,so server will have population even if you have zero quality. And there is some projects that wont pay those d1ckheads,so they wont join them and project need to find other ways to increase the population. So,i'm a player that i'll donate 20-40-50 euros on every server i play,and usually i'm getting "scammed" since they re-open their server every 2 months. And the problem is that,i personally don't mind to donate few money every 2 months for my joy,but the majority of owners has zero knowledge about L2 gaming. That's why they can't fix a sh1t,and when the problems pile up,they slowly close the server and starting advertising for another one. Actually,on high rate scene mostly,is the same guy that doing it everytime. He opens his project for 1-2 months,he close it and before he shut down the server,he has already started the advertising on his next server with different name. It's just crazy and that part shouldn't be acceptable. So yes,i perfer to support a project with honest admin team,and somewhere they have the knowledge to implent things. Business is business,but at least as community,we should enjoy our game that we love, cheers. 
    • thanks for sharing !! any guide to install this? it would be great!!
  • Topics

×
×
  • Create New...