Jump to content
  • 0

[Resolved]help with bypass community board


Question

Posted

Hola comunidad, necesito ayuda ya que no puedo conseguir un bypass para trabajar en el tablero comunitario que estoy creando para teletransportarme.

Estoy usando la misma función que goto bypass,
lo que quiero hacer es poner _bbsgk; Tabla de teletransporte de identificación

 





	
	
		
			
	
			
			
	
	

 

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

3 hours ago, djsocux said:

if (true)

xD

Nevermind, i don't see any possible reason why it shouldn't work. Is there any console/eclipse error?

Edited by Zake
  • 0
Posted
24 minutes ago, LexaKAZAN said:

)))

 

"_bbsgk;:rage:

 

final StringTokenizer st = new StringTokenizer(command, ";");:thumbs-up:

 

"_bbsgk":troll:

 

????????? :dunno:

 

 

What is the matter with you? there is nothing wrong there

  • 0
Posted (edited)

CommunityBoard.java

/*
 * This file is part of the L2J Mobius project.
 * 
 * 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 org.l2jmobius.gameserver.communitybbs;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.communitybbs.Manager.BaseBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.ClanBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.FavoriteBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.FriendsBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.GkBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.MailBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.RegionBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.TopBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.TopicBBSManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ShowBoard;
import org.l2jmobius.gameserver.util.BuilderUtil;

public class CommunityBoard
{
	/** The bypasses used by the players. */
	private final Map<Integer, String> _bypasses = new ConcurrentHashMap<>();
	protected static final String CB_PATH = "data/html/CommunityBoard/";
	
	protected CommunityBoard()
	{
	}
	
	public static CommunityBoard getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
	
	@SuppressWarnings("static-access")
	public void handleCommands(GameClient client, String command)
	{
		final PlayerInstance player = client.getPlayer();
		if (player == null)
		{
			return;
		}
		
		if (!Config.ENABLE_COMMUNITY_BOARD)
		{
			player.sendPacket(SystemMessageId.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE);
			return;
		}
		
		if (command.startsWith("_bbshome"))
		{
			TopBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsloc"))
		{
			RegionBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsclan"))
		{
			ClanBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsmemo"))
		{
			TopicBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsmail") || command.equals("_maillist_0_1_0_"))
		{
			MailBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_friend") || command.startsWith("_block"))
		{
			FriendsBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbstopics"))
		{
			TopicBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsposts"))
		{
			PostBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsgetfav") || command.startsWith("bbs_add_fav") || command.startsWith("_bbsdelfav_"))
		{
			// player.sendPacket(new BuyList(TradeController.getInstance().getBuyList(1), 6393));
			// player.sendPacket(new BuyList(Multisell.getInstance().SeparateAndSend(1, player, 0, false, 0)));
			FavoriteBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbgk"))
		{
			GkBBSManager.getInstance().parseCmd(command, player);
		}
		else
		{
			BaseBBSManager.separateAndSend("<html><body><br><br><center>The command: " + command + " isn't implemented.</center></body></html>", player);
		}
	}
	
	public void handleWriteCommands(GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5)
	{
		final PlayerInstance player = client.getPlayer();
		if (player == null)
		{
			return;
		}
		
		if (!Config.ENABLE_COMMUNITY_BOARD)
		{
			player.sendPacket(SystemMessageId.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE);
			return;
		}
		
		if (url.equals("Topic"))
		{
			TopicBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("Post"))
		{
			PostBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_bbsloc"))
		{
			RegionBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_bbsclan"))
		{
			ClanBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("Mail"))
		{
			MailBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_friend"))
		{
			FriendsBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else
		{
			BaseBBSManager.separateAndSend("<html><body><br><br><center>The command: " + url + " isn't implemented.</center></body></html>", player);
		}
	}
	protected void loadStaticHtm(String file, PlayerInstance player)
	{
		separateAndSend(HtmCache.getInstance().getHtm(CB_PATH + getFolder() + file), player);
	}
	
	public static void separateAndSend(String html, PlayerInstance acha)
	{
		if ((html == null) || (acha == null))
		{
			return;
		}
		
		if (html.length() < 4090)
		{
			acha.sendPacket(new ShowBoard(html, "101"));
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_102);
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_103);
		}
		else if (html.length() < 8180)
		{
			acha.sendPacket(new ShowBoard(html.substring(0, 4090), "101"));
			acha.sendPacket(new ShowBoard(html.substring(4090, html.length()), "102"));
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_103);
		}
		else if (html.length() < 12270)
		{
			acha.sendPacket(new ShowBoard(html.substring(0, 4090), "101"));
			acha.sendPacket(new ShowBoard(html.substring(4090, 8180), "102"));
			acha.sendPacket(new ShowBoard(html.substring(8180, html.length()), "103"));
		}
	}
	
	/**
	 * Sets the last bypass used by the player.
	 * @param player the player
	 * @param title the title
	 * @param bypass the bypass
	 */
	public void addBypass(PlayerInstance player, String title, String bypass)
	{
		_bypasses.put(player.getObjectId(), title + "&" + bypass);
	}
	
	protected String getFolder()
	{
		return "";
	}
	
	/**
	 * Removes the last bypass used by the player.
	 * @param player the player
	 * @return the last bypass used
	 */
	public String removeBypass(PlayerInstance player)
	{
		return _bypasses.remove(player.getObjectId());
	}
	
	private static class SingletonHolder
	{
		protected static final CommunityBoard INSTANCE = new CommunityBoard();
	}
}

 

GkBBSManager.java

/*
* This file is part of the L2J Mobius project.
 * 
 * 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 org.l2jmobius.gameserver.communitybbs.Manager;

import java.util.StringTokenizer;

import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
import org.l2jmobius.gameserver.datatables.xml.ZoneData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.model.TeleportLocation;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.type.TownZone;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.ShowBoard;

public class GkBBSManager extends BaseBBSManager
{
	protected GkBBSManager()
	{
	}
	
	public static GkBBSManager getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
	
	@Override
	public void parseCmd(String command, PlayerInstance player)
	{
		
		if (command.equals("_bbsgk"))
		{
			loadStaticHtm("gk/index.htm", player);
		}
		
		else if (command.startsWith("_bbsgk;"))
		{
			final StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			if (st.countTokens() <= 0)
			{
				return;
			}
			final int whereTo = Integer.parseInt(st.nextToken());
			if (true)
			{
				player.sendPacket(new ShowBoard());
				doTeleport(player, whereTo);
				return;
			}
			
		}
		else
		{
			super.parseCmd(command, player);
		}
	}
	

	private void doTeleport(PlayerInstance player, int value)
	{
		final TeleportLocation list = TeleportLocationTable.getInstance().getTemplate(value);
		if (list != null)
		{
			// you cannot teleport to village that is in siege
			if (!SiegeManager.getInstance().isTeleportToSiegeAllowed() && (SiegeManager.getInstance().getSiege(list.getX(), list.getY(), list.getZ()) != null) && !player.isNoble())
			{
				player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
				return;
			}
			else if (!SiegeManager.getInstance().isTeleportToSiegeTownAllowed() && (ZoneData.getInstance().getZone(list.getX(), list.getY(), list.getZ(), TownZone.class) != null) && CastleManager.getInstance().findNearestCastle(list.getX(), list.getY()).getSiege().isInProgress() && !player.isNoble())
			{
				player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
				return;
			}
			else if (!player.isGM() && !Config.FLAGED_PLAYER_CAN_USE_GK && (player.getPvpFlag() > 0))
			{
				player.sendMessage("Don't run from PvP! You will be able to use the teleporter only after your flag is gone.");
				return;
			}
			else if (player.isAio() && !Config.ALLOW_AIO_USE_GK)
			{
				player.sendMessage("Aio Buffers are not allowed to use GateKeepers.");
				return;
			}
			else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getKarma() > 0)) // karma
			{
				player.sendMessage("Go away, you're not welcome here.");
				return;
			}
			
			else if (player.isAlikeDead())
			{
				player.sendMessage("You can't use teleport when you are dead.");
				return;
			}
			else if (player.isSitting())
			{
				player.sendMessage("You can't use teleport when you are sitting.");
				return;
			}
			
			else if (!list.isForNoble() && ((player.getLevel() < 30) || player.destroyItem("Adena", 57, list.getPrice(), null, true)))
			{
				player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
			}
		}
		else
		{
			LOGGER.warning("No teleport destination with id:" + value);
		}
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
	
	@Override
	protected String getFolder()
	{
		return "top/";
	}
	
	private static class SingletonHolder
	{
		protected static final GkBBSManager INSTANCE = new GkBBSManager();
	}
}

that's the files I have everything registered
what I do not understand why I do not get the id of the teleport table

 

225b821761e6c8598cd6da364e19008eo.png

Edited by djsocux
  • 0
Posted

Come on you can't be that blind xD

else if (command.startsWith("_bbgk"))
		{
			GkBBSManager.getInstance().parseCmd(command, player);
		}

change _bbgk to _bbsgk

  • 0
Posted
13 minutes ago, djsocux said:

it works but when I am above lvl 31 it gives me inconrect item count

check your adenas and the price of teleport 

  • 0
Posted
4 hours ago, djsocux said:

it works but when I am above lvl 31 it gives me inconrect item count

else if (!list.isForNoble() && ((player.getLevel() < 30) || player.destroyItem("Adena", 57, list.getPrice(), null, true)))
			{
				player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
			}

player.destroyItem("Adena", 57, list.getPrice(), null, true)

this statement returns false for some reason, check the declaration of this method 

Guest
This topic is now closed to further replies.


  • Posts

    • This update resaves 25_25 from the original (with sounds) (without the cave below) Some emitter fixes (removed waterfalls with high-poly meshes) The geodata is old, but it works Everything else is unchanged Download P.S. The effect files are taken from the high client for Interlude, so if you're experiencing critical skills, use the default ones for your Version.  
    • GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock