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

    • Perfect way to experience L2 without the brutal official grind. The progression here is so much smoother and faster, you get to the fun PvP and epic raids way quicker. The custom stuff keeps it fresh too. Definitely worth diving into!
    • L2-Getwork server highly customized with high-stats https://l2server.eu/ https://discord.gg/SsVhm7R Rates: L2 High Five fully customized Getwork Style with High Stats and Enchant ExP/Sp: 75x (custom) Drop/Spoil: 1x (custom) Safe: 500 Max: 50 000   Enchant System: Normal Scrolls: 93% - fail - decrease enchant by 20 Blessed Scrolls: 96% - fail - decrease enchant by 10   Armor Max Enchant D-Grade: +1000 Max Enchant C-Grade: +2000 Max Enchant B-Grade: +3000 Max Enchant A-Grade: +4000 Max Enchant S-Grade: +5000   Weapons Max Enchant D-Grade: +5000 Max Enchant C-Grade: +10000 Max Enchant B-Grade: +15000 Max Enchant A-Grade: +20000 Max Enchant S-Grade: +25000 - 50000   Fir Tree Branch (Weapon): +100 into Weapons (max 50 000) Fir Tree Branch (Armor): +15 into Armor (max 5000) Road to Dvc Cloak Enchant: +1 into cloak (max +1000) Masks of Spirit/Demon Horns Enchants: +1 into Masks (max +10) Each accessories has different max enchant and chances Daily Missions (.missions) Collections (ALT + B) Gambling System(.gamble) - each pack cost different amount Gamble Points, different items How to get gambling points? - by killing Raid Bosses/Events or Completing Daily Missions. Clan Bonus VIP Bonuses (maximum level 10) Battlepass (maximum level 100) - by killing monsters Rebirth (starting in Parnassus) Everything in ALT+B Master's Buffs - 100 Small Glass Box (1 buff) Farm Zones: Custom Farm Zones: Ruin of Agony (Exp Zone) Underground Coliseum (Safe Exp Zone) DVC,Brigand,Frost are similiar farm zones with same monsters Dvc Brigand Stronghold Frost Lake Parnassus - TOP ZONE some of our features: .gamble,collections,battlepass,talent tree, rebirth        
    • https://www.mediafire.com/file/l905r1sd84hnovf/FileEdit.rar/file
  • 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