Thread: [PI] Firemaking, Thieving, Fishing, Mining & Woodcutting [PI]

Results 1 to 3 of 3
  1. #1 [PI] Firemaking, Thieving, Fishing, Mining & Woodcutting [PI] 
    Registered Member
    Join Date
    Sep 2012
    Posts
    51
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    I have a problem with my skills. For each of these skills, whenever you do it and you either have no pickaxe/logs/fishing equipment, it still does the animation.
    Thieving: You need to be in one specific place to thieve.
    Please help. Thanks, Will REP+ and Thank.

    Firemaking.java:
    package server.model.players.skills;

    import server.model.players.*;
    import server.Config;
    import server.util.Misc;

    /**
    * @Author Sanity
    */

    public class Woodcutting {

    Client c;

    private final int VALID_AXE[] = {1351,1349,1353,1361,1355,1357,1359,6739};
    private final int[] AXE_REQS = {1,1,6,6,21,31,41,61};
    private int logType;
    private int exp;
    private int levelReq;
    private int axeType;
    private final int EMOTE = 875;

    public Woodcutting(Client c) {
    this.c = c;
    }

    public void startWoodcutting(int logType, int levelReq, int exp) {
    if (goodAxe() > 0) {
    c.turnPlayerTo(c.objectX, c.objectY);
    if (c.playerLevel[c.playerWoodcutting] >= levelReq) {
    this.logType = logType;
    this.exp = exp;
    this.levelReq = levelReq;
    this.axeType = goodAxe();
    c.wcTimer = getWcTimer();
    c.startAnimation(EMOTE);
    } else {
    c.getPA().resetVariables();
    c.startAnimation(65535);
    c.sendMessage("You need a woodcutting level of " + levelReq + " to cut this tree.");
    }
    } else {
    c.startAnimation(65535);
    c.sendMessage("You need an axe to cut this tree.");
    c.getPA().resetVariables();
    }
    }


    public void resetWoodcut() {
    this.logType = -1;
    this.exp = -1;
    this.levelReq = -1;
    this.axeType = -1;
    c.wcTimer = -1;
    }

    public void cutWood() {
    if (c.getItems().addItem(logType,1)) {
    c.startAnimation(EMOTE);
    c.sendMessage("You get some logs.");
    c.getPA().addSkillXP(exp * Config.WOODCUTTING_EXPERIENCE, c.playerWoodcutting);
    c.getPA().refreshSkill(c.playerWoodcutting);
    c.wcTimer = getWcTimer();
    } else {
    c.getPA().resetVariables();
    }
    }

    public int goodAxe() {
    for (int j = VALID_AXE.length - 1; j >= 0; j--) {
    if (c.playerEquipment[c.playerWeapon] == VALID_AXE[j]) {
    if (c.playerLevel[c.playerWoodcutting] >= AXE_REQS[j])
    return VALID_AXE[j];
    }
    }
    for (int i = 0; i < c.playerItems.length; i++) {
    for (int j = VALID_AXE.length - 1; j >= 0; j--) {
    if (c.playerItems[i] == VALID_AXE[j] + 1) {
    if (c.playerLevel[c.playerWoodcutting] >= AXE_REQS[j])
    return VALID_AXE[j];
    }
    }
    }
    return - 1;
    }

    public int getWcTimer() {
    int time = Misc.random(5);
    return time;
    }

    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2010
    Age
    25
    Posts
    1,899
    Thanks given
    446
    Thanks received
    524
    Rep Power
    0
    You need to check if the player really has the axe and return it.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2012
    Posts
    51
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    So would it be something like:
    if c.playerHasAxe = false;
    return;
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [PI] Better Thieving Stalls
    By Dexter Morgan in forum Snippets
    Replies: 28
    Last Post: 01-21-2014, 02:50 AM
  2. Replies: 39
    Last Post: 09-16-2011, 02:03 AM
  3. [PI]Firemaking
    By wildjjbug in forum Help
    Replies: 6
    Last Post: 10-04-2010, 07:10 AM
  4. [PI] Firemaking
    By S H O R T in forum Help
    Replies: 0
    Last Post: 08-31-2010, 05:31 PM
  5. Replies: 25
    Last Post: 04-20-2010, 10:36 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •