Thread: Fishing Help

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 Fishing Help 
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    Problem Solved Please Remove
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    This is not enough to help you I'm afraid, try provide with some more.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    Do you see Second Click, Do you see how it sais tuna and swordfish. well the fishing spot 324, Harpoon only catches swordfish, i want both swordfish and tuna For Harpooning
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2011
    Posts
    189
    Thanks given
    6
    Thanks received
    29
    Rep Power
    52
    Can you show us the "setupFishing" method?
    Reply With Quote  
     

  5. #5  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Post your fishing class

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  6. #6  
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    alright here is my Fishing.java
    Code:
    package server.model.players.skills;
    
    import server.Config;
    import server.util.Misc;
    import server.model.players.Client;
    /**
     * Fishing.java
     *
     * @author Sanity
     *
     **/
     
    public class Fishing {
    	
    	private Client c;
    	private int fishType;
    	private int exp;
    	private int req;
    	private int equipmentType;
    	private final int SALMON_EXP = 70;
    	private final int SWORD_EXP = 100;
    	private final int SALMON_ID = 331;
    	private final int SWORD_ID = 371;
    	public boolean fishing = false;
    	
    	private final int[] REQS = {1,20,35,40,50,62,76,79,81,90};
    	private final int[] FISH_TYPES = {317,335,359,377,371,7944,383,395,389,15270};
    	private final int[] EXP = {10,15,20,25,30,35,40,50,65,70};
    	
    	public Fishing(Client c) {
    		this.c = c;
    	}
    	
    	public void setupFishing(int fishType) {
    		if (c.getItems().playerHasItem(getEquipment(fishType))) {
    			if (c.playerLevel[c.playerFishing] >= req) {
    				int slot = getSlot(fishType);
    					if (slot > -1) {
    						this.req = REQS[slot];
    						this.fishType = FISH_TYPES[slot];
    						this.equipmentType = getEquipment(fishType);
    						this.exp = EXP[slot];
    						c.fishing = true;
    						c.startAnimation(621);
    						c.fishTimer = 3 + Misc.random(2);
    					}
    			} else {
    				c.sendMessage("You need a fishing level of " + req + " to fish here.");
    				resetFishing();
    			}
    		} else {
    			c.sendMessage("You do not have the correct equipment to use this fishing spot.");
    			resetFishing();
    		}
    	}
    	
    	public void catchFish() {
    		if (c.getItems().playerHasItem(getEquipment(fishType))) {
    			if (c.playerLevel[c.playerFishing] >= req) {
    				if (c.getItems().freeSlots() > 0) {
    					if (canFishOther(fishType)) {
    						c.getItems().addItem(otherFishId(fishType),1);
    						c.getPA().addSkillXP(otherFishXP(fishType),c.playerFishing);
    					} else {
    						c.getItems().addItem(fishType,1);
    						c.getPA().addSkillXP(exp * Config.FISHING_EXPERIENCE,c.playerFishing);
    					}
    					c.sendMessage("You catch a fish.");
    					c.fishTimer = 2 + Misc.random(2);
    				}
    			} else {
    				c.sendMessage("You need a fishing level of " + req + " to fish here.");
    				resetFishing();
    			}
    		} else {
    			c.sendMessage("You do not have the correct equipment to use this fishing spot.");
    			resetFishing();
    		}
    	}
    	
    	private int getSlot(int fishType) {
    		for (int j = 0; j < REQS.length; j++)
    			if (FISH_TYPES[j] == fishType)
    				return j;
    		return -1;
    	}
    	
    	private int getEquipment(int fish) {
    		if (fish == 317) //shrimp
    			return 303;
    		if (fish == 335) //trout + salmon
    			return 309;
    		if (fish == 337) //lobs
    			return 301;
    		if (fish == 361)//tuna
    			return 311;
    		if (fish == 7944)//monks
    			return 303;
    		if (fish == 383)//sharks
    			return 311;
    		if (fish == 389)//mantas
    			return 303;
    		return -1;
    	}
    	
    	private boolean canFishOther(int fishType) {			
    		if (fishType == 335 && c.playerLevel[c.playerFishing] >= 30)
    			return true;
    		if (fishType == 361 && c.playerLevel[c.playerFishing] >= 50)
    			return true;
    		return false;
    	}
    	
    	private int otherFishId(int fishType) {
    		if (fishType == 335)
    			return SALMON_ID;
    		else if (fishType == 361)
    			return SWORD_ID;
    		return -1;
    	}
    	
    	private int otherFishXP(int fishType) {
    		if (fishType == 335)
    			return SALMON_EXP;
    		else if (fishType == 361)
    			return SWORD_EXP;
    		return 0;
    	}
    	
    	public void resetFishing() {
    		this.exp = 0;
    		this.fishType = -1;
    		this.equipmentType = -1;
    		this.req = 0;
    		c.fishTimer = -1;
    		c.fishing = false;
    	}
    }
    Reply With Quote  
     

  7. #7  
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    bump
    Reply With Quote  
     

  8. #8  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Code:
    case 324: //tuna And Swordfish
        c.getFishing().setupFishing(359);
        c.getFishing().setupFishing(371);
    break;
    change that into:

    Code:
    case 324: //tuna And Swordfish
        c.getFishing().setupFishing(359);
    break;
    then on these parts:

    Code:
    fishType == 361
    also
    Code:
    fish == 361
    change into:

    Code:
    fishType == 359
    also
    Code:
    fish == 359


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  9. #9  
    Registered Member XxNinjaxX's Avatar
    Join Date
    Aug 2010
    Posts
    344
    Thanks given
    5
    Thanks received
    7
    Rep Power
    0
    Did not help, now i only catch tuna. Be more specific on what to Change, Tell me the lines..?
    Reply With Quote  
     

  10. #10  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by XxNinjaxX View Post
    Did not help, now i only catch tuna. Be more specific on what to Change, Tell me the lines..?
    Lol.. I told you exactly what to change....

    Change 361 to 359 on line 95, 109, 117, 125.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. Replies: 5
    Last Post: 10-29-2012, 05:24 PM
  2. Replies: 15
    Last Post: 08-23-2012, 09:31 PM
  3. Replies: 25
    Last Post: 06-11-2012, 04:32 AM
  4. Replies: 0
    Last Post: 04-22-2009, 09:32 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
  •