Thread: Why?[PI]

Results 1 to 4 of 4
  1. #1 Why?[PI] 
    Registered Member
    Join Date
    Oct 2009
    Posts
    407
    Thanks given
    123
    Thanks received
    64
    Rep Power
    4
    I don't get why I can't theive these stalls it's so easy to do yet it's not working.

    I looked in an old backup when it WAS working, and the code was exactly the same.

    Maybe it's something I did in theiving.java ?
    Code:
    /* Theiving Stalls */
    case 4876:
    c.getThieving().stealFromStall(1607, 100, 1);
    break;
    case 4875:
    c.getThieving().stealFromStall(1603, 150, 25);
    break;
    case 4874:
    c.getThieving().stealFromStall(1601, 200, 50);
    break;
    case 4877:
    c.getThieving().stealFromStall(1615, 250, 75);
    break;
    case 4878:
    c.getThieving().stealFromStall(6573, 300, 90);
    Code:
    public void stealFromStall(int id, int xp, int level) {
    if (System.currentTimeMillis() - c.lastThieve < 2500)
    return;
    if (Misc.random(100) == 0) {
    			
    return;
    }
    if (c.playerLevel[c.playerThieving] >= level) {
    if (c.getItems().addItem(id,1)) {
    c.startAnimation(832);
    c.getPA().addSkillXP(xp * Config.THIEVING_EXPERIENCE, c.playerThieving);
    c.lastThieve = System.currentTimeMillis();
    c.sendMessage("You steal a " + server.model.items.Item.getItemName(id) + ".");
    }		
    } else {
    c.sendMessage("You must have a thieving level of " + level + " to thieve from this stall.");
    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Member Treq's Avatar
    Join Date
    Aug 2010
    Posts
    463
    Thanks given
    71
    Thanks received
    65
    Rep Power
    22
    Why is there no "break;" in this part of your code?

    Code:
    case 4878:
    c.getThieving().stealFromStall(6573, 300, 90);
    ~Treq~ (Previously Spetsnaz)
    Reply With Quote  
     

  3. #3  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    Code:
    if (c.getItems().addItem(id,1)) {
    That is saying "if that item is added"

    You need to add it, rather than test if it was added.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2010
    Posts
    536
    Thanks given
    61
    Thanks received
    25
    Rep Power
    4
    Quote Originally Posted by Spetznaz View Post
    Why is there no "break;" in this part of your code?

    Code:
    case 4878:
    c.getThieving().stealFromStall(6573, 300, 90);
    He probably forgot to copy the break; otherwise he would be getting errors which he's not getting? or is he getting errors.. o.o


    Quote Originally Posted by stripies View Post
    Code:
    if (c.getItems().addItem(id,1)) {
    That is saying "if that item is added"

    You need to add it, rather than test if it was added.

    errr... What?
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •