Jump to content

Recommended Posts

Posted

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

  • 1 month later...
Posted

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" .

Posted

By the way Zonzoo, I don't understand how the credits go to you if the original post was actually in english already lool. But oke ^^

Guest
This topic is now closed to further replies.


  • Posts

    • Where I can buy a cheap domain .com? cheapest I found was on Godaddy for 12 euro and Hostinger for 10 euro.
    • Hello everyone, here's a simple and useful idea for any type of server.   This code applies a discount when a player makes a purchase inside a clan’s castle or clan hall, offering a benefit to clan members who own a castle or clan hall. Important: Merchant transactions must be handled through multisell, not buylist. The discount is directly applied within the multisell, so the price shown is already reduced.   "For example, if a scroll costs 1000 Adena and you set a 20% discount in the config, the final price when purchasing inside a castle or clan hall will be 800 Adena."   This code is developed on the public aCis 401 revision.   public static int CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT; CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT = clans.getProperty("ClanBaseOwnershipMechantDiscount", 20); # If clan owns a clan hall or castle, all members have a discount of X% at merchant transactions (multisell). # Discount applies only inside the base (castle or clan hall). ClanBaseOwnershipMechantDiscount = 20   /** diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java index 556e111..bbf8e69 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java @@ -101,7 +101,7 @@ do { // send list at least once even if size = 0 - player.sendPacket(new MultiSellList(list, index)); + player.sendPacket(new MultiSellList(list, index, player)); index += PAGE_SIZE; } while (index < list.getEntries().size()); diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java index 7c82c5b..1654abc 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java @@ -6,6 +6,7 @@ import net.sf.l2j.Config; import net.sf.l2j.gameserver.enums.FloodProtector; import net.sf.l2j.gameserver.enums.StatusType; +import net.sf.l2j.gameserver.enums.ZoneId; import net.sf.l2j.gameserver.enums.items.CrystalType; import net.sf.l2j.gameserver.model.Augmentation; import net.sf.l2j.gameserver.model.actor.Player; @@ -225,6 +226,20 @@ return; } + if (player.isInsideZone(ZoneId.CLAN_HALL) && player.getClan() != null && player.getClan().hasClanHall()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + + if (player.isInsideZone(ZoneId.CASTLE) && player.getClan() != null && player.getClan().hasCastle()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + if (Config.BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) { // if it's a stackable item, just reduce the amount from the first (only) instance that is found in the inventory diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java index 9269b06..c6102a0 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java @@ -2,6 +2,9 @@ import static net.sf.l2j.gameserver.data.xml.MultisellData.PAGE_SIZE; +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.multisell.Entry; import net.sf.l2j.gameserver.model.multisell.Ingredient; import net.sf.l2j.gameserver.model.multisell.ListContainer; @@ -15,7 +18,9 @@ private boolean _finished; - public MultiSellList(ListContainer list, int index) + private Player _player; + + public MultiSellList(ListContainer list, int index, Player player) { _list = list; _index = index; @@ -28,6 +33,8 @@ } else _finished = true; + + _player = player; } @Override @@ -74,7 +81,14 @@ { writeH(ing.getItemId()); writeH(ing.getTemplate() != null ? ing.getTemplate().getType2() : 65535); - writeD(ing.getItemCount()); + + if (_player.isInsideZone(ZoneId.CLAN_HALL) && _player.getClan() != null && _player.getClan().hasClanHall()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else if (_player.isInsideZone(ZoneId.CASTLE) && _player.getClan() != null && _player.getClan().hasCastle()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else + writeD(ing.getItemCount()); + writeH(ing.getEnchantLevel()); writeD(0x00); // TODO: i.getAugmentId() writeD(0x00); // TODO: i.getManaLeft()  
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • WTB EXP ETERNAL 10x new dm.
    • This project is based on the latest public aCis sources (revision 401) and supports a multi-client system (C4 & IL), making it suitable for custom usage but not for retail.   You can configure the SelectedClient option in server.properties and loginserver.properties to switch between C4 and IL.  Both clients are fully synchronized, including login, server selection, packets, and geodata.   Notable Features: - Completed the login and server selection phase for both clients. - Synchronized all packets to support both clients (including some specific features). - Reworked the datapack and SQL files (excluding HTML files) to work seamlessly with both clients. - Added geodata support for both clients. - Adapted nearly all AI, scripts, bosses, HTML, and MULTISELL files to match C4 functionality. - Reduced the maximum clan level from 8 to 5 (C4 feature). - Rewrote clan HTML to remove C5-C6 features.   Disabled the following C5 and C6 features: - Divine Inspiration (C6 feature). - Clan skills and clan reputation points (C5 feature). - Pledge class (C5 feature). - Hero skills (C5 feature). - Dueling system (C6 feature). - Augmentations (C6 feature). - Cursed weapons (C5-C6 feature).   General Improvements: - Performed a general HTML cleanup and optimized features based on the client version. - Added an option to display the remaining time of disabled skills. - Skill timestamps now update when using the skill list.   This flexibility allows you to create a unique progression system tailored to your needs. The price for the diff patch, which can be applied to aCis public sources, is €150. For inquiries, please contact me via PM or Discord (ID: @Luminous).
  • Topics

×
×
  • Create New...