Thread: Agility Shortcut (Base)

Results 1 to 4 of 4
  1. #1 Agility Shortcut (Base) 
    Registered Member
    Join Date
    Apr 2012
    Posts
    83
    Thanks given
    79
    Thanks received
    52
    Rep Power
    30
    Code:
    package com.rs2.game.content.skills.agility;
    
    import com.rs2.game.content.skills.SkillConstants;
    import com.rs2.game.player.Client;
    
    public class AgilityShortcut {
        
    	public enum ShortcutData {
    	    	/**
    	    	 * Shortcut in Yannile. int[][] data expressed as (obj, destX, destY)
    	    	 */
    		YANNILE(16, new int[][] {
    			{
    				9301, 2575, 3112
    			}, {
    				9302, 2574, 3108
    			}
    		}, 30, 333, 6516);
    		private int levelRequired, xp, emote, interfaceId;
    		private int[][] data;
    		ShortcutData(int levelRequired, int[][] data, int xp, int emote, int interfaceId) {
    			this.levelRequired = levelRequired;
    			this.data = data;
    			this.xp = xp;
    			this.emote = emote;
    			this.interfaceId = interfaceId;
    		}
    		
    		/**
    		 * @return the shortcut levelRequired
    		 */
    		public int getLevelRequired() {
    			return levelRequired;
    		}
    		
    		/**
    		 * @return the shortcut data
    		 */
    		public int[][] getData() {
    			return data;
    		}
    		
    		/**
    		 * @return the shortcut xp
    		 */
    		public int getXp() {
    			return xp;
    		}
    		
    		/**
    		 * @return the shortcut emote
    		 */
    		public int getEmote() {
    			return emote;
    		}
    		
    		/**
    		 * @return the shortcut item interfaceId
    		 */
    		public int getInterfaceId() {
    			return interfaceId;
    		}
    	}
    
    	/**
    	 * Collects data in the ShortcutData enum.
    	 * @param objectType
    	 * 	the shortcut object
    	 * @return
    	 * 	null if the shortcut object does not exist
    	 */
    	public static ShortcutData forId(int objectType) {
    		for (ShortcutData sd: ShortcutData.values()) {
    			for (int i = 0; i < sd.getData().length; i++) {
    				if (objectType == sd.getData()[i][0]) {
    					return sd;
    				}
    			}
    		}
    		return null;
    	}
    
    	/**
    	 * Agility shortcut main stuff here. TODO Make into an event.
    	 * @param c
    	 * 	client
    	 * @param objectType
    	 * 	the shortcut object id
    	 * @return
    	 * 	false if the object id is an agility shortcut object
    	 */
    	public static boolean doShortcut(Client c, int objectType) {
    		ShortcutData sd = forId(objectType);
    		if (sd == null) {
    			return true;
    		}
    		for (int i = 0; i < sd.getData().length; i++) {
    			if (objectType == sd.getData()[i][0]) {
    				if (c.playerLevel[SkillConstants.AGILITY] < sd.getLevelRequired()) {
    					c.getActionSender().sendGiveItemNpc("You need an Agility level of" + sd.getLevelRequired() + " to do this.", sd.getInterfaceId());
    					return true;
    				}
    				c.getPA().movePlayer(sd.getData()[i][1], sd.getData()[i][2], 0);
    				c.getActionSender().sendMessage("You pass the shortcut.");
    			}
    		}
    
    		return false;
    	}
    
    
    
    }
    first click object packet above the switch statement:
    Code:
    if(AgilityShortcut.doShortcut(c, objectType)){
    	    //hook
    }
    item npc message method, ripped:
    Code:
    public void sendGiveItemNpc(String text, int item) {
        c.getActionSender().sendFrame126(text, 308);
        c.getActionSender().sendFrame246(307, 200, item);
        c.getActionSender().sendFrame164(306);
    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Mylyn's Avatar
    Join Date
    Dec 2012
    Posts
    1,543
    Thanks given
    602
    Thanks received
    278
    Rep Power
    119
    Seems nice, good job.
    Reply With Quote  
     

  3. #3  
    Java Developer

    Celty's Avatar
    Join Date
    Aug 2013
    Age
    27
    Posts
    355
    Thanks given
    94
    Thanks received
    91
    Rep Power
    173
    Pretty basic if I remember correctly the player moves to a certain location before starting the shortcut ex.from lumby to varrock fence jump. Its a decent start missing a few basic things, Thanks for you contribution.
    Watched Anime List

    A Certain Magical Index A Certain Scientific Railgun A Certain Scientific Railgun S Sword Art Online Dragon Ball Dragon Ball Z Dragon Ball GT Deadman Wounderland Elfen Lied Eureka Seven Eureka Seven AO
    K-ON Clannad Clannad After Story Baka & Test Ouran Host Club One Peice InuYasha Kaze No Stigma Okami-San & Her Seven Companions Accel World Angel Beats
    Guilty Crown Cowboy Bebop Full Metal Alchemist Full Metal Alchemist: Brotherhood Soul Eater Madoka Magica Fairy Tail Yu Yu Hakusho Chrome Shelled Regios
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2010
    Posts
    354
    Thanks given
    17
    Thanks received
    61
    Rep Power
    47
    Why do you use a boolean for this?
    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. 718 Agility Shortcuts
    By JayStrides in forum Help
    Replies: 3
    Last Post: 10-31-2012, 11:34 PM
  2. Replies: 1
    Last Post: 08-14-2012, 01:50 PM
  3. [Hyperion] Brimhaven Agility Minigame base
    By Jinrake in forum Snippets
    Replies: 8
    Last Post: 06-12-2011, 10:37 PM
  4. Brimhaven dungeon(with agility shortcuts)
    By Emergency in forum Configuration
    Replies: 14
    Last Post: 05-23-2009, 05:15 AM
  5. Agility [Base]
    By Ian... in forum Tutorials
    Replies: 10
    Last Post: 06-24-2008, 02:12 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •