Fishing base code:Note: this is from rs2hd forums final play base. I didn't make it. It's for a 508, but is easily convertable if it doesn't work right away.Code:package com.rs2hd.content; import com.rs2hd.event.Event; import com.rs2hd.model.Item; import com.rs2hd.model.Location; import com.rs2hd.model.Player; import com.rs2hd.model.Skills; import com.rs2hd.model.World; public class Fishing { private static enum FISHING_TYPE { CAGE_LOBSTER, } private Event event = null; private Player player; public Fishing(Player player) { setPlayer(player); } private void setPlayer(Player player) { this.player = player; } public void startFishing(int npcId, int tick, final Location nextTo) { FISHING_TYPE fishingType = null; if (npcId == 6267) { fishingType = FISHING_TYPE.CAGE_LOBSTER; } if (fishingType == null) { player.getActionSender().sendMessage( "No data for this NPC - Fishing."); return; } if (player.getInventory().getFreeSlots() == 0) { player.getActionSender().sendMessage("Not enough space in inventory"); if (event != null) event.stop(); return; } Event event = null; int animation = -1; int fishItem = -1; int lvlReq = -1; int exp = 0; boolean canFish = false; switch (fishingType) { case CAGE_LOBSTER: animation = 10009; fishItem = 377; lvlReq = 1; exp = 20; canFish = true; tick = 5000; break; } final int fish = fishItem; final int finalAnimation = animation; final int finalTick = tick; final int xp = exp; final Item item = new Item(fishItem, 1); if (canFish) { player.setFishingAction(true); if (player.getSkills().getLevel(Skills.FISHING) < lvlReq) { player.getActionSender().sendMessage( "You need a fishing level of " + lvlReq + " to fish " + item.getDefinition().getName()); player.setFishingAction(false); return; } player.animate(animation); event = new Event(tick) { @Override public void execute() { if (player.isFishing()) { System.out.print(player.getLocation().withinDistance(nextTo, 10)); System.out.print(player.isFishing()); // if (player.getLocation().withinDistance(nextTo, 1)) { if (player.getInventory().getFreeSlots() <= 0) { this.stop(); player.animate(-1); player.getActionSender().sendMessage( "Not enough inventory space."); return; } if (getTick() == 100) { player.animate(finalAnimation); setTick(finalTick); } else { int random = (int) (java.lang.Math.random() * (player .getSkills().getLevel(Skills.FISHING) + 1)); if (random > player.getSkills().getLevel( Skills.FISHING) >> 3 + 5) { player.getInventory().addItem(fish, 1); player.getActionSender().sendMessage( "You just caught a " + item.getDefinition() .getName() + "."); setTick(finalTick); player.getSkills() .addXp(Skills.FISHING, xp); } } player.animate(finalAnimation); if (getTick() == 0) { setTick(finalTick); } else { //player.setFishingAction(false); //player.animate(-1); //stop(); } } else { player.setFishingAction(false); stop(); } } }; } if (event != null) { World.getInstance().registerEvent(event); } } }
There's a theiving base in the tut sections for 508 (stalls) which you could use to see how it's done.





