Thread: Pi Gnome Gliders

Results 1 to 7 of 7
  1. #1 Pi Gnome Gliders 
    Owner of Ghreborn new and old.


    Join Date
    Nov 2009
    Posts
    916
    Thanks given
    47
    Thanks received
    155
    Rep Power
    273
    This is what u are adding

    Attached image

    Code:
    package server.model.transport;
    
    import server.event.CycleEvent;
    import server.event.CycleEventContainer;
    import server.event.CycleEventHandler;
    import server.model.players.Client;
    import server.world.Location;
    
    public class GnomeGlider {
    
    	public static boolean flightButtons(Client player, int button) {
    		for (GliderRoute route : GliderRoute.values()) {
    			if (button == route.buttonId) {
    				handleFlight(player, route);
    				return true;
    			}
    		}
    		return false;
    	}
    	public static void handleFlight(final Client player, final GliderRoute route) {
    		player.getPA().showInterface(802);
    		int flight = getConfig(player.getX(), route);
    		if (flight < 1) {
    			player.sendMessage("You can't fly there from here.");
    			return;
    		}
    		if (flight == 20) {
    			player.sendMessage("You can't fly to the same place you are at.");
    			return;
    		}
    		if (flight == 25) {
    			player.sendMessage("You can't fly to that place yet.");
    			return;
    		}
    		player.getPA().sendConfig(133, flight);
    		CycleEventHandler.getInstance().addEvent(player, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer e) {
    				player.getPA().movePlayer(route.to);
    				e.stop();
    			}
    			@Override
    			public void stop() {
    			}
    		}, 3);
    		CycleEventHandler.getInstance().addEvent(player, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer e) {
    				player.getPlayerAssistant().closeAllWindows();
    				player.getPA().sendConfig(153, -1);
    				e.stop();
    			}
    			@Override
    			public void stop() {
    			}
    		}, 4);
    	}
        public enum GliderRoute {
            SINDARPOS(3058, new Location(2848, 3497), 0),
            TA_QUIR_PRIW(3057, new Location(2465, 3501, 3), 1),
            LEMANTO_ANDRA(3059, new Location(3321, 3427), 2),
            KAR_HEWO(3060, new Location(3278, 3212), 3),
            GANDIUS(3056, new Location(2894, 2729), 4),
            LEMANTOLLY_UNDRI(48054, new Location(2544, 2970), 5);
    
            int buttonId;
            Location to;
            int move;
            
            GliderRoute(int buttonId, Location to, int move) {
                this.buttonId = buttonId;
                this.to = to;
                this.move = move;
            }
        }
    
    	public static int[] configs = {2847, 2464, 3318, 3283, 2894, 2547};
    
    	private static int getConfig(int x, final GliderRoute route) {
    		int startPoint = 0, endPoint = route.move;
    		for (int c = 0; c < configs.length; c++) {
    			if (configs[c] == x) {
    				startPoint = c;
    				break;
    			}
    		}
    		if (startPoint == endPoint) {
    			return 20; // returns "cant fly to same place" error
    		}
    		switch (startPoint) {
    			case 0 : // Sin
    				if (endPoint == 1) {
    					return 2;
    				}
    				break;
    			case 1 : // Ta
    				if (endPoint == 0) {
    					return 1;
    				} else if (endPoint == 2) {
    					return 3;
    				} else if (endPoint == 3) {
    					return 4;
    				} else if (endPoint == 4) {
    					return 7;
    				} else if (endPoint == 5) {
    					return 25;// return 10;
    				}
    				break;
    			case 3 : // Kar
    				if (endPoint == 1) {
    					return 5;
    				}
    				break;
    			case 4 : // Gan
    				if (endPoint == 1) {
    					return 6;
    				}
    				break;
    			case 5 : // Lem und
    				if (endPoint == 1) {
    					return 11;
    				}
    				break;
    		}
    		return 0;
    	}
    }
    add this to PlayerAssistant
    Code:
    	public void sendConfig(int id, int state) {
    		if (state < 128) {
    			if(c.getOutStream() != null && c != null) {
    				c.getOutStream().createFrame(36);
    				c.getOutStream().writeWordBigEndian(id);
    				c.getOutStream().writeByte(state);
    				c.flushOutStream();
    			} else {
    				if(c.getOutStream() != null && c != null) {
    					c.getOutStream().createFrame(87);
    					c.getOutStream().writeWordBigEndian_dup(id);	
    					c.getOutStream().writeDWord_v1(state);
    					c.flushOutStream();
    			}
    		}
    		}
    	}
    and this
    Code:
    	public void movePlayer(Location location) {
    		movePlayer(location.x, location.y, location.z);
    		
    	}
    replace this in Location
    Code:
    	public int x;
    	public int y;
    	public int z;
    in ClickingButtons add this on top of processPacket before the switch
    Code:
    		if (GnomeGlider.flightButtons(c, actionButtonId)) {
    			return;
    		}
    add this to secondClickNpc in ActionHandler
    Code:
    	
    		case 3809:
    		case 3811:
    				c.getPA().showInterface(802);
    				break;
    Im back and working on reborn,
    Reply With Quote  
     

  2. #2  
    'Slutty McFur'

    Owain's Avatar
    Join Date
    Sep 2014
    Age
    26
    Posts
    2,894
    Thanks given
    2,360
    Thanks received
    2,200
    Rep Power
    5000
    Not bad, have seen it done better though with moving glider icon: https://www.rune-server.org/runescap...40-quests.html
    Reply With Quote  
     

  3. #3  
    強い者は生き残る
    Ashpire's Avatar
    Join Date
    Mar 2012
    Age
    27
    Posts
    2,721
    Thanks given
    914
    Thanks received
    1,897
    Rep Power
    2231
    Could be done a lot better but good job.
    Attached image
    Reply With Quote  
     

  4. #4  
    🎶 As you're falling down 🎶


    uint32_t's Avatar
    Join Date
    Feb 2015
    Posts
    1,396
    Thanks given
    6,177
    Thanks received
    776
    Rep Power
    5000
    Nice job.
    Quote Originally Posted by Idiot Bird View Post
    Quote Originally Posted by Velocity View Post
    lol np mate looks like the community brought ur rep down to ur IQ
    Not too sure about that, it's at 0 . It would have to go minus to even be remotely close to his IQ.
    Reply With Quote  
     

  5. #5  
    Super Donator


    Join Date
    Sep 2008
    Age
    30
    Posts
    1,894
    Thanks given
    677
    Thanks received
    776
    Rep Power
    456
    Reply With Quote  
     

  6. Thankful user:


  7. #6  
    Registered Member

    Join Date
    May 2016
    Age
    26
    Posts
    281
    Thanks given
    162
    Thanks received
    64
    Rep Power
    96
    I thought the glider moving across the interface was another interface? correct me if I'm wrong
    Reply With Quote  
     

  8. #7  
    Respected Member


    Polar's Avatar
    Join Date
    Sep 2015
    Age
    28
    Posts
    420
    Thanks given
    0
    Thanks received
    418
    Rep Power
    3098
    Quote Originally Posted by Dank Lord View Post
    I thought the glider moving across the interface was another interface? correct me if I'm wrong
    It's a varp. Varp 153 with values 0-13.
    Reply With Quote  
     


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. pi Gnome Glider's
    By DragonSmith in forum Tutorials
    Replies: 0
    Last Post: 11-30-2016, 12:41 AM
  2. [PI] Full Gnome Glider Transportation
    By Roboyto in forum Tutorials
    Replies: 52
    Last Post: 10-11-2011, 07:35 PM
  3. (PI) NEW WAY TI "TELEPORT" Gnome Gliders.
    By Aymen in forum Tutorials
    Replies: 10
    Last Post: 09-26-2011, 02:40 AM
  4. Gnome Glider Interface
    By Shamon King in forum Snippets
    Replies: 8
    Last Post: 02-01-2009, 03:03 PM
  5. Working Gnome Gliders
    By zootu in forum Tutorials
    Replies: 57
    Last Post: 10-07-2008, 06:04 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
  •