Thread: [718] Burthorpe Agility

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [718] Burthorpe Agility 
    Donator
    Mateo's Avatar
    Join Date
    Nov 2014
    Posts
    61
    Thanks given
    22
    Thanks received
    13
    Rep Power
    12
    Here's another snippet of some of the object handling for the Burthorpe Agility Course.
    I'll be posting another snippet of the Brimhaven Course as well once it is complete.

    Spoiler for BurthorpeAgility.java:
    Code:
    public class BurthorpeAgility {
    
    	public static void walkLog(final Player player) {
    		if (player.getX() != 2919 || player.getY() != (player.getY() >= 3558 ? 3558 : 3552))
    			return;
    		final boolean running = player.getRun();
    		player.setRunHidden(false);
    		player.lock(8);
    		player.addWalkSteps(2919, player.getY() < 3558 ? 3558 : 3552, -1, false);
    		player.sendMessage("You walk across the log beam...", true);
    		WorldTasksManager.schedule(new WorldTask() {
    			boolean secondloop;
    			@Override
    			public void run() {
    				if (!secondloop) {
    					secondloop = true;
    					player.getAppearance().setRenderEmote(155);
    				} else {
    					player.getAppearance().setRenderEmote(-1);
    					player.setRunHidden(running);
    					setBurthorpeStage(player, 0);
    					player.getSkills().addXp(Skills.AGILITY, 5);
    					player.sendMessage("... and make it safely to the other side.", true);
    					stop();
    				}
    			}
    		}, 0, 5);
    	}
    
    	public static void climbWall(final Player player) {
    		if (player.getY() != 3561)
    			player.addWalkSteps(player.getX(), 3561);
    		player.sendMessage("You climb the wall.", true);
    		player.useStairs(828, new WorldTile(player.getX(), 3562, 1), 1, 2);
    		WorldTasksManager.schedule(new WorldTask() {
    			@Override
    			public void run() {
    				if (getBurthorpeStage(player) == 0)
    					setBurthorpeStage(player, 1);
    				player.getSkills().addXp(Skills.AGILITY, 2);
    			}
    		}, 1);
    	}
    
    	public static void walkAcrossBalancingLedge(final Player player, final WorldObject object) {
    		if (player.getY() != 3564 || player.getX() < 2916) {
    			player.sendMessage("You cannot walk across from here!");
    			return;
    		}
    		player.sendMessage("You put your foot on the ledge and try to edge across...", true);
    		player.lock(5);
    		player.setNextAnimation(new Animation(752));
    		player.getAppearance().setRenderEmote(156);
    		final WorldTile toTile = new WorldTile((player.getX() >= 2916 ? 2912 : 2916), object.getY(), object.getPlane());
    		player.setRun(true);
    		player.addWalkSteps(toTile.getX(), toTile.getY(), -1, false);
    		WorldTasksManager.schedule(new WorldTask() {
    			@Override
    			public void run() {
    				player.setNextAnimation(new Animation(758));
    				player.getAppearance().setRenderEmote(-1);
    				player.getSkills().addXp(Skills.AGILITY, 5);
    				player.sendMessage("You skillfully edge across the gap.", true);
    				if (getBurthorpeStage(player) == 1)
    					setBurthorpeStage(player, 2);
    			}
    		}, 4);
    	}
    	
    	public static void climbOverObstacleWall(final Player player, WorldObject object) {
    		if (player.getX() >= object.getX()) {
    			player.getPackets().sendGameMessage("You cannot climb that from this side.");
    			return;
    		}
    		if (player.getY() == 3562) {
    			player.getPackets().sendGameMessage("You climb the low wall...", true);
    			player.lock(3);
    			player.setNextAnimation(new Animation(4853));
    			final WorldTile toTile = new WorldTile(object.getX() + 1, 3562, object.getPlane());
    			player.setNextForceMovement(new ForceMovement(player, 0, toTile, 2, ForceMovement.EAST));
    			WorldTasksManager.schedule(new WorldTask() {
    	
    				@Override
    				public void run() {
    					player.setNextWorldTile(toTile);
    					player.getSkills().addXp(Skills.AGILITY, 3);
    					if (getBurthorpeStage(player) == 2)
    						setBurthorpeStage(player, 3);
    				}
    	
    			}, 1);
    		} else
    			player.addWalkSteps(2910, 3562);
    	}
    	
    	public static void swingOnRopeSwing(final Player player, WorldObject object) {
    		if (player.getX() > object.getX()) {
    			player.getPackets().sendGameMessage("You cannot swing on that from this side.");
    			return;
    		}
    		player.lock(4);
    		player.setNextAnimation(new Animation(751));
    		World.sendObjectAnimation(player, object, new Animation(497));
    		final WorldTile toTile = new WorldTile(2916, 3562, object.getPlane());
    		player.setNextForceMovement(new ForceMovement(player, 1, toTile, 2, ForceMovement.EAST));
    		player.sendMessage("You skillfully swing on the rope.", true);
    		WorldTasksManager.schedule(new WorldTask() {
    
    			@Override
    			public void run() {
    				player.setNextWorldTile(toTile);
    				player.getSkills().addXp(Skills.AGILITY, 10);
    				if (getBurthorpeStage(player) == 3)
    					setBurthorpeStage(player, 4);
    			}
    
    		}, 1);
    	}
    	
    	public static void swingAcrossMonkeyBars(final Player player, WorldObject object) {
    		if (player.getY() <= 3554) {
    			player.sendMessage("You cannot swing across those from this side.");
    			return;
    		}
    		if (player.getX() == 2917) {
    			player.lock(7);
    			final boolean running = player.getRun();
    			player.setRunHidden(false);
    			player.addWalkSteps(2917, 3554, -1, false);
    			player.sendMessage("You swing across the monkey bars...", true);
    			WorldTasksManager.schedule(new WorldTask() {
    				boolean secondloop;
    				@Override
    				public void run() {
    					if (!secondloop) {
    						secondloop = true;
    						player.getAppearance().setRenderEmote(662);
    					} else {
    						player.getAppearance().setRenderEmote(-1);
    						player.setRunHidden(running);
    						player.getSkills().addXp(Skills.AGILITY, 20);
    						if (getBurthorpeStage(player) == 4)
    							setBurthorpeStage(player, 5);
    						player.sendMessage("... and make it safely to the other side.", true);
    						stop();
    					}
    				}
    			}, 0, 6);
    		} else
    			player.addWalkSteps(2917, 3561);
    	}
    	
    	public static void jumpDownLedge(final Player player, WorldObject object) {
    		if (player.getY() <= 3552) {
    			player.sendMessage("You cannot jump down that ledge from this side.");
    			return;
    		}
    		if (player.getY() >= 3553) {
    			player.sendMessage("You jump down...", true);
    			player.setNextAnimation(new Animation(7269));
    			final WorldTile toTile = new WorldTile(player.getX(), 3552, 0);
    			player.setNextForceMovement(new ForceMovement(player, 0, new WorldTile(toTile.getX(), toTile.getY() - 1, 1), 1, ForceMovement.SOUTH));
    			WorldTasksManager.schedule(new WorldTask() {
    				@Override
    				public void run() {
    					player.setNextWorldTile(toTile);
    					player.sendMessage("...to the ground below.", true);
    					if (getBurthorpeStage(player) == 5) {
    						player.sendMessage("You have completed a lap at the Burthorpe Agility Course!");
    					}
    					player.getSkills().addXp(Skills.AGILITY, 5);
    					setBurthorpeStage(player, 0);
    				}
    			}, 0);
    		}
    	}
    
    	public static void removeBurthorpeStage(Player player) {
    		player.getTemporaryAttributes().remove("BurthorpeCourse");
    	}
    
    	public static void setBurthorpeStage(Player player, int stage) {
    		player.getTemporaryAttributes().put("BurthorpeCourse", stage);
    	}
    
    	public static int getBurthorpeStage(Player player) {
    		Integer stage = (Integer) player.getTemporaryAttributes().get("BurthorpeCourse");
    		if (stage == null)
    			return -1;
    		return stage;
    	}
    }

    Now, adding the objects in ObjectHandler is exactly as you would assume
    except for the rope-swing, which is handled before the coords event.
    Otherwise, you will receive a "You can't reach that!" message
    and the action will not be processed.

    So, when adding the methods to their respective objects, add:
    Code:
    BurthorpeAgility.swingOnRopeSwing(player, object);
    before
    Code:
    player.setCoordsEvent(new CoordsEvent(object, new Runnable() {
    in HandleOption1. All of the other methods can be added after it just like any other object handling method.

    Hopefully you guys got something valuable out of this snippet.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    1,666
    Thanks given
    253
    Thanks received
    407
    Rep Power
    296
    Didn't even realize this thing existed o.O Thanks!
    Reply With Quote  
     

  4. #3  
    Registered Member sazx77's Avatar
    Join Date
    Mar 2016
    Posts
    87
    Thanks given
    19
    Thanks received
    14
    Rep Power
    28
    can you help me with this coding. am I supposed to make a notepad save file called burthropeagility.java or what folder/java do I replace please help me.
    Reply With Quote  
     

  5. #4  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Thanks I might use
    Reply With Quote  
     

  6. #5  
    Donator
    Mateo's Avatar
    Join Date
    Nov 2014
    Posts
    61
    Thanks given
    22
    Thanks received
    13
    Rep Power
    12
    You can add the BurthorpeAgility.java file anywhere in your source that you'd like, just make sure your imports & references match up when adding the methods from it into ObjectHandler.java

    Quote Originally Posted by sazx77 View Post
    can you help me with this coding. am I supposed to make a notepad save file called burthropeagility.java or what folder/java do I replace please help me.
    Reply With Quote  
     

  7. #6  
    Husband. Father.
    Loyalty_'s Avatar
    Join Date
    Aug 2013
    Age
    28
    Posts
    1,170
    Thanks given
    74
    Thanks received
    130
    Rep Power
    64
    Thanks, trying to complete all agility courses, forgot this one was there.
    Loyalty_





    Quote Originally Posted by Falconpunch View Post
    Player.java buddy. find init() or something like that and find where it adds the starter and do what someone mentioned above (Although an int is 4 scrublords)
    Reply With Quote  
     

  8. #7  
    Hyperion
    Sammi's Avatar
    Join Date
    Jun 2014
    Posts
    601
    Thanks given
    173
    Thanks received
    259
    Rep Power
    8
    Thank you
    Reply With Quote  
     

  9. #8  
    Registered Member sazx77's Avatar
    Join Date
    Mar 2016
    Posts
    87
    Thanks given
    19
    Thanks received
    14
    Rep Power
    28
    Quote Originally Posted by Mateo View Post
    You can add the BurthorpeAgility.java file anywhere in your source that you'd like, just make sure your imports & references match up when adding the methods from it into ObjectHandler.java
    Hey do u got a team of you need a team I am currently making one so if u interested add me on skype my name is sazx316.
    Reply With Quote  
     

  10. #9  
    Developer of LonelySouls
    Lonely Souls's Avatar
    Join Date
    Jan 2014
    Posts
    115
    Thanks given
    15
    Thanks received
    16
    Rep Power
    0
    Quote Originally Posted by sazx77 View Post
    can you help me with this coding. am I supposed to make a notepad save file called burthropeagility.java or what folder/java do I replace please help me.
    I think you should take time out of Runescape Server's to learn how to properly code, how to save files and learn what folder is appropriate. As long as you have proper imports, it doesn't always matter where your file is... I don't suggest doing that because of organizational reasons but yeah....

    Java Programmer

    Quote Originally Posted by edvinas123 View Post
    So I've recently changed some things in the server, but when i compile it says -

    source\server\model\players\packets\Commands.java: 58: error: cannot find symbol
    This.Antileech("Remove This Line");
    ^

    any heeelppp??
    Reply With Quote  
     

  11. #10  
    Registered Member sazx77's Avatar
    Join Date
    Mar 2016
    Posts
    87
    Thanks given
    19
    Thanks received
    14
    Rep Power
    28
    Quote Originally Posted by Lonely Souls View Post
    I think you should take time out of Runescape Server's to learn how to properly code, how to save files and learn what folder is appropriate. As long as you have proper imports, it doesn't always matter where your file is... I don't suggest doing that because of organizational reasons but yeah....
    for your info I don't need help with this anymore I got a team of 4 dev's and what do you got ohh nothin lol
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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] Burthorpe Mining cave problem
    By Shoutout in forum Help
    Replies: 0
    Last Post: 05-27-2015, 06:34 PM
  2. 718 Gnome agility issue
    By Shoutout in forum Help
    Replies: 5
    Last Post: 10-01-2014, 11:08 AM
  3. 718 Brimhaven agility
    By Con Artist in forum Show-off
    Replies: 2
    Last Post: 10-19-2012, 07:36 PM
  4. [Helios 718] Gnome agility course
    By Own4g3 in forum Show-off
    Replies: 7
    Last Post: 08-07-2012, 06:46 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
  •