armark1ng

Untitled

Sep 11th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. package com.rs.game.player.dialogues.impl;
  2.  
  3. import com.rs.game.item.Item;
  4. import com.rs.game.player.content.ItemTransportation;
  5. import com.rs.game.player.dialogues.Dialogue;
  6.  
  7. public class Transportation extends Dialogue {
  8.  
  9. @Override
  10. public void start() {
  11. String[] locations = (String[]) parameters[0];
  12. if (locations.length >= 5)
  13. sendOptionsDialogue("Where would you like to teleport to", locations[0], locations[1], locations[2],
  14. locations[3], locations[4]);
  15. else if (locations.length >= 4)
  16. sendOptionsDialogue("Where would you like to teleport to", locations[0], locations[1], locations[2],
  17. locations[3]);
  18. else if (locations.length >= 3)
  19. sendOptionsDialogue("Where would you like to teleport to", locations[0], locations[1], locations[2]);
  20. else if (locations.length >= 2)
  21. sendOptionsDialogue("Where would you like to teleport to", locations[0], locations[1]);
  22. else
  23. sendOptionsDialogue("Where would you like to teleport to", locations[0], "No where");
  24. }
  25.  
  26. @Override
  27. public void run(int interfaceId, int componentId) {
  28. String[] locations = (String[]) parameters[0];
  29. int option = componentId == OPTION_1 ? 0 : ((componentId - OPTION_1) + 1);
  30. ItemTransportation.sendTeleport(player, (Item) parameters[1], option, false,
  31. (locations[locations.length - 1].equals("Nowhere") ? locations.length - 1 : locations.length),
  32. (boolean) parameters[2]);
  33. end();
  34. }
  35.  
  36. @Override
  37. public void finish() {
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment