armark1ng

Untitled

Sep 11th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. package com.rs.game.player.content;
  2.  
  3. import com.rs.game.WorldTile;
  4. import com.rs.game.player.Player;
  5.  
  6. public class GnomeGlider {
  7.  
  8. private static final int GLIDER_INTEFACE = 138;
  9. private static final WorldTile[] GLIDERS = { new WorldTile(2464, 3503, 3), new WorldTile(2845, 3501, 0),
  10. new WorldTile(3322, 3431, 0), new WorldTile(3284, 3213, 0), new WorldTile(2973, 2969, 0),
  11. new WorldTile(2545, 2972, 0) };
  12. private static final long[] DELAY = { 1, 1, 2, 2, 2, 1 };
  13. private static final int[][] CONFIGS = { { -1, 1, 3, 4, 7, 10 }, { -1, 2, -1, 5, 6, 11 } };
  14.  
  15. public static void openInterface(Player player, int index) {
  16. if (index != 0)
  17. sendGlider(player, index, true);
  18. player.getInterfaceManager().sendInterface(GLIDER_INTEFACE);
  19. }
  20.  
  21. public static void sendGlider(final Player player, final int index, final boolean isReturning) {
  22. player.getVarsManager().sendVar(153, CONFIGS[isReturning ? 1 : 0][index]);
  23. player.getTemporaryAttributtes().put("using_carrier", true);
  24. FadingScreen.fade(player, DELAY[index] + 1, new Runnable() {
  25.  
  26. @Override
  27. public void run() {
  28. int delay = (int) DELAY[index];
  29. player.useStairs(-1, GLIDERS[isReturning ? 0 : index], delay - 1, delay + 1);
  30. player.closeInterfaces();
  31. player.getTemporaryAttributtes().remove("using_carrier");
  32. player.getVarsManager().sendVar(153, 0);
  33. }
  34. });
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment