Rio Posted May 8, 2012 Posted May 8, 2012 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 ! Quote
0 B1ggBoss Posted May 9, 2012 Posted May 9, 2012 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"); } } Quote
Question
Rio
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.