Advertisement
Guest User

BossTeleportDialogue

a guest
Mar 28th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.13 KB | None | 0 0
  1. package server.game.content.dialogue.teleport;
  2.  
  3. import server.game.content.dialogue.Dialogue;
  4. import server.game.content.dialogue.Type;
  5. import server.game.content.teleport.TeleportExecutor;
  6. import server.game.world.Position;
  7.  
  8. public class BossTeleportDialogue extends Dialogue
  9. {
  10.    
  11.     /**
  12.     * An array for all the dialogue strings.
  13.     */
  14.     private static final String OPTION_1 =
  15.     {
  16.         "Barrelchest",
  17.         "Godwars Dungeon",
  18.         "Kalphite Queen",
  19.         "King Black Dragon [@red@Wildy@bla@]",
  20.         "[More]"
  21.     };
  22.    
  23.     private static final String OPTION_2 =
  24.     {
  25.         "Chaos Elemental [@red@Wildy@bla@]",
  26.         "Dagannoth Kings",
  27.         "Giant Mole",
  28.         "Kraken",
  29.         "[Back]"
  30.     };
  31.    
  32.     /**
  33.     * An array for all corresponding dialogue strings which holds all the teleport locations.
  34.     */
  35.     private static final int[][] OPTION_1_TELEPORT =
  36.     {
  37.         { 2983, 9516, 1 }, //Barrelchest
  38.         { 2871, 5317, 2 }, //Godwars Dungeon
  39.         { 3480, 9484, 0 }, //Kalphite Queen
  40.         { 3007, 3849, 0 }, //King Black Dragon
  41.         { 0, 0, 0 } //More
  42.     };
  43.    
  44.     private static final int[][] OPTION_2_TELEPORT =
  45.     {
  46.         { 3295, 3921, 0 }, //Chaos Elemental
  47.         { 1891, 4409, 0 }, //Dagannoth King
  48.         { 1771, 5167, 0 }, //Giant Mole
  49.         { 2340, 3686, 0 }, //Kraken
  50.         { 0, 0, 0 } //More
  51.     };
  52.    
  53.     @Override
  54.     protected void start(Object... parameters)
  55.     {
  56.         send(Type.CHOICE, DEFAULT_OPTION_TITLE, OPTIONS_1[0], OPTIONS_1[1], OPTIONS_1[2], OPTIONS_1[3], OPTIONS_1[4]);
  57.     }
  58.    
  59.     @Override
  60.     public void select(int index)
  61.     {
  62.         System.out.println("Phase: " + phase + ", Index: " + index);
  63.         if (phase == 0)
  64.         {
  65.             if (index == 5)
  66.             {
  67.                 phase = 1;
  68.                 send(Type.CHOICE, DEFAULT_OPTION_TITLE, OPTIONS_2[0], OPTIONS_2[1], OPTIONS_2[2], OPTIONS_2[3], OPTIONS_2[4]);
  69.             } else {
  70.                 TeleportExecutor.teleport(player, new Position(OPTIONS_1[0], OPTION_1[1], OPTION_1[2], OPTION_1[3]));
  71.             }
  72.         } else if (phase == 1)
  73.         {
  74.             if (index == 5)
  75.             {
  76.                 phase = 0;
  77.                 send(Type.CHOICE, DEFAULT_OPTION_TITLE, OPTIONS_1[0], OPTIONS_1[1], OPTIONS_1[2], OPTIONS_1[3], OPTIONS_1[4]);
  78.             } else {
  79.                 TeleportExecutor.teleport(player, new Position(OPTIONS_2[0], OPTIONS_2[1], OPTIONS_2[2], OPTIONS_2[3]));
  80.             }
  81.         }
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement