Thread: [PI] Thieving problem

Results 1 to 3 of 3
  1. #1 [PI] Thieving problem 
    Registered Member
    Join Date
    Oct 2013
    Posts
    36
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Hey guys

    If i try thiev on stall then i dont get items .I click on stall but dont get items .

    My Thieving.java:
    Spoiler for thieving.java:
    Code:
    Code:
    package server.model.players.skills; import server.Config; import server.util.Misc; import server.model.players.Client; import server.model.players.Player; import server.event.Event; import server.event.EventContainer; import server.event.EventManager; /** * Thieving.java * * @author Ace * **/ public class Thieving { private Client c; public Thieving(Client c) { this.c = c; } public void stealFromNPC(int id) { if (System.currentTimeMillis() - c.lastThieve < 2000) return; for (int j = 0; j < npcThieving.length; j++) { if (npcThieving[j][0] == id) { if (c.playerLevel[Player.playerThieving] >= npcThieving[j][1]) { if (Misc.random(c.playerLevel[Player.playerThieving] + 2 - npcThieving[j][1]) != 1) { c.getPA().addSkillXP(npcThieving[j][2] * Config.THIEVING_EXPERIENCE, Player.playerThieving); c.getItems().addItem(995, npcThieving[j][3]); c.startAnimation(881); c.lastThieve = System.currentTimeMillis(); c.sendMessage("You thieve some money..."); break; } else { c.setHitDiff(npcThieving[j][4]); c.setHitUpdateRequired(true); //c.playerLevel[c.playerHitpoints] -= npcThieving.getDamage(); c.lastThieve = System.currentTimeMillis() + 2000; c.sendMessage("You fail to thieve the NPC, but take no damage."); c.sendMessage("Justin has saved you from being hurt."); break; } } else { c.sendMessage("You need a thieving level of " + npcThieving[j][1] + " to thieve from this NPC."); } } } } public void stealFromStall(int id, int xp, int level, final int i, final int x, final int y) { if (System.currentTimeMillis() - c.lastThieve < 2500) 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) + "."); c.getPA().checkObjectSpawn(5430 + Misc.random(1), x, y, 0, 10); EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer p) { c.getPA().checkObjectSpawn(i, x, y, 0, 10); p.stop(); } }, 3500); } } else { c.sendMessage("You must have a thieving level of " + level + " to thieve from this stall."); } } //npc, level, exp, coin amount public int[][] npcThieving = {{1,1,8,200,1},{18,25,26,500,1},{9,40,47,1000,2},{26,55,85,1500,3},{20,70,152,2000,4},{21,80,273,3000,5}}; }


    And my ActionHandler.java

    Spoiler for ActionHandler:
    case 2560:
    c.getThieving().stealFromStall(SilkStall[Misc.random(getSilkLength() -1)], 40, 35, objectType, obX, obY);
    break;
    case 2561:
    c.getThieving().stealFromStall(BakeryStall[Misc.random(getBakeryLength() - 1)], 10, 1, objectType, obX, obY);
    break;
    case 2562:
    c.getThieving().stealFromStall(GemStall[Misc.random(getGemLength() - 1)], 30, 25, objectType, obX, obY);
    break;
    case 2563:
    c.getThieving().stealFromStall(FurStall[Misc.random(getFurLength() - 1)], 60, 50, objectType, obX, obY);
    break;
    case 2564:
    c.getThieving().stealFromStall(SpiceStall[Misc.random(getSpiceLength() - 1)], 100, 75, objectType, obX, obY);
    break;
    case 2565:
    c.getThieving().stealFromStall(SilverStall[Misc.random(getSilverLength() - 1)], 170, 90, objectType, obX, obY);
    break;
    Reply With Quote  
     

  2. #2  
    -Founder Off Returnofpk-


    Join Date
    Oct 2012
    Age
    28
    Posts
    655
    Thanks given
    97
    Thanks received
    211
    Rep Power
    303
    Quote Originally Posted by Regnum View Post
    Hey guys

    If i try thiev on stall then i dont get items .I click on stall but dont get items .

    My Thieving.java:


    And my ActionHandler.java

    Spoiler for ActionHandler:

    replace you metod with my one and change only the item id

    Code:
     case 2560:
                       c.getThieving().stealFromStall(995, 3000 + Misc.random(5000), 100, 1);
    
                   break;
                   case 2561:
                       c.getThieving().stealFromStall(995,4000 + Misc.random(8000), 130, 25);
    
                   break;
                   case 2562:
                       c.getThieving().stealFromStall(995, 5000 + Misc.random(8500), 160, 50);
    
                   break;
                   case 2563:
                       c.getThieving().stealFromStall(995,6000 +  Misc.random(9000), 180, 75);
    
                   break;
                   case 2564:
                       c.getThieving().stealFromStall(995, 7000 + Misc.random(10000), 250, 90);
    
                   break;
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Oct 2013
    Posts
    36
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by sheepmonger View Post
    replace you metod with my one and change only the item id

    Code:
     case 2560:
                       c.getThieving().stealFromStall(995, 3000 + Misc.random(5000), 100, 1);
    
                   break;
                   case 2561:
                       c.getThieving().stealFromStall(995,4000 + Misc.random(8000), 130, 25);
    
                   break;
                   case 2562:
                       c.getThieving().stealFromStall(995, 5000 + Misc.random(8500), 160, 50);
    
                   break;
                   case 2563:
                       c.getThieving().stealFromStall(995,6000 +  Misc.random(9000), 180, 75);
    
                   break;
                   case 2564:
                       c.getThieving().stealFromStall(995, 7000 + Misc.random(10000), 250, 90);
    
                   break;

    I get one thieving code,but how i can change amount of item
    public ActionHandler(Client Client) {
    this.c = Client;
    }
    public static int getBakeryLength() {
    return BakeryStall.length;
    }

    public static int getGemLength() {
    return GemStall.length;
    }

    public static int getFurLength() {
    return FurStall.length;
    }

    public static int getSpiceLength() {
    return SpiceStall.length;
    }

    public static int getSilverLength() {
    return SilverStall.length;
    }
    public static int getFishLength() {
    return FishStall.length;
    }
    public static int getFish2Length() {
    return FishStall2.length;
    }
    public static int getTeaLength() {
    return TeaStall.length;
    }
    public static int getVegLength() {
    return VegStall.length;
    }
    public static int getVeg2Length() {
    return VegStall2.length;
    }
    public static int getSilkLength() {
    return SilkStall.length;
    }
    public static final int[] BakeryStall = {2309, 1901, 1891};
    public static final int[] FishStall2 = {378,384,372,7945};
    public static final int[] FishStall = {378,318,336,372,7945};
    public static final int[] TeaStall = {712};
    public static final int[] VegStall2 = {1943,1983,985,987};
    public static final int[] VegStall = {1943,1983,1966,1551};
    public static final int[] SilkStall = {950};
    public static final int[] GemStall = {1623, 1621, 1617, 1619};
    public static final int[] FurStall = {948, 958};
    public static final int[] SpiceStall = {2007, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495,7496};
    public static final int[] SilverStall = {1798, 1800,1806};
    int[] PvpItems = {14876, 14877, 14878, 14879, 14880, 14881, 14882, 14883, 14884, 14885, 14886, 14888, 14889, 14890, 14891, 14892 };
    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. [PI] thieving problem
    By syndrome-scape in forum Help
    Replies: 1
    Last Post: 04-03-2013, 05:13 PM
  2. pi thieving problem
    By Mickt3 in forum Help
    Replies: 9
    Last Post: 08-09-2011, 11:37 AM
  3. [PI] Thieving problems
    By Killznodie in forum Help
    Replies: 2
    Last Post: 04-14-2011, 08:46 PM
  4. [pi]Thieving problem
    By Sir Lethal in forum Help
    Replies: 1
    Last Post: 03-17-2011, 06:47 AM
  5. [PI] Some problemes
    By Analed in forum Help
    Replies: 8
    Last Post: 05-23-2010, 02:16 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
  •