Advertisement
Guest User

customtele

a guest
Nov 3rd, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java (revision 3)
  6. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java (working copy)
  7. @@ -66,6 +66,17 @@
  8. return;
  9. }
  10. }
  11. + if (actualCommand.equalsIgnoreCase("customtele"))
  12. + {
  13. + if (st.countTokens() <= 0)
  14. + return;
  15. +
  16. + if (condition == COND_REGULAR || condition == COND_OWNER)
  17. + {
  18. + doCustomTeleport(player, Integer.parseInt(st.nextToken()));
  19. + return;
  20. + }
  21. + }
  22. else if (command.startsWith("Chat"))
  23. {
  24. Calendar cal = Calendar.getInstance();
  25. @@ -202,6 +213,32 @@
  26. player.sendPacket(ActionFailed.STATIC_PACKET);
  27. }
  28.  
  29. + private static void doCustomTeleport(L2PcInstance player, int val)
  30. + {
  31. + L2TeleportLocation list = TeleportLocationTable.getInstance().getTemplate(val);
  32. + if (list != null)
  33. + {
  34. + if (player.isInCombat() && player.isAlikeDead())
  35. + {
  36. + player.sendMessage("You Can't Do This!");
  37. + return;
  38. + }
  39. + else if (!Config.KARMA_PLAYER_CAN_USE_GK && player.getKarma() > 0 && player.getPvpFlag() > 0) // karma
  40. + {
  41. + player.sendMessage("Go away, you're not welcome here.");
  42. + return;
  43. + }
  44. + else if (player.destroyItemByItemId("teleport", 57, 100, null, true))
  45. + {
  46. + player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), 20);
  47. + }
  48. + }
  49. + else
  50. + _log.warning("No teleport destination with id:" + val);
  51. +
  52. + player.sendPacket(ActionFailed.STATIC_PACKET);
  53. + }
  54. +
  55. private int validateCondition(L2PcInstance player)
  56. {
  57. if (CastleManager.getInstance().getCastleIndex(this) < 0) // Teleporter isn't on castle ground
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement