Jump to content

[Share] .Valakas Command


Recommended Posts

Efoson exete compiled pack mporite na pros8esete ta akoloutha code sta antistoixa path pou 8a dwsw etsi wste enas pextis ston server sas me tin entoli .valakas (prosekste exei mia telia mprosta) metaferete sto valakas lair

 

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

 

TO PARAPANW THA TO VALETE MESA STO : 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.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.");

	}
}

 

TO PARAPANW THA TO VALETE MESA STO : instancemanager/ValakasManager.java

 

 

registerVoicedCommandHandler(new Valakas());

 

TO PARAPANW THA TO VALETE STO : handler/voicedcommandhandler.java

 

 

 

OK AFTO ITAN

 

Apo oso kserw doulevei se L2Jfree..gia opiodipote problima apantiste edw

 

 

Credits go to Horus

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

xaxxaxaxaxaxaxaxa Eleos!!!

nice...Einai san na exeis tin Gkpanw s... :P

Ch3at3r πρόσεχε τις ημερομηνίες γιατί θα έχει άσχημες επιπτώσεις αυτό που κάνεις!!

 

 

Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.


  • Posts

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts discord : advert1231 telegram : https://t.me/ggwpins  
  • Topics

×
×
  • Create New...