Thread: 317 pi fishing animation not showing added all anitmations??

Results 1 to 9 of 9
  1. #1 317 pi fishing animation not showing added all anitmations?? 
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Code:
    package server.model.players.skills;
    
    import server.Config;
    import server.util.Misc;
    import server.model.players.Client;
    /**
     * Fishing.java
     *
     * @author Demise
     *
     **/
     
    public class Fishing {
    	
    	private Client c;
    	private int fishType;
    	private int exp;
    	private int req;
    	private int animation;
    	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,40,35,62,76,81};
    	private final int[] FISH_TYPES = {317,335,359,359,7944,383,389};
    	private final int[] EXP = {10,50,80,90,120,110,46};
    	private final int[] ANIMS = {618,619,621,622};
    	
    	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];
    						this.animation = getAnim(equipmentType);
    						c.fishing = true;
    						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.startAnimation(animation);
    						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;
    	}
    	
    	public int getAnim(int equipment){
            if (equipment == 303) //fishing net
                            return 621;
                    if (equipment == 309) //fishing rod
                            return 622;
                    if (equipment == 301) //lobster cage
                            return 619;
                    if (equipment == 311)//harpoon
                            return 618;
    						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;
    	}
    }
    fishing.java

    help please,

    Kind Regards


    ipkmills
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    bumb
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    bumb
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2011
    Posts
    1,767
    Thanks given
    493
    Thanks received
    425
    Rep Power
    0
    this is not a 317 help section.
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by tyl3r View Post
    Code:
    package server.content.skills;
    
    import server.Config;
    import server.Server;
    import core.util.Misc;
    import server.event.Event;
    import server.event.EventContainer;
    import server.game.players.PlayerAssistant;
    import server.event.EventManager;
    import server.game.objects.Objects;
    import server.game.players.Client;
    import server.game.players.Player;
    
    /**
     * @author Tyl3r
     **/
    
    public class Fishing {
    	
    	private Client c;
    	public Fishing(Client c) {
    		this.c = c;
    	}
    
    public void FishingProcess() {
    	boolean resetAnim = false;
            if (c.fishtimer > 0) {
                c.fishtimer--;
            }
    		
    
            if (c.fishing && c.getItems().freeSlots() <= 0) {
                c.fishing = false;
                c.sendMessage("You need more free inventory spots to continue.");
                c.getPA().frame1();
    	    resetAnim = true;
            }
    
            if (c.fishing && c.fishtimer <= 0 && c.getItems().freeSlots() > 0) {
                if (c.getItems().playerHasItem(c.fishitem)) {
                    if (c.playerLevel[10] >= c.fishreqt) {
                        if (c.fishitem == 307 && !c.getItems().playerHasItem(313)) {
                            c.sendMessage("You need bait to fish here!");
                            c.fishing = false;
                        } else if (c.fishitem == 309 && !c.getItems().playerHasItem(314)) {
                           c.sendMessage("You need feathers to fish here!");
                            c.fishing = false;
    			} else {
                            if (c.fishreq2 != 0 && c.playerLevel[10] >= c.fishreq2 && Misc.random(1) == 1) {
                                c.getItems().addItem(c.fishies2, 1);
                            c.getPA().addSkillXP(c.fishXP, 10);
                            } else {
                                c.getItems().addItem(c.fishies, 1);
                            c.getPA().addSkillXP(c.fishXP, 10);
                            }
                            if (c.fishitem == 307)
                            c.getPA().addSkillXP(c.fishXP, 10);
                            c.fishtimer = Misc.random(fishtime(c.fishies, c.fishreqt));   
                        }
                    } else {
                        c.fishing = false;
                        c.sendMessage("You need a fishing level of " + c.fishreqt + " to fish here.");
    					resetFishing();
                    }
                } else {
                    c.fishing = false;
                   c.sendMessage("You need a " + c.getItems().getItemName(c.fishitem) + " to fish here.");
    			   resetFishing();
                }
            }
    
            if (c.fishing) {
                c.startAnimation(c.fishemote);
    			//c.stopMovement();
            }
    	
    	
    	
          
    	
    		if (c.attemptingfish)
               if(c.clickObjectType > 0 && c.goodDistance(c.objectX + c.objectXOffset, c.objectY + c.objectYOffset, c.getX(), c.getY(), c.objectDistance)) {
                    c.attemptingfish = false;
                    c.fishing = true;
                }
    	}
    	public void Lol() {
    	c.fishing = true;
            c.startAnimation(c.fishemote);
    	return;
    	}       
    	
    	 public int fishtime(int fish, int req) {
            int time = 10;
            if (fish == 317) {//Shrimp 1
                time = 10;
    			c.sendMessage("You catch some raw shrimps.");
            }
    		
            if (fish == 321) {//Anchovies 5
                time = 11;
    			c.sendMessage("You catch some raw anchovies.");
            }
            if (fish == 327) {//Sardine 5
                time = 15;
    			c.sendMessage("You catch a raw sardine.");
            }
            if (fish == 355) {//Trout 20
                time = 20;
    			c.sendMessage("You catch a raw trout.");
            }
            if (fish == 341) {//Cods 23
                time = 25;
    			c.sendMessage("You catch a raw cod.");
            }
            if (fish == 349) {//Pike 25
                time = 28;
    			c.sendMessage("You catch a raw pike.");
            }
            if (fish == 359) {//Tuna 35
                time = 30;
    			c.sendMessage("You catch a raw tuna.");
    			} else {
    			if(c.fishies == 371) {
    			time = 33;
    			c.sendMessage("You catch a raw swordfish.");
    			}
    			}
            if (fish == 363) {//bass
                time = 35;
    			c.sendMessage("You catch a raw bass.");
            }
            if (fish == 377) {//Lobsters 40
                time = 35;
    			c.sendMessage("You catch a raw lobster.");
            }
            if (fish == 383) {//Sharks 79
                time = 40;
    			c.sendMessage("You catch a raw shark.");
            }
            if (fish == 7944) { // Monkfish
            	time = 30;
            	c.sendMessage("You catch a monkfish.");
            }
            if (fish == 389) {//Manta ray 85
                time = 45;
    			c.sendMessage("You catch a raw manta ray.");
            }
            int LevelXP = c.playerLevel[10] - req;
            if (LevelXP > req / 3)
                LevelXP = req / 3;
            time -= LevelXP;
            return time;
        }
    	public void resetFishing() {
    		this.c.fishies = -1;
    		this.c.fishitem = -1;
    		this.c.fishreqt = 0;
    		c.fishing = false;
    	}
    }
    Replace, enjoy.

    gives me so much errors cuz i don't got all the other stuff i need
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by ipkmills View Post
    gives me so much errors cuz i don't got all the other stuff i need
    need all client related codes
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Dec 2012
    Posts
    558
    Thanks given
    24
    Thanks received
    115
    Rep Power
    0
    Quote Originally Posted by ipkmills View Post
    need all client related codes
    What?
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by silentaak View Post
    What?
    he so fixed my code of fishing but didnt gave me the client related codes so all my errors have to do with missing implents
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Dec 2012
    Posts
    558
    Thanks given
    24
    Thanks received
    115
    Rep Power
    0
    Quote Originally Posted by ipkmills View Post
    he so fixed my code of fishing but didnt gave me the client related codes so all my errors have to do with missing implents
    Can't you fix them, and what "client related codes", please provide an example.
    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. Replies: 1
    Last Post: 02-11-2011, 10:20 PM
  2. [PI] Asgarnia Client not showing models
    By ediremixxx in forum Help
    Replies: 0
    Last Post: 02-11-2011, 02:40 AM
  3. [PI] Asgarnia Client not showing models
    By ediremixxx in forum Help
    Replies: 1
    Last Post: 02-11-2011, 02:02 AM
  4. [pi] combat level not showing
    By IcEbLiTzMeHh in forum Help
    Replies: 0
    Last Post: 10-26-2010, 10:57 PM
  5. [PI] Spec Bar Not Showing
    By Eddie12390 in forum Help
    Replies: 5
    Last Post: 09-26-2010, 02:57 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
  •