Jump to content
  • 0

[Help - request] Teleport Java code


Question

Posted

hi guys i want to add the following java code in my server:

Only 79 lvl+ players could teleport to my custom zone.

Could any1 help me? im newbie on java yet, thnx !

 

1 answer to this question

Recommended Posts

  • 0
Posted

You must add imports yourself

public final class CustomTeleport extends Quest {
private static final String qn = "CustomTeleport";

private static final int X = 0; // Coordinate X from spawn;
private static final int Y = 0; //   "	  "   Y  "     "  
private static final int Z = 0; //   "    "   Z  "     "
private static final int HEADING = 0; // Heading. Can be 0

private static final int NPC_ID = 0; // NPC which will be used as teleport

private static final String HTML_TELEPORTED = "<html><title>Custom Teleport</title><center><br>You are being teleported to YOUR_PLACE</center></body></html>";
private static final String HTML_LOWLEVEL = "<html><title>Custom Teleport</title><center><br>You must be at least level 79</center></body></html>

public CustomTeleport(int questId, String name, String descr) {
	super(questId, name, descr);
	addFirstTalkId(NPC_ID);
}

@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) {
	if(player.getQuestState(qn) == null)
		newQuestState(player);

	if(player.getLevel() >= 79) {
		player.teleToLocation(X,Y,Z,HEADING,0);
		return HTML_TELEPORTED
	} else 
		return HTML_LOWLEVEL;
}

public static void main(String...args) {
	new CustomTeleport(-1,qn,"Custom Teleport");
}
}

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

    • This is very unprofessional. First the price was €10k or maybe €5k then it dropped to $1k After that, he made people think the 166 protocol was fully added, but that is not true. I also have friends who talked to him, and he asked them for different prices in dollars. He does not have a fixed price. Also, the files are not finished. Anyone can make a login with 166 protocol and make it look good, but that does not mean the whole project is done. This kind of work takes a lot of time, and everyone knows that. So be careful if you want to buy files from this person. They are not finished. RIP  
    • L2 Reborn Eternal x10 community board HTML ONLY. Does not have function or Interface.xdat for the tabs. You are responsible to make the functions yourself.      Download
    • 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
    • Dalam World — This is a new gaming project that brings together all the mechanics of your favorite games! I want to say right away that the game will run on all devices: Windows, Linux, macOS (Intel/Apple)! The Dalam World client features advanced graphics that will look great! The client also provides stable FPS even with a huge number of players! Dalam World is not a Salve or Chronicle client ported upward — it’s a completely remade game on its own proprietary game engine! Dalam World servers allow more than 100,000 people to exist in a single world without virtual instances, thanks to server technologies built with Elixir and Rust! Dalam World is the childhood game we love so much! From each of our favorite MMOs we took only the best elements! Low system requirements will let the game run on an old laptop! We redesigned the game so there are no bots or real-money traders! Game website: https://Dalam.World Game forum: https://Dalam.World/forums/ For arbitragers: https://careers.dalam.world/ Discord: https://discord.gg/vbQ347nuxd Telegram: https://t.me/+u1DNZPzscaRmNjYx Opening July 16, 2026 at 16:00 UTC!  
  • 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..