Thread: Thieving Troubles

Results 1 to 3 of 3
  1. #1 Thieving Troubles [pi] 
    Tantalizing

    Join Date
    May 2014
    Age
    28
    Posts
    14
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    Alright so heres my problem, whenever you thieve, you get the item and the coins, but if youre under the needed level, you still get the coins, can i get a little help?

    Code:
    			case 4877: //1
    				int[] magicStall = {554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 9075};
    				if (c.getItems().freeSlots() == 0) {
    		            c.sendMessage("Your inventory is full.");
    		            return;
    		        }
    				if (System.currentTimeMillis() - c.lastThieve < 2500) {
    					return;
    				} else {
    					c.getItems().addItem(995, Misc.random(4000) + 1000);
    					c.getThieving().stealFromStall(magicStall[Misc.random(13)], Misc.random(19) + 5, 50, 1);
    				}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2014
    Posts
    813
    Thanks given
    69
    Thanks received
    47
    Rep Power
    9
    Post your stealfromstall method in thieving.java

    Should look something like this
    Code:
    public void stealFromStall(int id, int amount, 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, amount)) {
    				c.startAnimation(832);
    				c.getPA().addSkillXP(xp * Config.THIEVING_EXPERIENCE, c.playerThieving);
    				c.lastThieve = System.currentTimeMillis();
    				c.sendMessage("You receive "+amount+" Coins");
    						
    			}		
    		} else {
    			c.sendMessage("You must have a thieving level of " + level + " to thieve from this stall.");
    		}
    	}
    Gl.
    Reply With Quote  
     

  3. #3  
    mush

    Danny's Avatar
    Join Date
    Sep 2013
    Posts
    1,221
    Thanks given
    38
    Thanks received
    316
    Rep Power
    551
    Add something like this for your stealFromStall

    Code:
    public void stealFromStall(int id, int xp, int level) {
            if (System.currentTimeMillis() - c.lastThieve < 2500)
                return;
            if (c.playerLevel[c.playerThieving] >= level) {
                if (c.getItems().freeSlotAmount() == 0) {
                    c.sendMessage("You haven't got enough inventory space to continue thieving.");
                    c.getPA().sendStatement("You haven't got enough inventory space to continue!");
                    return;
                }
                if(Misc.random(12) == 1) {
                    int hit = c.playerLevel[3] < 31 ? Misc.random(4) : Misc.random(10);
                    if (hit == 0) hit = 1;
                    c.sendMessage("You get caught when you try to steal from the stall.");
                    c.startAnimation(3679);
                    appendHit(hit, c);
                    return;
                }
                c.sendMessage("You attempt to steal something from the stall...");
                c.getItems().addItem(id, 1);
                c.startAnimation(832);
                c.turnPlayerTo(c.objectX, c.objectY);
                Experience.addExperience(c, xp * Config.THIEVING_EXPERIENCE, c.playerThieving);
                c.lastThieve = System.currentTimeMillis();
                c.sendMessage("You steal a " + server.model.items.Item.getItemName(id) + ".");
            } else if(c.playerLevel[17] < level) {
                c.sendMessage("You need a theiving level of "+level+" to theif from this stall.");
            }
        }
    Then in actionHandler add something like this:

    Code:
    case 4877:
                    c.getThieving().stealFromStall(1897, 10, 1);
                    break;
    Attached image
    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. [V1]Full Stall Thieving[V1]
    By Mr Chainsaw in forum Tutorials
    Replies: 11
    Last Post: 05-26-2007, 02:08 PM
  2. Full ardougne stalls (thieving, without Handler)
    By Sam Server in forum Tutorials
    Replies: 5
    Last Post: 05-11-2007, 10:55 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
  •