Thread: [OSRS] Fossil Island Rowboats

Results 1 to 1 of 1
  1. #1 [OSRS] Fossil Island Rowboats 
    Anguish Founder
    Rowley's Avatar
    Join Date
    Sep 2016
    Posts
    78
    Thanks given
    12
    Thanks received
    18
    Rep Power
    27
    There's probably a way better and fancier way to do this, but was quick and hopefully some people find it useful.

    Currently has 3 locations, add others if you wish.



    in io.ruin.model.map.object.actions.impl create a package named fossilisland, inside the package, Rowboat.Java:

    Code:
    package io.ruin.model.map.object.actions.impl.fossilisland;
    import io.ruin.model.map.object.actions.ObjectAction;
    import io.ruin.model.entity.player.Player;
    import io.ruin.model.inter.dialogue.OptionsDialogue;
    import io.ruin.model.inter.utils.Option;
    import io.ruin.model.map.object.GameObject;
    
    /**
     * @author Rowley - https://www.rune-server.ee/members/322493-rowley/
     */
    public class Rowboat {
        enum Boat {
            BOAT1 ("Island",3768, 3898, 0),
            BOAT2 ("Northern Shore", 3734, 3893, 0),
            BOAT3 ("Camp",3724, 3807, 0);
    
            private final String name;
            private final int x, y, z;
    
            Boat(String name, int x, int y, int z) {
                this.name = name;
                this.x = x;
                this.y = y;
                this.z = z;
            }
        }
    
        static {
            ObjectAction.register(30915, "travel", Rowboat::fromNorthernShore);
            ObjectAction.register(30914, "travel", Rowboat::fromCamp);
            ObjectAction.register(30919, "travel", Rowboat::fromIsland);
        }
    
        private static void fromCamp(Player player, GameObject boat) {
            handleDialogue(player, Boat.BOAT1, Boat.BOAT2);
        }
    
        private static void fromIsland(Player player, GameObject boat) {
            handleDialogue(player, Boat.BOAT3, Boat.BOAT2);
        }
    
        private static void fromNorthernShore(Player player, GameObject boat) {
            handleDialogue(player, Boat.BOAT3, Boat.BOAT1);
        }
    
        private static void handleDialogue(Player player, Boat... options) {
            Option[] dialogueOptions = new Option[options.length + 1];
            for (int i = 0; i < options.length; i++) {
                Boat option = options[i];
                dialogueOptions[i] = new Option(option.name, () -> teleport(player, option));
            }
            dialogueOptions[options.length] = new Option("Nowhere");
            player.dialogue(new OptionsDialogue("Where would you like to travel?", dialogueOptions));
        }
    
        private static void teleport(Player player, Boat destination) {
            player.startEvent(e -> {
                player.lock();
                player.getPacketSender().fadeOut();
                e.delay(2);
                player.getMovement().teleport(destination.x, destination.y, destination.z);
                e.delay(2);
                player.getPacketSender().fadeIn();
                player.unlock();
            });
        }
    }
    Specifically written on Kronos, cheers!
    Attached image

    Attached image
    Reply With Quote  
     

  2. Thankful user:

    Community VeteranSub


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Fossil island wyvern spawns
    By Mantvis in forum Requests
    Replies: 3
    Last Post: 02-07-2018, 04:35 PM
  2. Full #154 (Fossil Island) Data, MOST MAPS
    By Corey in forum Configuration
    Replies: 64
    Last Post: 10-27-2017, 01:15 PM
  3. Replies: 1
    Last Post: 09-30-2017, 01:44 PM
  4. Fossil Island XTEAs
    By Omar in forum Configuration
    Replies: 6
    Last Post: 09-10-2017, 08:50 PM
  5. OSRS easter Island and fally tournament map
    By Lmctruck30 in forum Requests
    Replies: 0
    Last Post: 08-03-2017, 06:37 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •