Exemplo n.º 1
0
        public static void enterCave(Player p)
        {
            AreaEvent enterCaveAreaEvent = new AreaEvent(p, 2438, 5168, 2439, 5168);
            enterCaveAreaEvent.setAction(() =>
            {
                /*
                 * Fight cave is 20k squares from the original place, then another (200 * playerIndex) squares west.
                 */
                Location instanceLocation = new Location((20000 + 2413) + (200 * p.getIndex()), 20000 + 5116, 0);
                p.teleport(instanceLocation);
                p.setFightCave(new FightCaveSession(p));

                Event caveNpcEvent = new Event(600);
                caveNpcEvent.setAction(() =>
                {
                    caveNpcEvent.stop();
                    p.getPackets().sendNPCHead(2617, 242, 1);
                    p.getPackets().modifyText("TzHaar-Mej-Jal", 242, 3);
                    p.getPackets().modifyText("You're on your own now, JalYt.", 242, 4);
                    p.getPackets().modifyText("Pepare to fight for your life!", 242, 5);
                    p.getPackets().animateInterface(9827, 242, 1);
                    p.getPackets().sendChatboxInterface2(242);
                });
                Server.registerEvent(caveNpcEvent);
            });
            Server.registerCoordinateEvent(enterCaveAreaEvent);
        }
Exemplo n.º 2
0
 public static void enterTzhaar(Player p)
 {
     AreaEvent enterTzhaarAreaEvent = new AreaEvent(p, 2866, 9570, 2866, 9572);
     enterTzhaarAreaEvent.setAction(() =>
     {
         p.teleport(new Location(2480, 5175, 0));
     });
     Server.registerCoordinateEvent(enterTzhaarAreaEvent);
 }
Exemplo n.º 3
0
 public static void exitTzhaar(Player p)
 {
     AreaEvent exitTzhaarAreaEvent = new AreaEvent(p, 2479, 5175, 2481, 5175);
     exitTzhaarAreaEvent.setAction(() =>
     {
         p.teleport(new Location(2866, 9571, 0));
     });
     Server.registerCoordinateEvent(exitTzhaarAreaEvent);
 }
Exemplo n.º 4
0
        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length < 2)
            {
                player.getPackets().sendMessage("[Teleport command]: ::tele x y or even ::tele x y z");
                return;
            }
            int x, y, z = 0;
            if (!int.TryParse(arguments[0], out x) || !int.TryParse(arguments[1], out y))
            {
                player.getPackets().sendMessage("Bad x,y coordinate, teleporting home, You entered:[x=" + arguments[0] + ", y=" + arguments[1] + "]");
                player.teleport(Constants.HOME_SPAWN_LOCATION);
                return;
            }
            if (arguments.Length >= 3)
                int.TryParse(arguments[2], out z);

            player.teleport(new Location(x, y, z));
        }
Exemplo n.º 5
0
        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
                return;
            }

            int heightLevel = 0;
            if (!int.TryParse(arguments[0], out heightLevel))
            {
                player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
                return;
            }

            player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY(), heightLevel));
        }
Exemplo n.º 6
0
 /*
  * The config to remove roofs is 1270
  * The door is 6713
  *
  * Random door configs
  * CONFIG = 452    0
    CONFIG = 452    32
    CONFIG = 452    96
    CONFIG = 452    16480
    CONFIG = 452    278624
    CONFIG = 452    802912
    CONFIG = 452    2900064
    CONFIG = 452    2637920
    CONFIG = 452    2638944
    CONFIG = 452    2640992
    CONFIG = 452    2645088
    CONFIG = 452    2653280
    CONFIG = 452    2649184
  */
 public static bool enterCrypt(Player p)
 {
     for (int i = 0; i < MOUND_COORDS.Length; i++)
     {
         for (int j = 0; j < MOUND_COORDS[i].Length; j++)
         {
             if (p.getLocation().inArea(MOUND_COORDS[i][0], MOUND_COORDS[i][1], MOUND_COORDS[i][2], MOUND_COORDS[i][3]) && p.getLocation().getZ() == 0)
             {
                 p.teleport(new Location(STAIR_COORDS[i][0], STAIR_COORDS[i][1], 3));
                 if (p.getBarrowTunnel() == -1)
                 {
                     p.setBarrowTunnel(Misc.random(5));
                 }
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 7
0
 public static void crossDitch(Player p, int x, int y)
 {
     if (p.getTemporaryAttribute("unmovable") != null)
     {
         return;
     }
     AreaEvent crossDitchAreaEvent = new AreaEvent(p, x, y - 1, x, y + 2);
     crossDitchAreaEvent.setAction(() =>
     {
         p.getPackets().closeInterfaces();
         p.getWalkingQueue().resetWalkingQueue();
         p.setTemporaryAttribute("unmovable", true);
         int newY = p.getLocation().getY() >= 3523 ? p.getLocation().getY() - 3 : p.getLocation().getY() + 3;
         int dir = newY == 3 ? 0 : 4;
         Location faceLocation = new Location(p.getLocation().getX(), dir == 3 ? 3523 : 3520, 0);
         p.setFaceLocation(faceLocation);
         Event crossDitchMoveEvent = new Event(500);
         crossDitchMoveEvent.setAction(() =>
         {
             crossDitchMoveEvent.stop();
             p.setLastAnimation(new Animation(6132));
             int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
             int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
             int lX = (p.getLocation().getX() - ((regionX - 6) * 8));
             int lY = (p.getLocation().getY() - ((regionY - 6) * 8));
             ForceMovement movement = new ForceMovement(lX, lY, lX, newY, 33, 60, dir);
             p.setForceMovement(movement);
             p.setFaceLocation(new Location(x, y, 0));
             Event crossDitchTeleportEvent = new Event(1250);
             crossDitchTeleportEvent.setAction(() =>
             {
                 crossDitchTeleportEvent.stop();
                 int playerY = p.getLocation().getY();
                 int nY = playerY >= 3523 ? 3520 : 3523;
                 p.teleport(new Location(p.getLocation().getX(), nY, 0));
                 p.removeTemporaryAttribute("unmovable");
             });
             Server.registerEvent(crossDitchTeleportEvent);
         });
         Server.registerEvent(crossDitchMoveEvent);
     });
     Server.registerCoordinateEvent(crossDitchAreaEvent);
 }
Exemplo n.º 8
0
        public static void leverTeleport(Player p, int option)
        {
            p.getPackets().closeInterfaces();
            Location teleLocation = new Location(LEVER_COORDINATES[option][0], LEVER_COORDINATES[option][1], LEVER_COORDINATES[option][2]);

            Event leverTeleportEvent = new Event(200);
            leverTeleportEvent.setAction(() =>
            {
                leverTeleportEvent.stop();
                if (p.getTemporaryAttribute("teleblocked") != null)
                {
                    p.getPackets().sendMessage("A magical force prevents you from teleporting!");
                    return;
                }
                else if ((p.getTemporaryAttribute("teleporting") != null))
                {
                    return;
                }
                p.setLastAnimation(new Animation(2140));
                p.getPackets().closeInterfaces();
                p.setTemporaryAttribute("teleporting", true);
                p.getWalkingQueue().resetWalkingQueue();
                p.getPackets().clearMapFlag();
                SkillHandler.resetAllSkills(p);
                Event levelTeleportStartEvent = new Event(700);
                levelTeleportStartEvent.setAction(() =>
                {
                    levelTeleportStartEvent.stop();
                    p.setLastAnimation(new Animation(8939, 0));
                    p.setLastGraphics(new Graphics(1576, 0));
                    Event levelTeleportFinishEvent = new Event(1800);
                    levelTeleportFinishEvent.setAction(() =>
                    {
                        levelTeleportFinishEvent.stop();
                        p.teleport(teleLocation);
                        p.setLastAnimation(new Animation(8941, 0));
                        p.setLastGraphics(new Graphics(1577, 0));
                        Teleport.resetTeleport(p);
                    });
                    Server.registerEvent(levelTeleportFinishEvent);
                });
                Server.registerEvent(levelTeleportStartEvent);
            });
            Server.registerEvent(leverTeleportEvent);
        }
Exemplo n.º 9
0
 public void execute(Player player, string[] arguments)
 {
     player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY() - 6400, 0));
 }
Exemplo n.º 10
0
 public static bool teleport(Player p, int opt, JewellerySlot js)
 {
     if (js == null)
     {
         return false;
     }
     if (js.index == -1 || js.index > 3 || opt > 6)
     {
         return false;
     }
     if (!canTeleport(p, js))
     {
         p.getPackets().closeInterfaces();
         return true;
     }
     if ((js.index == 2 && opt == 4) || (js.index != 2 && opt == 6))
     {
         p.getPackets().sendMessage("You stay where you are.");
         p.getPackets().closeInterfaces();
         return true;
     }
     opt -= 2; // Used to get the 'index' from the button id.
     p.setLastGraphics(new Graphics(1684));
     p.setLastAnimation(new Animation(9603));
     p.getWalkingQueue().resetWalkingQueue();
     p.getPackets().clearMapFlag();
     p.setTemporaryAttribute("teleporting", true);
     p.setTemporaryAttribute("unmovable", true);
     p.removeTemporaryAttribute("autoCasting");
     p.removeTemporaryAttribute("lootedBarrowChest");
     p.setTarget(null);
     changeJewellery(p, js);
     int option = opt;
     p.getPackets().closeInterfaces();
     Event teleportEvent = new Event(2000);
     teleportEvent.setAction(() =>
     {
         teleportEvent.stop();
         p.teleport(new Location(TELEPORT_COORDINATES[js.index][option][0], TELEPORT_COORDINATES[js.index][option][1], 0));
         p.setLastAnimation(new Animation(65535));
         Teleport.resetTeleport(p);
         p.removeTemporaryAttribute("unmovable");
     });
     Server.registerEvent(teleportEvent);
     return true;
 }
Exemplo n.º 11
0
 public static void teleportDuelArenaHome(Player player)
 {
     player.teleport(new Location(3360 + Misc.random(19), 3274 + Misc.random(3), 0));
 }
Exemplo n.º 12
0
 public static void useLever(Player p, int id, Location leverLocation)
 {
     if (p.getTemporaryAttribute("teleporting") != null)
     {
         return;
     }
     foreach (LoadedLaddersAndStairs.Lever lever in LoadedLaddersAndStairs.levers)
     {
         if (lever.getId() == id)
         {
             if (lever.getLeverLocation().Equals(leverLocation))
             {
                 LoadedLaddersAndStairs.Lever l = lever;
                 //TODO when in use it cant be used (in use = lever is facing down)
                 CoordinateEvent useLeverCoordinateEvent = new CoordinateEvent(p, l.getLeverLocation());
                 useLeverCoordinateEvent.setAction(() =>
                 {
                     p.setFaceLocation(l.getFaceLocation());
                     if (p.getTemporaryAttribute("teleblocked") != null)
                     {
                         p.getPackets().sendMessage("A magical force prevents you from teleporting!");
                         return;
                     }
                     else if ((p.getTemporaryAttribute("teleporting") != null))
                     {
                         return;
                     }
                     p.setLastAnimation(new Animation(2140));
                     p.getPackets().closeInterfaces();
                     p.setTemporaryAttribute("teleporting", true);
                     p.getWalkingQueue().resetWalkingQueue();
                     p.getPackets().clearMapFlag();
                     SkillHandler.resetAllSkills(p);
                     l.setInUse(true);
                     Event useLeverEvent = new Event(700);
                     useLeverEvent.setAction(() =>
                     {
                         useLeverEvent.stop();
                         p.setLastAnimation(new Animation(8939, 0));
                         p.setLastGraphics(new Graphics(1576, 0));
                         l.setInUse(false);
                         Event setLeverTeleportEvent = new Event(1800);
                         setLeverTeleportEvent.setAction(() =>
                         {
                             setLeverTeleportEvent.stop();
                             p.teleport(l.getTeleLocation());
                             p.setLastAnimation(new Animation(8941, 0));
                             p.setLastGraphics(new Graphics(1577, 0));
                             Teleport.resetTeleport(p);
                         });
                         Server.registerEvent(setLeverTeleportEvent);
                     });
                     Server.registerEvent(useLeverEvent);
                 });
                 Server.registerCoordinateEvent(useLeverCoordinateEvent);
                 break;
             }
         }
     }
 }
Exemplo n.º 13
0
 public static void exitArena(Player p, int objectX, int objectY)
 {
     CoordinateEvent exitArenaCoordinateEvent = new CoordinateEvent(p, new Location(2805, 9589, 3));
     exitArenaCoordinateEvent.setAction(() =>
     {
         p.setLastAnimation(new Animation(828));
         Event exitArenaEvent = new Event(1000);
         exitArenaEvent.setAction(() =>
         {
             p.teleport(new Location(2809, 3193, 0));
             exitArenaEvent.stop();
         });
         Server.registerEvent(exitArenaEvent);
     });
     Server.registerCoordinateEvent(exitArenaCoordinateEvent);
 }
Exemplo n.º 14
0
        public static void showAliDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null)
            {
                return;
            }
            switch (status)
            {
                case 205:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Would you like to go back to Lletya?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 206;
                    break;

                case 206:
                    p.getPackets().sendChatboxInterface2(228);
                    p.getPackets().modifyText("Yes please, let's go", 228, 2);
                    p.getPackets().modifyText("Not yet", 228, 3);
                    newStatus = 207;
                    break;

                case 207:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Yes please, let's go.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 208;
                    break;

                case 208:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Very well.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 209;
                    break;

                case 209:
                    p.setTemporaryAttribute("unmovable", true);
                    p.getPackets().displayInterface(120);
                    p.getPackets().sendMessage("Your camel trots off slowly out of the desert..");
                    Event moveBackToLletyaEvent = new Event(2000);
                    int moveBackToLletyaCounter = 0;
                    moveBackToLletyaEvent.setAction(() =>
                    {
                        if (moveBackToLletyaCounter == 0)
                        {
                            moveBackToLletyaCounter++;
                            moveBackToLletyaEvent.setTick(600);
                            p.teleport(new Location(2340, 3799, 0));
                        }
                        else
                        {
                            moveBackToLletyaEvent.stop();
                            p.removeTemporaryAttribute("unmovable");
                            p.getPackets().sendMessage("..You and Ali are back in Lletya.");
                            p.getPackets().closeInterfaces();
                        }
                    });
                    Server.registerEvent(moveBackToLletyaEvent);
                    break;

                case 210:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Not yet.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 211;
                    break;

                case 211:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("No problem, I will be here when you decide to leave.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    break;
            }
            if (newStatus != -1)
            {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
Exemplo n.º 15
0
 private static void travel(Player p, int index, bool returning)
 {
     p.setTemporaryAttribute("unmovable", true);
     p.getPackets().displayInterface(120);
     if (returning)
     {
         p.getPackets().sendMessage("You sail off back to Oo'glog..");
     }
     else
     {
         p.getPackets().sendMessage("You climb aboard Captain Bentley's boat and set sail to " + DESTINATION_NAMES[index] + ".");
     }
     Event travelEvent = new Event(2000);
     int travelCounter = 0;
     travelEvent.setAction(() =>
     {
         if (travelCounter == 0)
         {
             travelCounter++;
             travelEvent.setTick(600);
             if (returning)
             {
                 p.teleport(new Location(2622, 2857, 0));
             }
             else
             {
                 p.teleport(new Location(LOCATIONS[index][0], LOCATIONS[index][1], LOCATIONS[index][2]));
             }
         }
         else
         {
             travelEvent.stop();
             p.getPackets().sendOverlay(170);
             p.removeTemporaryAttribute("unmovable");
             p.getPackets().sendMessage(returning ? "The boat arrives back in Oo'glog." : DESTINATION_MESSAGES[index]);
             p.getPackets().closeInterfaces();
             Event removeOverlayEvent = new Event(2000);
             removeOverlayEvent.setAction(() =>
             {
                 removeOverlayEvent.stop();
                 p.getPackets().sendRemoveOverlay();
                 if (index == 1)
                 {
                     p.removeTemporaryAttribute("snowInterface");
                 }
             });
             Server.registerEvent(removeOverlayEvent);
         }
     });
     Server.registerEvent(travelEvent);
 }
Exemplo n.º 16
0
 public void useOrb(Player p, int button)
 {
     if (p.getTemporaryAttribute("teleporting") != null)
     {
         return;
     }
     if (button == -1)
     {
         AreaEvent useOrbAreaEvent = new AreaEvent(p, 2398, 5171, 2400, 5173);
         useOrbAreaEvent.setAction(() =>
         {
             p.getPackets().displayInventoryInterface(374);
             p.getAppearance().setInvisible(true);
             p.getUpdateFlags().setAppearanceUpdateRequired(true);
             p.setTemporaryAttribute("cantDoAnything", true);
             p.setTemporaryAttribute("unmovable", true);
             p.getPackets().setMinimapStatus(2);
             Event useOrbEvent = new Event(500);
             useOrbEvent.setAction(() =>
             {
                 useOrbEvent.stop();
                 int random = Misc.random(4);
                 p.teleport(new Location(ORB_COORDINATES[1][random], ORB_COORDINATES[2][random], 0));
             });
             Server.registerEvent(useOrbEvent);
         });
         Server.registerCoordinateEvent(useOrbAreaEvent);
     }
     else
     {
         if (p.getTemporaryAttribute("cantDoAnything") != null)
         {
             if (button == 5)
             {
                 Event useOrbTwoEvent = new Event(500);
                 useOrbTwoEvent.setAction(() =>
                 {
                     useOrbTwoEvent.stop();
                     p.getAppearance().setInvisible(false);
                     p.getUpdateFlags().setAppearanceUpdateRequired(true);
                     p.removeTemporaryAttribute("cantDoAnything");
                     p.removeTemporaryAttribute("unmovable");
                     teleportToWaitingRoom(p, false);
                     p.getPackets().closeInterfaces();
                     p.getPackets().setMinimapStatus(0);
                     p.getPackets().clearMapFlag();
                 });
                 Server.registerEvent(useOrbTwoEvent);
                 return;
             }
             for (int i = 0; i < ORB_COORDINATES[0].Length; i++)
             {
                 if (button == ORB_COORDINATES[0][i])
                 {
                     int j = i;
                     p.setTemporaryAttribute("teleporting", true);
                     Event teleportToOrbEvent = new Event(500);
                     teleportToOrbEvent.setAction(() =>
                     {
                         teleportToOrbEvent.stop();
                         p.teleport(new Location(ORB_COORDINATES[1][j], ORB_COORDINATES[2][j], 0));
                         Teleport.resetTeleport(p);
                     });
                     Server.registerEvent(teleportToOrbEvent);
                     return;
                 }
             }
         }
     }
 }
Exemplo n.º 17
0
        public static void doObstacle(Player p, int index)
        {
            if (p.getTemporaryAttribute("unmovable") != null)
            {
                return;
            }
            switch (index)
            {
                case 0: // 3 planks, northern (east side)
                case 1: // 3 planks, middle (east side)
                case 2: // 3 planks, southern (east side)
                case 3: // 3 planks, northern (west side)
                case 4: // 3 planks, middle (west side)
                case 5: // 3 planks, southern (west side)
                    int logXCoord = index <= 2 ? (int)AGILITY_ARENA_OBJECTS[index][1] + 1 : (int)AGILITY_ARENA_OBJECTS[index][1] - 1;
                    int logDirectionX = index <= 2 ? -7 : +7;
                    CoordinateEvent plankObstaclesCoordinateEvent = new CoordinateEvent(p, new Location(logXCoord, (int)AGILITY_ARENA_OBJECTS[index][2], 3));
                    plankObstaclesCoordinateEvent.setAction(() =>
                    {
                        bool running = p.getWalkingQueue().isRunToggled();
                        p.getWalkingQueue().setRunToggled(false);
                        p.getWalkingQueue().resetWalkingQueue();
                        p.getPackets().clearMapFlag();
                        p.setTemporaryAttribute("unmovable", true);
                        p.getAppearance().setWalkAnimation(155);
                        p.getUpdateFlags().setAppearanceUpdateRequired(true);
                        p.getWalkingQueue().forceWalk(logDirectionX, 0);
                        Event plankObstaclesEvent = new Event(4300);
                        plankObstaclesEvent.setAction(() =>
                        {
                            plankObstaclesEvent.stop();
                            p.removeTemporaryAttribute("unmovable");
                            p.getAppearance().setWalkAnimation(-1);
                            p.getUpdateFlags().setAppearanceUpdateRequired(true);
                            p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
                            p.getWalkingQueue().setRunToggled(running);
                        });
                        Server.registerEvent(plankObstaclesEvent);
                    });
                    Server.registerCoordinateEvent(plankObstaclesCoordinateEvent);
                    break;

                case 6: //Handholds obstacle east of planks.
                case 7: //Handholds obstacle west of planks.
                    int handHoldsDirectionX = 1;
                    int handHoldsDirectionY = 1;
                    if (index == 6)
                    {
                        handHoldsDirectionX = -1;
                        handHoldsDirectionY = +1;
                    }
                    else if (index == 7)
                    {
                        handHoldsDirectionX = +1;
                        handHoldsDirectionY = -1;
                    }
                    CoordinateEvent handholdsObstacleCoordinateEvent = new CoordinateEvent(p, new Location((int)AGILITY_ARENA_OBJECTS[index][1], (int)AGILITY_ARENA_OBJECTS[index][2], 3));
                    handholdsObstacleCoordinateEvent.setAction(() =>
                    {
                        bool running = p.getWalkingQueue().isRunToggled();
                        p.getWalkingQueue().setRunToggled(false);
                        p.getWalkingQueue().resetWalkingQueue();
                        p.getPackets().clearMapFlag();
                        p.setTemporaryAttribute("unmovable", true);
                        p.setLastAnimation(new Animation(1121));
                        p.setFaceLocation(new Location(p.getLocation().getX(), p.getLocation().getY() + handHoldsDirectionY, 3));
                        Event handholdsObstaclesEvent = new Event(700);
                        int handholdsObstaclesCounter = 0;
                        handholdsObstaclesEvent.setAction(() =>
                        {
                            p.setLastAnimation(new Animation(1122));
                            int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
                            int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
                            int lX = (p.getLocation().getX() - ((regionX - 6) * 8));
                            int lY = (p.getLocation().getY() - ((regionY - 6) * 8));
                            p.setForceMovement(new ForceMovement(lX, lY, lX + handHoldsDirectionX, lY, 0, 5, 0));
                            if (handholdsObstaclesCounter++ >= 7)
                            {
                                p.setLastAnimation(new Animation(65535));
                                handholdsObstaclesEvent.stop();
                                p.removeTemporaryAttribute("unmovable");
                                p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
                                p.getWalkingQueue().setRunToggled(running);
                                return;
                            }
                            Event teleportEvent = new Event(500);
                            teleportEvent.setAction(() =>
                            {
                                teleportEvent.stop();
                                p.teleport(new Location(p.getLocation().getX() + handHoldsDirectionX, p.getLocation().getY(), 3));
                            });
                            Server.registerEvent(teleportEvent);
                        });
                        Server.registerEvent(handholdsObstaclesEvent);
                    });
                    Server.registerCoordinateEvent(handholdsObstacleCoordinateEvent);
                    break;
            }
        }
Exemplo n.º 18
0
 public static void verifyEnterTunnel(Player p)
 {
     p.getPackets().closeInterfaces();
     if (p.getTemporaryAttribute("barrowTunnel") != null)
     {
         if ((int)p.getTemporaryAttribute("barrowTunnel") == 2)
         {
             p.teleport(new Location(3568, 9712, 0));
             p.removeTemporaryAttribute("barrowTunnel");
             return;
         }
     }
     p.getPackets().sendChatboxInterface(228);
     p.getPackets().modifyText("Yeah, I'm fearless!", 228, 2);
     p.getPackets().modifyText("No way, that looks scary!", 228, 3);
     p.setTemporaryAttribute("barrowTunnel", 2);
 }
Exemplo n.º 19
0
 public void teleportToWaitingRoom(Player p, bool removeFromList)
 {
     int x = 2395 + Misc.random(8);
     int y = 5170 + Misc.random(3);
     if (x == 2399 && y == 5172)
     { // On viewing orb
         x++; // Move to the side of it
     }
     p.teleport(new Location(x, y, 0));
     resetVariables(p);
     if (removeFromList)
     {
         playersPlaying.Remove(p);
         if (playersPlaying.Count >= 1)
         {
             foreach (Player player in playersPlaying)
             {
                 displayFightPitsInterface(player);
             }
         }
     }
 }
Exemplo n.º 20
0
 public static void teleport(Player p, LoadedLaddersAndStairs.HeightObject obj)
 {
     p.getWalkingQueue().resetWalkingQueue();
     p.setTemporaryAttribute("unmovable", true);
     p.setFaceLocation(obj.getLocation());
     if (obj.getAnimation() != -1)
     {
         p.setLastAnimation(new Animation(obj.getAnimation()));
     }
     Event teleportEvent = new Event(obj.getAnimation() != -1 ? obj.getTeleDelay() : 500);
     teleportEvent.setAction(() =>
     {
         teleportEvent.stop();
         p.teleport(obj.getTeleLocation());
         p.removeTemporaryAttribute("unmovable");
     });
     Server.registerEvent(teleportEvent);
 }
Exemplo n.º 21
0
        public static void showAliDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null)
            {
                return;
            }
            switch (status)
            {
                case 156:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Hello?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 157;
                    break;

                case 157:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Well, hello there " + p.getLoginDetails().getUsername() + ", can i help you?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 158;
                    break;

                case 158:
                    p.getPackets().sendChatboxInterface2(230);
                    p.getPackets().modifyText("Can you take me to Al-Kharid please?", 230, 2);
                    p.getPackets().modifyText("You don't look like you're from around here..", 230, 3);
                    p.getPackets().modifyText("Nothing, sorry to bother you", 230, 4);
                    newStatus = 159;
                    break;

                case 159:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Can you take me to Al-Kharid please?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 160;
                    break;

                case 160:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Certainly, let's go..", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 161;
                    break;

                case 161:
                    p.setTemporaryAttribute("unmovable", true);
                    p.getPackets().displayInterface(120);
                    p.getPackets().sendMessage("You follow Ali across vast lands..");
                    Event moveToAlKharidEvent = new Event(2000);
                    int moveToAlKharidCounter = 0;
                    moveToAlKharidEvent.setAction(() =>
                    {
                        if (moveToAlKharidCounter == 0)
                        {
                            moveToAlKharidCounter++;
                            moveToAlKharidEvent.setTick(600);
                            p.teleport(new Location(3311 + Misc.random(2), 3199 + Misc.random(3), 0));
                        }
                        else
                        {
                            moveToAlKharidEvent.stop();
                            p.getPackets().sendOverlay(170);
                            p.removeTemporaryAttribute("unmovable");
                            p.getPackets().sendMessage("..Eventually, you find yourself in Al-Kharid.");
                            p.getPackets().closeInterfaces();
                            Event removeOverlayEvent = new Event(2000);
                            removeOverlayEvent.setAction(() =>
                            {
                                removeOverlayEvent.stop();
                                p.getPackets().sendRemoveOverlay();
                            });
                            Server.registerEvent(removeOverlayEvent);
                        }
                    });
                    Server.registerEvent(moveToAlKharidEvent);
                    break;

                case 162:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("You don't look like you're from around here..", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 163;
                    break;

                case 163:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("That's because i'm not!", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 164;
                    break;

                case 164:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("I thought as much, Where are you from?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 165;
                    break;

                case 165:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("I usually reside in a small desert town, called Al-Kharid.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 166;
                    break;

                case 166:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("What does Al-Kharid have to offer?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 167;
                    break;

                case 167:
                    p.getPackets().sendNPCHead(1862, 244, 2);
                    p.getPackets().modifyText("Ali Morissane", 244, 3);
                    p.getPackets().modifyText("Sand! lots, and lots of sand! On a more serious note..", 244, 4);
                    p.getPackets().modifyText("A mine full of ore rich rocks, a duel arena where", 244, 5);
                    p.getPackets().modifyText("I hear fortunes are gained and lost. Also, a small market,", 244, 6);
                    p.getPackets().modifyText("which has been attracting crafty thieves as of late!", 244, 7);
                    p.getPackets().animateInterface(9827, 244, 2);
                    p.getPackets().sendChatboxInterface2(244);
                    newStatus = 168;
                    break;

                case 168:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("I may have to pay Al-Kharid a visit...", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 169;
                    break;

                case 169:
                    p.getPackets().sendNPCHead(1862, 242, 2);
                    p.getPackets().modifyText("Ali Morissane", 242, 3);
                    p.getPackets().modifyText("There is one problem. We have also been having", 242, 4);
                    p.getPackets().modifyText("trouble with some of the locals recently.", 242, 5);
                    p.getPackets().animateInterface(9827, 242, 2);
                    p.getPackets().sendChatboxInterface2(242);
                    newStatus = 170;
                    break;

                case 170:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Trouble with the locals?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 171;
                    break;

                case 171:
                    p.getPackets().sendNPCHead(1862, 243, 2);
                    p.getPackets().modifyText("Ali Morissane", 243, 3);
                    p.getPackets().modifyText("Yes. Although I really shouldn't say anything but", 243, 4);
                    p.getPackets().modifyText("perhaps you can help. Bandits have overtaken some of", 243, 5);
                    p.getPackets().modifyText("the empty tents in Al-Kharid, and are quite aggressive...", 243, 6);
                    p.getPackets().animateInterface(9827, 243, 2);
                    p.getPackets().sendChatboxInterface2(243);
                    newStatus = 172;
                    break;

                case 172:
                    p.getPackets().sendNPCHead(1862, 244, 2);
                    p.getPackets().modifyText("Ali Morissane", 244, 3);
                    p.getPackets().modifyText("..And that's not all! Deep under the town lies a beast,", 244, 4);
                    p.getPackets().modifyText("I hear it's a mixture of a bug and a fly...I expect it", 244, 5);
                    p.getPackets().modifyText("would take a fine warrior to defeat it and no doubt", 244, 6);
                    p.getPackets().modifyText("he would be generously rewarded.", 244, 7);
                    p.getPackets().animateInterface(9827, 244, 2);
                    p.getPackets().sendChatboxInterface2(244);
                    newStatus = 173;
                    break;

                case 173:
                    p.getPackets().sendPlayerHead(65, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 65, 3);
                    p.getPackets().modifyText("Do you have a map, or directions", 65, 4);
                    p.getPackets().modifyText("to Al-Kharid?", 65, 5);
                    p.getPackets().animateInterface(9827, 65, 2);
                    p.getPackets().sendChatboxInterface2(65);
                    newStatus = 174;
                    break;

                case 174:
                    p.getPackets().sendNPCHead(1862, 243, 2);
                    p.getPackets().modifyText("Ali Morissane", 243, 3);
                    p.getPackets().modifyText("I don't i'm afraid, although I travel back reguarly and", 243, 4);
                    p.getPackets().modifyText("happen to have room for a passenger. So if you'd", 243, 5);
                    p.getPackets().modifyText("ever like to go to Al-Kharid, don't hesitate to ask me.", 243, 6);
                    p.getPackets().animateInterface(9827, 243, 2);
                    p.getPackets().sendChatboxInterface2(243);
                    newStatus = 175;
                    break;

                case 175:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Thankyou for the offer, I may take you up on it soon.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 176;
                    break;

                case 176:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("I'll see you then!", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    break;

                case 177:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Nothing, sorry to bother you!", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    break;
            }
            if (newStatus != -1)
            {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
Exemplo n.º 22
0
 public static void enterArena(Player p, int objectX, int objectY)
 {
     CoordinateEvent enterArenaCoordinateEvent = new CoordinateEvent(p, new Location(2809, 3193, 0));
     enterArenaCoordinateEvent.setAction(() =>
     {
         if (!p.hasPaidAgilityArena())
         {
             p.getPackets().sendMessage("You must pay Cap'n Izzy the entrance fee before you can enter the Agility Arena.");
             return;
         }
         p.setLastAnimation(new Animation(827));
         Event teleportArenaEvent = new Event(1000);
         teleportArenaEvent.setAction(() =>
         {
             p.setPaidAgilityArena(false);
             p.teleport(new Location(2805, 9589, 3));
             teleportArenaEvent.stop();
         });
         Server.registerEvent(teleportArenaEvent);
     });
     Server.registerCoordinateEvent(enterArenaCoordinateEvent);
 }