Post your thieving.java in [CODE] [/CODE] tags.
|
I need to change the items that the stalls give and how many of that item. Thanks.
Post your thieving.java in [CODE] [/CODE] tags.
it seriously isnt that hard...
just go look at the items it already gives and either copy and paste that under and replace the id's or just change the id's that are already there..simple.
Can't find the items it gives. Anyways here's the code:
Code:package server.model.players.skills; import server.Config; import server.util.Misc; import server.model.players.Client; /** * Thieving.java * * @author Sanity * **/ 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[c.playerThieving] >= npcThieving[j][1]) { if (Misc.random(c.playerLevel[c.playerThieving] + 2 - npcThieving[j][1]) != 1) { c.getPA().addSkillXP(npcThieving[j][2] * Config.THIEVING_EXPERIENCE, c.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[3] -= npcThieving[j][4]; c.getPA().refreshSkill(3); c.lastThieve = System.currentTimeMillis() + 2000; c.sendMessage("You fail to thieve the NPC."); 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) { 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."); } } //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}}; }
I suggest you post your thieving.java code, although you may not feel comfortable doing so, that I will respect.Code:SILK_STALL(34383, 20, new int[] { 950 }, 1, 8, 24, 34381)
If you don't I will try to explain this basic code, which is a line of code for a Silk Stall out of thieving.java.
34383 = Object id. 20 = the amount of seconds it takes till the stall "renews." 950 = item id, in this case silk. This is the number you would like to change, because for yourself you wanted to change what certain stalls give. Simply change the id to what you would prefer. Say I wanted my Silk Stall to give out Bronze platebody's I would simply change the 950 to 1117(Bronze Platebody id) Now my code will be
Hopefully this helped you out, if not please feel free to respond...Code:SILK_STALL(34383, 20, new int[] { 1117 }, 1, 8, 24, 34381)
In ActionHandler you will find something like
stealFromStall(1234, 50000, 50)
The first number in those parameters is the item id that is being added to the player's inventory. So just search up the item id it currently gives in ActionHandler and change it.
It's very basic, if you read it
It says that it will add item 995(Coins) I know you must be new to this, no offense.Code:c.getItems().addItem(995, npcThieving[j][3]);
Here is a tip that could possibly help you. This is theoretical, for instance test in game the thieving stall say you get 15 coins from the stall. You know that at that moment you do receive 15 coins from successfully thieving from that stall. Now there are many ways to approach this, for you I suggest an easy way. Look up the item id of coins(995) Now while in thieving.java press ctrl + f on your keyboard and search 995 skim through the codes until you find a familiar code to the in game experience. Now this is a slower process than being able to read the code for the most part. So, it may not be the fastest process; although it might work better off for yourself.
The stall method is not in Theiving.java im will look at Actionhandler when i get home. Thanks
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |