Jump to content

Search the Community

Showing results for tags 'teleport'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 89 results

  1. Should be easy to figure out. May have bugs or not work, I haven't tested it but would like others to post the results! Create a new class and add this in it and name that class TeleportHandler.java: package com.rs.game.player.content; import com.rs.game.WorldTile; import com.rs.game.player.Player; import com.rs.utils.Logger; /** * * @author LionScape * */ public class TeleportHandler { public static void init() { Logger.log("TeleportHandler", "All teleports have been configured."); } /** * X */ public static int[] X = { 3213, 3093, 3222, 2757, 2964, 3093}; /** * Y */ public static int[] Y = { 3423, 3493, 3218, 3477, 3378, 3244}; /** * Teleport method. */ private static void teleport(int a, int b, int c) { getPlayer().setNextWorldTile(new WorldTile(a, b, c)); getPlayer().stopAll(); } /** * Plane */ public static int[] Z = { 0, 1, 2, 3 }; /** * Varrock */ public static void gotoVarrock() { out("You teleport to Varrock."); teleport(X[1],Y[1],Z[1]); } /** * Edgeville */ public static void gotoEdgeville() { out("You teleport to Edgeville."); teleport(X[2],Y[2],Z[1]); } /** * Lumbridge */ public static void gotoLumbridge() { out("You teleport to Lumbridge."); teleport(X[3],Y[3],Z[1]); } /** * Camelot */ public static void gotoCamelot() { out("You teleport to Camelot."); teleport(X[4],Y[4],Z[1]); } /** * Falador */ public static void gotoFalador() { out("You teleport to Falador."); teleport(X[5],Y[5],Z[1]); } /** * Draynor Village */ public static void gotoDraynor() { out("You teleport to Draynor."); teleport(X[6],Y[6],Z[1]); } /** * Message method. */ private static void out(String text) { getPlayer().getPackets().sendGameMessage(text); } /** * Player getPlayer() */ private static Player getPlayer() { return getPlayer(); } } =========================================== Add this return method in Player.java =========================================== public TeleportHandler getTH() { return getTH(); } To use this system: Add this in any class, case or method you want. Switch out CITYNAMEHERE with your city of choice. Draynor, Lumbridge, Edgeville, Varrock etc. player.getTH().gotoCITYNAMEHERE(); Just thought this could be a simple way to teleport to places instead of using the old: player.setNextWorldTile(new WorldTile(x, y, z));
  2. I haven't seen this released yet so thought I should release my version of it. It works exactly like RuneScape. The rest of the teleports I'm sure you can finish to make it 100% as it's close to it; around 95%. Add or replace these [B]cases [/B]in ClickingButtons.java: [CODE] case 4171: case 50056: String type = c.playerMagicBook == 0 ? "modern" : "ancient"; c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, type); break; case 50235: case 4140: if (!c.getItems().playerHasItem(554, 1) || !c.getItems().playerHasItem(556, 3) || !c.getItems().playerHasItem(563, 1)) { c.sendMessage("You do not have the runes required to teleport here."); } else { c.getItems().deleteItem(554, 1); c.getItems().deleteItem(556, 3); c.getItems().deleteItem(563, 1); c.getPA().startTeleport(Config.VARROCK_X, Config.VARROCK_Y, 0, "modern"); } c.teleAction = 1; break; case 4143: case 50245: if (!c.getItems().playerHasItem(557, 1) || !c.getItems().playerHasItem(556, 3) || !c.getItems().playerHasItem(563, 1)) { c.sendMessage("You do not have the runes required to teleport here."); } else { c.getItems().deleteItem(557, 1); c.getItems().deleteItem(556, 3); c.getItems().deleteItem(563, 1); c.getPA().startTeleport(Config.LUMBRIDGE_X, Config.LUMBRIDGE_Y, 0, "modern"); } c.teleAction = 2; break; case 50253: case 4146: if (!c.getItems().playerHasItem(555, 1) || !c.getItems().playerHasItem(556, 3) || !c.getItems().playerHasItem(563, 1)) { c.sendMessage("You do not have the runes required to teleport here."); } else { c.getItems().deleteItem(555, 1); c.getItems().deleteItem(556, 3); c.getItems().deleteItem(563, 1); c.getPA().startTeleport(Config.FALADOR_X, Config.FALADOR_Y, 0, "modern"); } c.teleAction = 3; break; case 51005: case 4150: if (!c.getItems().playerHasItem(556, 5) || !c.getItems().playerHasItem(563, 1)) { c.sendMessage("You do not have the runes required to teleport here."); } else { c.getItems().deleteItem(556, 5); c.getItems().deleteItem(563, 1); c.getPA().startTeleport(Config.CAMELOT_X, Config.CAMELOT_Y, 0, "modern"); } c.teleAction = 4; break; case 51013: case 6004: if (!c.getItems().playerHasItem(555, 2) || !c.getItems().playerHasItem(563, 2)) { c.sendMessage("You do not have the runes required to teleport here."); } else { c.getItems().deleteItem(555, 2); c.getItems().deleteItem(563, 2); c.getPA().startTeleport(Config.ARDOUGNE_X, Config.ARDOUGNE_Y, 0, "modern"); } c.teleAction = 5; break; [/CODE] And make sure to add these [B]ints [/B]in Config.java: [CODE] /** * Glory */ public static final int EDGEVILLE_X = 3087; public static final int EDGEVILLE_Y = 3500; public static final int AL_KHARID_X = 3293; public static final int AL_KHARID_Y = 3174; public static final int KARAMJA_X = 3087; public static final int KARAMJA_Y = 3500; public static final int MAGEBANK_X = 2538; public static final int MAGEBANK_Y = 4716; /** * Modern */ public static final int VARROCK_X = 3210, VARROCK_Y = 3424; public static final int YANILLE_X = 2569, YANILLE_Y = 3099; public static final int DRAYNOR_X = 3093, DRAYNOR_Y = 3244; public static final int LUMBRIDGE_X = 3222, LUMBRIDGE_Y = 3218; public static final int FALADOR_X = 2964, FALADOR_Y = 3378; public static final int CAMELOT_X = 2757, CAMELOT_Y = 3479; public static final int ARDOUGNE_X = 2662, ARDOUGNE_Y = 3305; public static final int WATCH_TOWER_X = 2547, WATCH_TOWER_Y = 3112; public static final int TROLLHEIM_X = 2910, TROLLHEIM_Y = 3612; public static final int APE_ATOLL_X = 2754, APE_ATOLL_Y = 2784; /** * Ancient */ public static final int PADDEWWA_X = 3098; public static final int PADDEWWA_Y = 9884; public static final int SENNTISTEN_X = 3322; public static final int SENNTISTEN_Y = 3336; public static final int KHARYRLL_X = 3492; public static final int KHARYRLL_Y = 3471; public static final int LASSAR_X = 3006; public static final int LASSAR_Y = 3471; public static final int DAREEYAK_X = 3161; public static final int DAREEYAK_Y = 3671; public static final int CARRALLANGAR_X = 3156; public static final int CARRALLANGAR_Y = 3666; public static final int ANNAKARL_X = 3288; public static final int ANNAKARL_Y = 3886; public static final int GHORROCK_X = 2977; public static final int GHORROCK_Y = 3873; [/CODE] Hope that helps! <3
  3. Hello guys, On my 718 RSPS I have a box that teleports you home (If you do ;;home you get in the box and boom you are home) But I don't know if it's possible on a 667 RSPS, Does any one knows and can you tell me how it works? Thank you! - Oblivion
  4. How edit the teleport coordinates. [ATTACH=CONFIG]11084[/ATTACH]
  5. Please help. UPDATE BUT STILL DOESNT WORK. [CODE]if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "modern"); } else c.sendMessage("Sorry you can't do that in wild."); }[/CODE] [IMG]http://puu.sh/eBkid.png[/IMG]
  6. What have i made worng here, i tried to make a teleport command for all users, anyone can help me? [B][COLOR="#0000FF"] Code number 2 is the full Command.java filee[/COLOR][/B] Im not sure what version i use. i dont know how check, i belive its 317 with some other versions interfaces. could be nice if someone could tell me quick. [B][COLOR="#FF0000"]Code 1 (DOESNT WORK)[/COLOR][/B] [CODE] if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "You have teleported home"); } else c.sendMessage("Sorry you can't do that in wild."); }[/CODE] [B][COLOR="#FF0000"]Code 2[/COLOR][/B] [CODE]package server.model.players.packets; import java.io.BufferedWriter; import server.Config; import server.Connection; import server.Server; import server.model.players.Client; import server.model.players.PacketType; import server.model.players.PlayerHandler; import server.model.players.PlayerSave; import server.model.players.Player; import server.util.Misc; import server.world.WorldMap; /** * Commands **/ public class Commands implements PacketType { public static void serverMessage(String s) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if(Server.playerHandler.players[j] != null) { Client c = (Client)Server.playerHandler.players[j]; c.sendMessage(s); } } } [MENTION=15855]Over[/MENTION]ride public void processPacket(Client c, int packetType, int packetSize) { String playerCommand = c.getInStream().readString(); /* PublicEvent.processEntry(c, playerCommand); if(c.playerRights == 3) { if(playerCommand.startsWith("wreck")) PublicEvent.forceFirst(); }*/ if (playerCommand.startsWith("/") && playerCommand.length() > 1) { if (c.clanId >= 0) { System.out.println(playerCommand); playerCommand = playerCommand.substring(1); Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId); } else { if (c.clanId != -1) c.clanId = -1; c.sendMessage("You are not in a clan."); } return; } if (Config.SERVER_DEBUG) Misc.println(c.playerName+" playerCommand: "+playerCommand); if (c.playerRights >= 0) playerCommands(c, playerCommand); if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3) moderatorCommands(c, playerCommand); if (c.playerRights == 2 || c.playerRights == 3 || c.playerRights == 8) administratorCommands(c, playerCommand); if (c.playerRights == 3) ownerCommands(c, playerCommand); if (c.playerRights == 7) veteranCommands(c, playerCommand); if(c.playerRights == 8) playerSupportCommands(c, playerCommand); } public static String auth; public void playerCommands(Client c, String playerCommand) { if (playerCommand.startsWith("food")) { if(!c.inWild()){ c.getItems().addItem(392, 300); } else c.sendMessage("Sorry you can't do that in wild."); } if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "You have teleported home"); } else c.sendMessage("Sorry you can't do that in wild."); } if (playerCommand.startsWith("setlevel")) { if (c.inWild()) { c.sendMessage("You cannot set your level while in PVP."); } for (int j = 0; j < c.playerEquipment.length; j++) { if (c.playerEquipment[j] > 0) { c.sendMessage("Please take all your armour and weapons off before using this command."); return; } } try { String[] args = playerCommand.split(" "); int skill = Integer.parseInt(args[1]); int level = Integer.parseInt(args[2]); if (skill > 6) { c.sendMessage("You can only set your combat levels"); return; } if (level > 99) level = 99; else if (level < 0) level = 1; c.playerXP[skill] = c.getPA().getXPForLevel(level)+5; c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]); c.getPA().refreshSkill(skill); } catch (Exception e){} } if (playerCommand.startsWith("kdr")) { // You dont want them spamming when there muted. true true. if(Connection.isMuted(c)){ c.sendMessage("You are muted."); return; } double KDR = ((double)c.KC)/((double)c.DC); c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+"."); } if (playerCommand.startsWith("empty")) { c.getItems().removeAllItems(); c.sendMessage("You empty your inventory. Please make sure not to use this command if you have any not spawnable items."); } if (playerCommand.equalsIgnoreCase("players")) { c.sendMessage("There are currently "+ PlayerHandler.getPlayerCount()+" players online."); } if (playerCommand.equalsIgnoreCase("master")) { if(!c.inWild()) { for (int i = 0; i < 7; i++) { c.playerLevel[i] = 99; c.playerXP[i] = c.getPA().getXPForLevel(100); c.getPA().refreshSkill(i); } c.getPA().requestUpdates(); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.startsWith("pure")) { if(!c.inWild()) { int i = 0; if (c.inWild()) return; c.getPA().addSkillXP((140333), 0); c.getPA().addSkillXP((403332), 2); c.getPA().addSkillXP((403332), 3); c.getPA().addSkillXP((403332), 4); c.getPA().addSkillXP((403332), 6); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.equalsIgnoreCase("barrage")) { if(!c.inWild()) { c.getItems().addItem(560, 500); c.getItems().addItem(565, 500); c.getItems().addItem(555, 1000); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.equalsIgnoreCase("veng")) { if(!c.inWild()) { c.getItems().addItem(560, 500); c.getItems().addItem(9075, 500); c.getItems().addItem(557, 1000); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.startsWith("item") && c.playerRights >= 0) { if (c.inWild()) return; try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); for (int i = 0; i < Config.UNSPAWNABLE.length; i++) { if (c.getItems().getItemName(newItemID).toLowerCase().contains(Config.UNSPAWNABLE[i])) { c.sendMessage("This item is currently unspawnable."); return; } } if ((newItemID <= 20073) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); } else { c.sendMessage("That item does not exist."); } } else { c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))"); } } catch(Exception e) { e.printStackTrace(); } } if (playerCommand.startsWith("yell")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client all = (Client)Server.playerHandler.players[j]; String userTitle = ""; switch(c.playerRights) { case 0: c.sendMessage("You have to be a Donator to use this feature..."); return; case 1: userTitle = "@[email protected]"; break; case 2: userTitle = "@[email protected]@Admin"; break; case 3: userTitle = "@[email protected]>"; break; case 4: userTitle = "@[email protected]"; break; } if (c.playerName.equalsIgnoreCase("Aki")) userTitle = "@[email protected]"; all.sendMessage("" + userTitle + "" + " " + (c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); } } } if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) { c.sendMessage("Use as ::changepassword (newpasshere)."); c.playerPass = playerCommand.substring(15); c.sendMessage("Your password is now: " + c.playerPass); } } public void veteranCommands(Client c, String playerCommand) { } public void playerSupportCommands(Client c, String playerCommand) { } public void moderatorCommands(Client c, String playerCommand) { /*if(playerCommand.startsWith("testjail")) { // Good luck. 1 Hour. All informaton is here, try { String playerToBan = playerCommand.substring(5); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client) Server.playerHandler.players[i]; if (c2.jailTimer == 0) { int cells = Misc.random(3); if (cells == 0) { c2.teleportToX = 3102; c2.teleportToY = 9760; c2.heightLevel = 0; } else if (cells == 1) { c2.teleportToX = 3097; c2.teleportToY = 9760; c2.heightLevel = 0; } else if (cells == 2) { c2.teleportToX = 3102; c2.teleportToY = 9765; c2.heightLevel = 0; } else if (cells == 3) { c2.teleportToX = 3097; c2.teleportToY = 9765; c2.heightLevel = 0; } c2.jailTimer = (60*1)*10; c2.sendMessage("You have been jailed by "+c.playerName+" for 10 minutes. He will be with you shortly."); c.sendMessage("You have jailed "+c2.playerName+". His timer is automatically set to 10 minutes."); c.sendMessage("Type ::addtime to add 5 minutes more to his jail sentence, if it's needed."); c.sendMessage("It is advised you talk to him about the issue. Type ::cell"+cells+" to visit his cell."); } else { if (c2.jailTimer >= 61) { c.sendMessage(""+c2.playerName+" is already in jail for another "+c2.jailTimer/60+" minutes. Type ::addtime to add 5 minutes."); } else if (c2.jailTimer >= 1 && c.jailTimer <= 60) { c.sendMessage(""+c2.playerName+" is already in jail for another "+c2.jailTimer+" seconds. Type ::addtime to add 5 minutes."); } } } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } }*/ if (playerCommand.startsWith("xteleto")) { String name = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (Server.playerHandler.players[i] != null) { if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) { c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel); } } } } if (playerCommand.startsWith("ban") && c.playerRights >= 1 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(4); Connection.addNameToBanList(playerToBan); Connection.addNameToFile(playerToBan); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Server.playerHandler.players[i].disconnected = true; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unban") && c.playerRights >= 2 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(6); Connection.removeNameFromBanList(playerToBan); c.sendMessage(playerToBan + " has been unbanned."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("mute") && c.playerRights >= 1 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(5); Connection.addNameToMuteList(playerToBan); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (Server.playerHandler.players[i] != null) { if (Server.playerHandler.players[i].playerName .equalsIgnoreCase(playerToBan)) { Client c2 = (Client) Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unmute")) { try { String playerToBan = playerCommand.substring(7); Connection.unMuteUser(playerToBan); Connection.removeNameFromMuteList(playerToBan); c.sendMessage("The nigger has been unmuted."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("ipmute") && c.playerRights >= 1) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName); Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } } public void administratorCommands(Client c, String playerCommand) { if(playerCommand.startsWith("jail")) { try { String playerToBan = playerCommand.substring(5); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 2631; c2.teleportToY = 9860; c2.sendMessage("You have been jailed by "+c.playerName+""); c.sendMessage("Successfully Jailed "+c2.playerName+"."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("unjail")) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 3087; c2.teleportToY = 3500; c2.sendMessage("You have been unjailed by "+c.playerName+""); c.sendMessage("Successfully unjailed "+c2.playerName+"."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("item") && c.playerRights == 2) { try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if ((newItemID <= 22000) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); System.out.print("Spanwed Item"); } else { c.sendMessage("No such item."); } } else if (args.length == 2) { try { int newItemID = Integer.parseInt(args[1]); c.getItems().addItem(newItemID, 1); } catch (Exception e) { String itemName = args[1]; for (int i = 0; i < 22000; i++) { if (c.getItems().getItemName(i).toLowerCase().equalsIgnoreCase("" + itemName.toLowerCase())) { c.sendMessage("Item id: <col=16713217>" + i); c.getItems().addItem(i, 1); System.out.print("Spanwed Item"); return; } } } } else { c.sendMessage("Use as ::item 995 200"); } } catch (Exception e) { } } if (playerCommand.startsWith("ipban") && c.playerRights >= 2) { try { String playerToBan = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom); Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom); Server.playerHandler.players[i].disconnected = true; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equalsIgnoreCase("mypos") && c.playerRights >= 2) { c.sendMessage("X: "+c.absX); c.sendMessage("Y: "+c.absY); } if (playerCommand.startsWith("ipmute")) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName); Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ "."); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equalsIgnoreCase("mypos")) { c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel); } if (playerCommand.startsWith("interface")) { String[] args = playerCommand.split(" "); c.getPA().showInterface(Integer.parseInt(args[1])); } if (playerCommand.startsWith("gfx")) { String[] args = playerCommand.split(" "); c.gfx0(Integer.parseInt(args[1])); } if (playerCommand.startsWith("xteletome")) { try { String playerToTele = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been teleported to " + c.playerName); c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("tele")) { String[] arg = playerCommand.split(" "); if (arg.length > 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3])); else if (arg.length == 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); } if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') { try { String playerToBan = playerCommand.substring(4); Connection.addNameToBanList(playerToBan); Connection.addNameToFile(playerToBan); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Server.playerHandler.players[i].disconnected = true; Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ "."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unipmute")) { try { String playerToBan = playerCommand.substring(9); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unban")) { try { String playerToBan = playerCommand.substring(6); Connection.removeNameFromBanList(playerToBan); c.sendMessage(playerToBan + " has been unbanned."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } } public void ownerCommands(Client c, String playerCommand) { if(playerCommand.equals("saveall")) { for (final Player p : PlayerHandler.players) { if (p != null) { PlayerSave.saveGame((Client) p); } } System.out.println("Saved all games."); } if (playerCommand.startsWith("update")) { try { String[] args = playerCommand.split(" "); if (args.length == 2) { int seconds = Integer.parseInt(args[1]); PlayerHandler.updateSeconds = seconds; PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); } else { c.sendMessage("Use as ::update (seconds)"); } } catch (Exception e) { } } if (playerCommand.startsWith("item") && c.playerRights == 3) { try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if ((newItemID <= 22000) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); System.out.print("Spanwed Item"); } else { c.sendMessage("No such item."); } } else if (args.length == 2) { try { int newItemID = Integer.parseInt(args[1]); c.getItems().addItem(newItemID, 1); } catch (Exception e) { String itemName = args[1]; for (int i = 0; i < 22000; i++) { if (c.getItems().getItemName(i).toLowerCase().equalsIgnoreCase("" + itemName.toLowerCase())) { c.sendMessage("Item id: <col=16713217>" + i); c.getItems().addItem(i, 1); System.out.print("Spanwed Item"); return; } } } } else { c.sendMessage("Use as ::item 995 200"); } } catch (Exception e) { } } if (playerCommand.startsWith("object")) { String[] args = playerCommand.split(" "); c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10); } if (playerCommand.equalsIgnoreCase("bank")) { c.getPA().openUpBank(); } if (playerCommand.startsWith("getip") && c.playerRights >= 3) { try { String iptoget = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) { c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom); } } } } catch(Exception e) { c.sendMessage("Player Must Be Online."); } } if (playerCommand.startsWith("xteletome")) { try { String playerToTele = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been teleported to " + c.playerName); c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("restart") && c.playerRights >= 3) { for(Player p : PlayerHandler.players) { if(p == null) continue; PlayerSave.saveGame((Client)p); } System.exit(0); } if (playerCommand.startsWith("tele")) { String[] arg = playerCommand.split(" "); if (arg.length > 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3])); else if (arg.length == 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); } if (playerCommand.startsWith("ipban")) { try { String playerToBan = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom); Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom); Client c2 = (Client)Server.playerHandler.players[i]; Server.playerHandler.players[i].disconnected = true; c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ "."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("npc")) { try { int newNPC = Integer.parseInt(playerCommand.substring(4)); if(newNPC > 0) { Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false); c.sendMessage("You spawn a Npc."); } else { c.sendMessage("No such NPC."); } } catch(Exception e) { } } if (playerCommand.startsWith("anim")) { String[] args = playerCommand.split(" "); c.startAnimation(Integer.parseInt(args[1])); c.getPA().requestUpdates(); } if (playerCommand.startsWith("spec")) { if(!c.inWild()) { c.specAmount = 10.0; } else c.sendMessage("Bitch dont use this in wild"); } if (playerCommand.startsWith("giveadmin")) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given admin status by " + c.playerName); c2.playerRights = 2; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("givedonator")) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given donator status by " + c.playerName); c2.playerRights = 4; c2.memberStatus = 1; c2.donPoints += 50; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equals("alltome")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; c2.teleportToX = c.absX; c2.teleportToY = c.absY; c2.heightLevel = c.heightLevel; c2.sendMessage("Mass teleport to: " + c.playerName + ""); } } } if (playerCommand.startsWith("giveowner") && (c.playerName.equalsIgnoreCase("aki"))) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given admin status by " + c.playerName); c2.playerRights = 3; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("givemod")) { try { String playerToMod = playerCommand.substring(8); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given mod status by " + c.playerName); c2.playerRights = 1; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("copy")) { int[] arm = new int[14]; String name = playerCommand.substring(5); for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; if(c2.playerName.equalsIgnoreCase(playerCommand.substring(5))){ for(int q = 0; q < c2.playerEquipment.length; q++) { arm[q] = c2.playerEquipment[q]; c.playerEquipment[q] = c2.playerEquipment[q]; } for(int q = 0; q < arm.length; q++) { c.getItems().setEquipment(arm[q],1,q); } } } } } if (playerCommand.startsWith("demote")) { try { String playerToDemote = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been demoted by " + c.playerName); c2.playerRights = 0; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("restart") && c.playerRights == 3) { for(Player p : PlayerHandler.players) { if(p == null) continue; PlayerSave.saveGame((Client)p); } System.exit(0); } if (playerCommand.startsWith("movehome") && c.playerRights == 3) { try { String playerToBan = playerCommand.substring(9); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 3086; c2.teleportToY = 3493; c2.heightLevel = c.heightLevel; c.sendMessage("You have teleported " + c2.playerName + " to Home"); c2.sendMessage("You have been teleported to home"); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equals("alltome")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; c2.teleportToX = c.absX; c2.teleportToY = c.absY; c2.heightLevel = c.heightLevel; c2.sendMessage("Mass teleport to: " + c.playerName + ""); } } } if (playerCommand.startsWith("giveitem") && c.playerRights >= 3) { try { String[] args = playerCommand.split(" "); int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); String otherplayer = args[3]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just given " + newItemAmount + " of item number: " + newItemID +"." ); c2.sendMessage("You have just been given item(s)." ); c2.getItems().addItem(newItemID, newItemAmount); } catch(Exception e) { c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME."); } } if (playerCommand.startsWith("takeitem") && c.playerRights >= 3) { try { String[] args = playerCommand.split(" "); int takenItemID = Integer.parseInt(args[1]); int takenItemAmount = Integer.parseInt(args[2]); String otherplayer = args[3]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just removed " + takenItemAmount + " of item number: " + takenItemID +"." ); c2.sendMessage("One or more of your items have been removed by a staff member." ); c2.getItems().deleteItem(takenItemID, takenItemAmount); } catch(Exception e) { c.sendMessage("Use as ::takeitem ID AMOUNT PLAYERNAME."); } } if (playerCommand.startsWith("givedonatorpoints") && c.playerName.equalsIgnoreCase("Aki")) { try { String[] args = playerCommand.split("-"); int amount = Integer.parseInt(args[1]); String otherplayer = args[2]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just given " + amount + " PK points."); c2.sendMessage("You have just been given " + amount + " PK points" ); c2.donPoints += amount; } catch(Exception e) { c.sendMessage("Use as ::givepkp-AMOUNT-PLAYERNAME."); } } /* if (playerCommand.startsWith("givepoints")) { try { String playerToG = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) { Server.playerHandler.players[i].pcPoints += 100; c.sendMessage("You have given "+Server.playerHandler.players[i].playerName+" 100 SXP from: "+Server.playerHandler.players[i].connectedFrom); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } }*/ } }[/CODE]
  7. Awhile ago i made a teleport handler that wasn't the best. But im back with a better teleport handler. First off add this class Fix the imports and the packaging [CODE]package org.rs2server.entity.players.teleport; import org.rs2server.Config; import org.rs2server.entity.players.Client; import org.rs2server.entity.players.PlayerHandler; import org.rs2server.event.CycleEvent; import org.rs2server.event.CycleEventContainer; import org.rs2server.event.CycleEventHandler; /** * This class will handle all everything to do with the teleporting * it will check if the player is eligible to teleport and * handle all the animations and gfxs. * @author Zack/Optimum * */ public class Teleport { /** * The player teleporting */ private Client player; /** * The targeted x, y and h coordinates */ private int targetX, targetY, targetH; /** * Constructor for teleporting * [MENTION=75098]Para[/MENTION]m player - the player */ public Teleport(Client player){ this.player = player; } /** * Submits a new teleport tab type * [MENTION=75098]Para[/MENTION]m tarX - the new x coordinates * [MENTION=75098]Para[/MENTION]m tarY - the new y coordinates */ public void submitTab(final int tarX, final int tarY){ this.targetX = tarX; this.targetY = tarY; startTeleport(TeleportType.TELETAB_TELEPORT); } /** * Submits a new ancient teleport type * [MENTION=75098]Para[/MENTION]m tarX - the new x coordinates * [MENTION=75098]Para[/MENTION]m tarY - the new y coordinates */ public void submitAncient(final int tarX, final int tarY){ this.targetX = tarX; this.targetY = tarY; startTeleport(TeleportType.ANICENT_TELEPORT); } /** * Submits a new ancient teleport type * [MENTION=75098]Para[/MENTION]m tarX - the new x coordinates * [MENTION=75098]Para[/MENTION]m tarY - the new y coordinates * [MENTION=75098]Para[/MENTION]m tarH - the new height */ public void submitAncient(final int tarX, final int tarY, final int tarH){ this.targetX = tarX; this.targetY = tarY; this.targetH = tarH; startTeleport(TeleportType.ANICENT_TELEPORT); } /** * Submits a new modern teleport * [MENTION=75098]Para[/MENTION]m tarX - the new x coordinates * [MENTION=75098]Para[/MENTION]m tarY - the new y coordinates */ public void submitModern(final int tarX, final int tarY){ this.targetX = tarX; this.targetY = tarY; startTeleport(TeleportType.MODERN_TELEPORT); } /** * Submits a new modern teleport * [MENTION=75098]Para[/MENTION]m tarX - the new x coordinates * [MENTION=75098]Para[/MENTION]m tarY - the new y coordinates * [MENTION=75098]Para[/MENTION]m tarH - the new height */ public void submitModern(final int tarX, final int tarY, final int tarH){ this.targetX = tarX; this.targetY = tarY; this.targetH = tarH; startTeleport(TeleportType.MODERN_TELEPORT); } /** * Handles the teleport event in 3 stages */ public void startTeleport(final TeleportType teleType){ if(!canTeleport(player)) return; final int startStage = teleType.getTickTimer1Start(); final int middleStage = teleType.getTickTimer2Start(); final int stopStage = teleType.getStopTimer(); cancelTradeAndDuel(player); player.stopMovement(); player.isTeleporting = true; player.startAnimation(teleType.getStartGfxAnim()[0]); if(teleType.getStartGfxAnim()[2] == 100) player.gfx100(teleType.getStartGfxAnim()[1]); else player.gfx0(teleType.getStartGfxAnim()[1]); CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() { int stage = 0; [MENTION=15855]Over[/MENTION]ride public void execute(CycleEventContainer container) { if (stage == startStage) { player.startAnimation(teleType.getTimer1GfxAnim()[0]); if(teleType.getTimer1GfxAnim()[2] == 100) player.gfx100(teleType.getTimer1GfxAnim()[1]); else player.gfx0(teleType.getTimer1GfxAnim()[1]); } if (stage == middleStage){ player.startAnimation(teleType.getTimer2GfxAnim()[0]); if(teleType.getTimer2GfxAnim()[2] == 100) player.gfx100(teleType.getTimer2GfxAnim()[1]); else player.gfx0(teleType.getTimer2GfxAnim()[1]); player.getPA().movePlayer(targetX, targetY, targetH); } if(stage == stopStage){ player.startAnimation(65535); player.resetWalkingQueue(); container.stop(); } stage++; System.out.println("Teleport Stage: " + stage); } [MENTION=15855]Over[/MENTION]ride public void stop() { player.isTeleporting = false; } }, 1); } /** * Checks to see if the player is eligible for teleporting * [MENTION=75098]Para[/MENTION]m player - The target player * [MENTION=184045]return[/MENTION] true if the player can teleport */ public boolean canTeleport(Client player){ if(player == null) return false; if(player.isDead) return false; if (isDueling(player)) return false; if(isTeleBlocked(player)) return false; if(player.isTeleporting) return false; if(wildyLevelCheck(player)) return false; return true; } /** * Checks to see if the player is in a duel * [MENTION=75098]Para[/MENTION]m player - The target player * [MENTION=184045]return[/MENTION] true if the player is in a duel */ public boolean isDueling(Client player){ if (player.duelStatus == 5) { player.sendMessage("You can't teleport during a duel!"); return true; } else return false; } /** * Checks if the player is teleblocked * [MENTION=75098]Para[/MENTION]m player - The target player * [MENTION=184045]return[/MENTION] true if player is teleblocked */ public boolean isTeleBlocked(Client player){ if (System.currentTimeMillis() - player.teleBlockDelay < player.teleBlockLength) { player.sendMessage("You are teleblocked and can't teleport."); return true; } else return false; } /** * Cancels the trade and duel for {@link player} and * the opponent he is dueling / trading with * [MENTION=75098]Para[/MENTION]m player - the target player */ public void cancelTradeAndDuel(Client player){ if (player.duelStatus >= 1 && player.duelStatus <= 4) { Client o = (Client) PlayerHandler.players[player.duelingWith]; player.duelStatus = 0; o.duelStatus = 0; o.getTradeAndDuel().declineDuel(); player.getTradeAndDuel().declineDuel(); } } /** * Checks the current player wilderness level and returns true * if the player is above the max teleport wilderness level * [MENTION=75098]Para[/MENTION]m player - The target player * [MENTION=184045]return[/MENTION] if player is in wildy > 20 */ public boolean wildyLevelCheck(Client player){ if (player.inWild() && player.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { player.sendMessage("You can't teleport above level " + Config.NO_TELEPORT_WILD_LEVEL + " in the wilderness."); return true; } else return false; } } [/CODE] Now add this class inside the same package [CODE]package org.rs2server.entity.players.teleport; /** * Contains all the teleport types and all their data * @author Zack/Optimum * */ public enum TeleportType { MODERN_TELEPORT( new int[] {714, -1, 0}, 1, new int[] {-1, 308, 100}, 3, new int[] {715, -1, 0}, 6), ANICENT_TELEPORT( new int[] {9599, 1681, 0}, 5, new int[] {-1, -1, 0}, 5, new int[] {-1, -1, 0}, 5), TELETAB_TELEPORT( new int[] {9597, 1680, 0}, 2, new int[] {4731, -1, 0}, 3, new int[] {9598, -1, 0}, 4); int[] startGfxAnim; int tickTimer1Start; int[] timer1GfxAnim; int tickTimer2Start; int[] timer2GfxAnim; int stopTimer; TeleportType(int[] startGfxAnim, int tickTimer1Start, int[] timer1GfxAnim, int tickTimer2Start, int[] timer2GfxAnim, int stopTimer){ this.startGfxAnim = startGfxAnim; this.tickTimer1Start = tickTimer1Start; this.timer1GfxAnim = timer1GfxAnim; this.tickTimer2Start = tickTimer2Start; this.timer2GfxAnim = timer2GfxAnim; this.stopTimer = stopTimer; } public int[] getStartGfxAnim(){ return startGfxAnim; } public int getTickTimer1Start(){ return tickTimer1Start; } public int[] getTimer1GfxAnim(){ return timer1GfxAnim; } public int getTickTimer2Start(){ return tickTimer2Start; } public int[] getTimer2GfxAnim(){ return timer2GfxAnim; } public int getStopTimer(){ return stopTimer; } } [/CODE] now go to Client.java and add these: [code] private Teleport teleport = new Teleport(this); public Teleport getTeleportHandler(){ return teleport; }[/code] this is an example of how to use this: [code] case 4171: case 117048: case 75010: case 50056: case 84237: if(c.playerMagicBook != 1) { c.getTeleportHandler().submitModern(Config.RESPAWN_X, Config.RESPAWN_Y); } else { c.getTeleportHandler().submitAncient(Config.RESPAWN_X, Config.RESPAWN_Y); } break;[/code] If i have missed anything please tell me.
  8. So I tried making a tele command to teleport staff to the staffzone which allows them to step into portals and the portal teleport them to new content to test it all. I have tried a few things and it does not work. please help. This is the code. Please Help. [CODE] if (cmd[0].equals("SZ")) { if (player.isDead() || player.isLocked()) { player.sendMessage("You are unable to teleport home at this time."); return true; } Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1375, 6621, 0)); return true; }[/CODE]
  9. I've seen people creating a shitload of static methods just to handle one teleport, what I have basically done is that you can use any teleportation type by giving a simple type. [CODE]package com.rs.game.player; import com.rs.game.Animation; import com.rs.game.Graphics; import com.rs.game.WorldTile; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; /** * * @author Fuzen Seth * [MENTION=98951]infor[/MENTION]mation This is a proper class to handle world teleportation. * [MENTION=3199]Sin[/MENTION]ce 8.10.2014 */ public class Teleportation { /** This enum represents the teleport types. */ public static enum TeleType { MODERN, ANCIENT, LUNAR, SCROLL, LODESTONE, INSTANT, TAB_TELEPORT, FAIRY_RING; } /** Teleports a player with given destionation and teleport type. */ public static final void teleport(final Player player, final int x, final int y, final int plane, TeleType teleType) { switch (teleType) { case FAIRY_RING: if (!player.canSpawn()) { player.getPackets().sendGameMessage( "A mysterious force prevents you from teleporting."); return; } player.setNextAnimation(new Animation(3254)); player.setNextGraphics(new Graphics(2670)); player.lock(); WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { player.setNextWorldTile(new WorldTile(x, y, plane)); player.setNextAnimation(new Animation(3255)); player.setNextGraphics(new Graphics(2670)); player.unlock(); stop(); } }, 2); break; case ANCIENT: break; case LODESTONE: break; case LUNAR: break; case MODERN: break; case SCROLL: break; case INSTANT: player.setNextWorldTile(new WorldTile(x, y, plane)); break; case TAB_TELEPORT: break; default: player.sendMessage("Teleportation type unknown."); break; } } } [/CODE] How to use this system? [CODE]Teleportation.teleport(player, 3200, 3200, 0, TeleType.INSTANT); [/CODE] The following code would teleport player instantly to the given destination. I find this way much better than adding over 10 static methods just to handle single timed WorldTask teleport.
  10. [CODE]case 50056: case 75010: String type = c.playerMagicBook == 0 ? "modern" : "ancient"; c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, type); break;[/CODE] Action button id is 75010 and it doesnt seem to work :/ I know this is a noob question and please dont say "use the search button" as ive tried.
  11. So, Im using the rune evo v3 source and when you go into quest tab it shows skilling>basic skilling>Mining and im trying to change the mining teleport to somewhere else by changing the coords. I changed it and compiled but I still teleport to the same place? I edited skillingteleports.java and heres the code. I changed the coords to 3300 3300 but it wont change! public void run(int interfaceId, int componentId) { if (stage == 1) { if (componentId == OPTION_1) { sendOptionsDialogue("Basic Skilling", "Fishing", "Mining", "Agility", "Woodcutting", "More Options"); stage = 2; } if (componentId == OPTION_2) { sendOptionsDialogue("Advanced Skilling", "Mining: Lava Flow Mining", "Hunter: Puro-Puro", "Fishing: Living Rock Caverns", "Slayer: Fremmy Dungeon", "More Options"); stage = 3; } if (componentId == OPTION_3) { end(); } } else if (stage == 2) { if (componentId == OPTION_1) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2599, 3421, 0)); end(); } if (componentId == OPTION_2) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3300, 3300, 0)); end(); } if (componentId == OPTION_3) { sendOptionsDialogue("Which Course?", "Gnome Agility", "Barbarian Outpost", "Go Back..."); stage = 7; } if (componentId == OPTION_4) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3250, 3359, 0)); end(); } if (componentId == OPTION_5) { sendOptionsDialogue("Basic Skilling", "Runecrafting", "Summoning", "Hunter", "Farming", "Dungeoneering"); stage = 4; } } else if (stage == 3) { if (componentId == OPTION_1) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(LavaMine.Lava_Tele)); end(); } if (componentId == OPTION_2) { if (!player.getInventory().hasFreeSlots()) { end(); player.sendMessage("You need atleast 1 free slot to start Puro-Puro."); return; } end(); player.getControlerManager().startControler("PuroPuro"); } if (componentId == OPTION_3) { if (player.getSkills().getLevel(Skills.FISHING) < 90) { end(); player.sendMessage("<col=FF0000>You must be atleast 90 Fishing to go to LRC.</col>"); return; } player.getPackets().sendGameMessage("Talk to Hank for some fishing supplies!"); Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3640, 5138, 0)); end(); } if (componentId == OPTION_4) { if (player.getRights() == 0) { end(); player.sendMessage("You must be donator to access the new slayer dungeon!"); return; } player.getControlerManager().startControler("SlayerControler"); end(); } if (componentId == OPTION_5) { sendOptionsDialogue("Advanced Skilling", "Smithing: Artisan's Workshop", "RuneCrafting: RuneSpan", "Slayer: Kuradel's Slayer Tower", "Farming: Livid Farming"); stage = 5; } } else if (stage == 4) { if (componentId == OPTION_1) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2600, 3162, 0)); end(); } if (componentId == OPTION_2) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2209, 5343, 0)); end(); } if (componentId == OPTION_3) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2526, 2916, 0)); end(); } if (componentId == OPTION_4) { player.getPackets().sendGameMessage("<col=FF0000>This has been replaced by Livid Farming. (See Advanced Skilling list)"); end(); } if (componentId == OPTION_5) { sendOptionsDialogue("Which Dungeon?", "Low Level", "Medium Level", "High Level", "[<col=FF0000>New</col>] Daemonheim"); stage = 6; } } else if (stage == 5) { if (componentId == OPTION_1) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3047, 3336, 0)); end(); } if (componentId == OPTION_2) { player.getPackets().sendGameMessage("Buy essence from the wizard to begin!"); Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3992, 6108, 1)); end(); } if (componentId == OPTION_3) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3428, 3539, 0)); end(); } if (componentId == OPTION_4) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3238, 3350, 0)); end(); } } else if (stage == 6) { if (componentId == OPTION_1) { player.getControlerManager().startControler("Dungeoneering", 0); end(); } if (componentId == OPTION_2) { if (!player.getSkills().hasRequiriments(Skills.DUNGEONEERING, 60)) { player.sendMessage("You need atleast 60 Dungeoneering to enter Mid Level Dung."); return; } player.getControlerManager().startControler("Dungeoneering", 1); end(); } if (componentId == OPTION_3) { if (!player.getSkills().hasRequiriments(Skills.DUNGEONEERING, 99)) { end(); player.sendMessage("You need atleast 99 Dungeoneering to enter High Level Dung."); return; } player.getControlerManager().startControler("Dungeoneering", 2); end(); } if (componentId == OPTION_4) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3451, 3712, 0)); end(); } } else if (stage == 7) { if (componentId == OPTION_1) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2470, 3436, 0)); end(); } if (componentId == OPTION_2) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2541, 3548, 0)); end(); } if (componentId == OPTION_3) { sendOptionsDialogue("Basic Skilling", "Fishing", "Mining", "Agility", "Woodcutting", "More Options"); stage = 2; } } } [MENTION=15855]Over[/MENTION]ride public void finish() { // TODO Auto-generated method stub } }
  12. Requested by a few lil nooblets, here is how you add a cooldown to your magic spellbook teleports. Credits: to Officiallulzs3c for cutting the code down :) It should be noted that my Clickingbuttons.java is a little different to other 317 sources out there, so adjust accordingly or post below if you have any troubles. You will need to open up your clickingbuttons.java file and search for: [CODE] public class ClickingButtons implements PacketType {[/CODE] Under that, you will need to add: [CODE] long lastTeleport = 0; long cooldownTime = 32 * 60000; // Replace 32 with your desired cooldown time(in minutes)[/CODE] The only thing you want to change here is the number 32 to your desired time to wait (in minutes). Now search for the function processPacket. It should start off something like this: [CODE] public void processPacket(Client c, int packetType, int packetSize) { String type = c.playerMagicBook == 0 ? "modern" : "ancient"; int actionButtonId = Misc.hexToInt(c.getInStream().buffer, 0, packetSize); if (c.isDead) return; if (c.playerRights == 3) { c.sendMessage(c.playerName + " - actionbutton: " + actionButtonId); }[/CODE] You will now need to add underneath: [CODE] //Home Teleport if (actionButtonId == 4171){ // Change to your teleport ID if (System.currentTimeMillis() - lastTeleport >= cooldownTime){ c.getPA().startTeleport(c,3225,3218,0,type); // Change to your teleport co-ords lastTeleport = System.currentTimeMillis(); return; } else if(System.currentTimeMillis() - lastTeleport < cooldownTime){ c.sendMessage("You must wait another [MENTION=112005]Blu[/MENTION]@" + ((cooldownTime - (System.currentTimeMillis() - lastTeleport))/60000) + "@[email protected] minutes."); } else{ System.out.println("didnt work D:"); } }[/CODE] EDIT: seems to be mentioning the user Blu instead of accepting it as code... just change the B to a lowercase ^_^ The two things you need to change are as follows: The actionbuttonID to your teleport spell in the spellbook. (see above) The Co-ords of your desired location.(see above) Save the file. Now finally open up Teleports.java and delete the teleport case ID that you've just added above. Otherwise it will teleport you regardless of whether the teleport is cooling down or not. In this example i would find and delete: [CODE] case 4171: c.getPA().startTeleport(c,3225,3218,0,type); break;[/CODE] save the file and compile. :) Congrats you should now have a working cooldown system on your teleports. As I've said before, if you are having troubles with the code or even if you'd like me to do an example of how you would implement this into other areas,such as command teleports,object tele's ect, let me now below. :)
  13. How do I change the x, and y values of teleports in the teleport tab. Base: Cheezscape80
  14. So I have a ladder, ID 1765. So in ActionHandler, I added: [CODE] case 1765: //c.getPA().movePlayer(3067, 10256, 0); if (c.objectX == 3017 && c.objectY == 3849){ c.startAnimation(828); c.getPA().movePlayer(3067, 10256, 0); } break; [/CODE] It looks okay, and It should do the animation and teleport me, but nothing happens when I click the ladder! The ladder is not a custom addition. The coords are all proper, so is the animation! Any ideas on whats going on?
  15. Hello everyone. As my title states, my Home Teleport button isn't working. It just won't work. My code should be correct, see for yourself: [CODE]case 50056: String type = c.playerMagicBook == 0 ? "modern" : "ancient"; c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, type); break;[/CODE] It won't even teleport me anywhere. I click the button and it does nothing. However, my other teleport buttons work. This is really strange, could anyone help? Thanks.
  16. Well staff needs to be able to teleport out of wild after helping...but I can't seem to work around this in the config.java..anyone got an idea what I can do so that mods admins and owner can teleport out of wild freely?
  17. When i press the H buttom then i go to my home but i want it to be with loadstones instead can some one help?
  18. Hello, I was wondering if anyone had the animation ids for the bonesack teleport? [IMG]http://static1.wikia.nocookie.net/__cb20120904121105/runescape/images/f/f2/Bonesack_teleport.gif[/IMG] I couldn't find it anywhere, and how would I go about finding these ids?
  19. Hi, i wanted to ask if someone knows a fix for the pegasus command :? momently i got this code: public static final void sendPegasusTeleport(Player player, int level, double xp, WorldTile tile, int... runes) { sendTeleportSpell(player, 17106, 17107, 3223, 3224, level, xp, tile, 3, true, MAGIC_TELEPORT, runes); } in magic.java and in admin.java i got this code: if (cmd[0].equalsIgnoreCase("home")) { Magic.sendPegasusTeleport(player, 0, 0, new WorldTile(3619, 3342, 0)); return true; } If i use the emote in game with ;;emote 17106 or the dev console emote 17106 then i can see that my character summons the portal, dodges away for pegasus then starts to ride pegasus, and settles of. But when i use this as in the command home, then y..... i end up with this... [ATTACH=CONFIG]9015[/ATTACH] it looks like my char thinks that he is pegasus.... my char gets just stretched out in the form of the pegasus model, O_O_ Is there anyway to fix it? would luv to get it fixed xD Ty already artizan
  20. hyaass

    Teleport Help

    i have this } else if(stage == 2) { if (componentId == OPTION_3) {//Runecrafting sendOptionsDialogue("Runecrafting", "Low Level", "Mid Level", "High Level"); stage = 5; } else if(stage == 5) { if (componentId == OPTION_1) {//Low Level Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3995, 6109, 0)); } if(componentId == OPTION_2) {//Mid Level Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4135, 6088, 0)); } else if(componentId == OPTION_3) {//High Level Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4297, 6040, 0)); } finish(); } and when i click on the places i want to go in my interface it doesn't teleport me there I am relatively new to coding and need some help with this.
  21. How can i make it were players cannot teleport in deep wildy? this is how my wildy looks. [IMG]http://i44.tinypic.com/33epir4.jpg[/IMG]
  22. hey i tryd to added an teleport command for my server for donors ::donorzone and when i did added it there where some problems but now i finnily got it so far it doens't give errors but it just wont work if i added meself to owner i can use the command but when i am not owner but just put donor 1 and playerRights 4 (donor) it wont work this is how it looks like. [QUOTE]} if (playerCommand.equalsIgnoreCase("donorzone") && c.playerRights >= 1 && c.isdonor == 1) { c.getPA().startTeleport(5012, 5358, 0, "modern"); }[/QUOTE] I am also tryd to chance the == to <= and != and >= but somehow nothing seems to work but i can use the command as owner and here is an teleport command that works fine i copyd it and changed the name and location and putted it under this one. [QUOTE]if (playerCommand.equalsIgnoreCase("shops")) { c.getPA().startTeleport(3012, 3358, 0, "modern");[/QUOTE] but i just dont get it why it wont work. If anyone could help me out i thank ur helping post and i am really thankfull for it
  23. when one of my players uses lodestone and teleports to edgeville their client goes black and nulls them i get nothing server sided? thanks in advance
  24. I want teleport options like this please. [IMG][IMG]http://i41.tinypic.com/34oynwx.png[/IMG][/IMG] How do I add them in? Can someone link me to a tut or something? please & thanks!
  25. Whatsup guys, I'm not sure if this whas already released but i just created it for my own project today. [B]What does this do?[/B] It closes your Teleport Interface after teleporting. I thought about this because its verry annoying when u are using a Pking teleport and you are bridding you need to close the tab first before u can attack someone. Ok so here we go: Find your button ID For Example ID: 176146 Go to your Clickingbuttons and find that Button and it will look like this: [code] case 176146: c.getPA().spellTeleport(3366, 3266, 0); break;[/code] So you can see it doesnt do anything, it only teleports you to that location but it doesnt close the Interface. Under the coords add this: [code] c.setSidebarInterface(6, c.playerMagicBook == 0 ? 1151 : c.playerMagicBook == 1 ? 12855 : c.playerMagicBook == 2 ? 16640 : 12855);[/code] What this do: It checks what spellbook the player is using> 0,1 or 2. So when you clicked on the teleport it gets you back to your spellbook. So your button will not look like this: [code] case 177215: c.getPA().spellTeleport(3303, 9375, 0); c.setSidebarInterface(6, c.playerMagicBook == 0 ? 1151 : c.playerMagicBook == 1 ? 12855 : c.playerMagicBook == 2 ? 16640 : 12855); break; [/code] Thanks for using my snippet^^. Remco
×