Jump to content
  • 0

[Help] with gameserver/escape.java


Question

Posted

usercommandhandlers\Escape.java (at line 24)
        import com.l2jserver.gameserver.datatables.MapRegionTable;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import com.l2jserver.gameserver.datatables.MapRegionTable is never used

 

trying to add a custom /unstuck  and in gameserver i get this error

i deleted the import but when i use unstuck i get ported to nearest village

i used this code

_activeChar.teleToLocation(147463, 25798, -2039);any suggestions?

2 answers to this question

Recommended Posts

  • 0
Posted

Show us your code, seems like after your teleport, there still is teleport to nearest village

  • 0
Posted
/*
* 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 handlers.usercommandhandlers;

import java.util.logging.Level;

import com.l2jserver.Config;
import com.l2jserver.gameserver.GameTimeController;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.datatables.MapRegionTable;
import com.l2jserver.gameserver.handler.IUserCommandHandler;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.model.L2Skill;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.TvTEvent;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.SetupGauge;
import com.l2jserver.gameserver.util.Broadcast;


/**
*
*
*/
public class Escape implements IUserCommandHandler
{
private static final int[] COMMAND_IDS =
{
	52
};

/**
 * 
 * @see com.l2jserver.gameserver.handler.IUserCommandHandler#useUserCommand(int, com.l2jserver.gameserver.model.actor.instance.L2PcInstance)
 */
public boolean useUserCommand(int id, L2PcInstance activeChar)
{
	// Thanks nbd
	if (!TvTEvent.onEscapeUse(activeChar.getObjectId()))
	{
		activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		return false;
	}


	int unstuckTimer = (activeChar.getAccessLevel().isGm() ? 1000 : Config.UNSTUCK_INTERVAL * 1000);

	// Check to see if the player is in a festival.
	if (activeChar.isFestivalParticipant())
	{
		activeChar.sendMessage("You may not use an escape command in a festival.");
		return false;
	}

	// Check to see if player is in jail
	if (activeChar.isInJail())
	{
		activeChar.sendMessage("You can not escape from jail.");
		return false;
	}

	if (GrandBossManager.getInstance().getZone(activeChar) != null && !activeChar.isGM())
	{
		activeChar.sendMessage("You may not use an escape command in a Boss Zone.");
		return false;
	}

	if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted()
			|| activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped())
		return false;
	activeChar.forceIsCasting(GameTimeController.getGameTicks() + unstuckTimer / GameTimeController.MILLIS_IN_TICK);


	L2Skill escape = SkillTable.getInstance().getInfo(2099, 1); // 5 minutes escape
	L2Skill GM_escape = SkillTable.getInstance().getInfo(2100, 1); // 1 second escape
	if (activeChar.getAccessLevel().isGm())
	{
		if (GM_escape != null)
		{
			activeChar.doCast(GM_escape);
			return true;
		}
		activeChar.sendMessage("You use Escape: 1 second.");
	}
	else if (Config.UNSTUCK_INTERVAL == 300 && escape  != null)
	{
		activeChar.doCast(escape);
		return true;
	}
	else
	{
		if (Config.UNSTUCK_INTERVAL > 100)
		{
			activeChar.sendMessage("You use Escape: " + unstuckTimer / 60000 + " minutes.");
		}
		else
			activeChar.sendMessage("You use Escape: " + unstuckTimer / 1000 + " seconds.");
	}
	activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
	//SoE Animation section
	activeChar.setTarget(activeChar);
	activeChar.disableAllSkills();

	MagicSkillUse msk = new MagicSkillUse(activeChar, 1050, 1, unstuckTimer, 0);
	Broadcast.toSelfAndKnownPlayersInRadius(activeChar, msk, 810000/*900*/);
	SetupGauge sg = new SetupGauge(0, unstuckTimer);
	activeChar.sendPacket(sg);
	//End SoE Animation section

	EscapeFinalizer ef = new EscapeFinalizer(activeChar);
	// continue execution later
	activeChar.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer));

	return true;
}

static class EscapeFinalizer implements Runnable
{
	private L2PcInstance _activeChar;

	EscapeFinalizer(L2PcInstance activeChar)
	{
		_activeChar = activeChar;
	}

	public void run()
	{
		if (_activeChar.isDead())
			return;

		_activeChar.setIsIn7sDungeon(false);
		_activeChar.enableAllSkills();
		_activeChar.setIsCastingNow(false);
		_activeChar.setInstanceId(0);

		try
		{
			  _activeChar.teleToLocation(147463, 25798, -2039);

		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "", e);
		}
	}
}

/**
 * 
 * @see com.l2jserver.gameserver.handler.IUserCommandHandler#getUserCommandList()
 */
public int[] getUserCommandList()
{
	return COMMAND_IDS;
}
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • @Darafamboos let him know that this is already shared
    • Selling for 35 us umodel that opens any ukx , utx and static meshes from samurai updat 542 protocol . Leave me a pm if needed. 
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • It’s time for something new to rise. In a world filled with short-lived projects and empty promises, Emerge was created with a different vision — a vision built on experience, precision, and long-term commitment. This is not just another server launch. This is the beginning of something that is meant to last. 🌑 Eclipse x10 – A New Beginning Eclipse x10 is designed for players who seek more than just fast progression. It is built for those who value competition, balance, and a real Lineage II experience. From the very first day, every system has been carefully adjusted to provide a smooth and fair journey — where both solo players and clans can thrive. No shortcuts. No chaos. Only a structured and competitive world. ⚔️ What Awaits You • A balanced mid-rate environment (x10 core progression) • Stable and optimized gameplay • Fair systems with focus on long-term play • Competitive PvP and rewarding PvE • Active and dedicated administration • A project built with vision, not temporary hype 📊 Server Rates Basic: EXP/SP: x10 Adena: x5 Drop: x5 Spoil: x5 Secondary: Quests: x1 Seal Stones: x5 Life Stone Drop: x1 Enchant Scroll Drop: x1 Bosses: Raid Boss EXP/SP: x1 Raid Boss Drop: x1 Epic Boss EXP/SP: x1 Epic Boss Drop: x1 Enchant: Safe: +3 Max: +16 📅 Launch Information Grand Opening: 5 June 2026 The countdown has already begun. Clans are forming. Strategies are being prepared. The question is — will you be ready? 🔗 Join the Community Every strong server begins with a strong community. Be part of it from the very start. 💬 Discord: https://discord.gg/l2emerge 🌐 Website: https://www.l2emerge.com  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..