Right, this is the 3rd time i've had to release this.
- First 1 Locked
- Second 1 Deleted
- Third 1 Survived?
Anywayz, Onto the base:
-----------------------------------------------------
Purpose: Thieving Base
Difficulty: 1-10
Tested On: Palidino76 Base.
-----------------------------------------------------
Ok, So first go into your Player.Java and search for:
Code:
public void appendToBanned(String player) {
Ok, Now above that add:
Code:
public void Thieving(Player p, int cashid, int lvlthief, int XPamt, int cashAmt) {
if (p.skillLvl[17] < lvlthief){
p.frames.sendMessage(p, "You need to be level " +lvlthief+ " Thieving for this.");
return;
}
p.clickDelay = 8;
p.frames.sendMessage(p, "You Thieve " +cashAmt+ "GP.");
Engine.playerItems.addItem(p, cashid, cashAmt);
p.addSkillXP(XPamt, 17);
p.requestAnim(881, 0);
}
So now the code should look something like this:
Code:
public void Thieving(Player p, int cashid, int lvlthief, int XPamt, int cashAmt) {
if (p.skillLvl[17] < lvlthief){
p.frames.sendMessage(p, "You need to be level " +lvlthief+ " Thieving for this.");
return;
}
p.clickDelay = 8;
p.frames.sendMessage(p, "You Thieve " +cashAmt+ "GP.");
Engine.playerItems.addItem(p, cashid, cashAmt);
p.addSkillXP(XPamt, 17);
p.requestAnim(881, 0);
}
public void appendToBanned(String player) {
Now I'll Explain what this void will do
Code:
public void Thieving(Player p, int cashid, int lvlthief, int XPamt, int cashAmt) {
This part is naming the Void and declaring the Ints the void will use being:-
Thieving
cashid
lvlthief
XPamt
cashAmt.
This is also the order for the Useage of the void going from Top to Bottem.
Code:
if (p.skillLvl[17] < lvlthief){
p.frames.sendMessage(p, "You need to be level " +lvlthief+ " Thieving for this.");
return;}
The If Statement is saying that if Skill Level 17 (Thieving) is less than int lvlthief send the message "You need to be blah blah" and then just Returns the code.
Code:
p.clickDelay = 8;
p.frames.sendMessage(p, "You Thieve " +cashAmt+ "GP.");
Engine.playerItems.addItem(p, cashid, cashAmt);
p.addSkillXP(XPamt, 17);
p.requestAnim(881, 0);
Well, this part is pretty much explains itself.
clickDelay = 8; is the time the person has to wait before thieving again.
sendMessage just sends the message "You Thieve " +cashAmt+ "GP."); +cashAmt+ being the int you decared in the void.
playeritems.addItem is telling the void what Item to add when you Thieve.
p.addSkillXP(XPamt, 17);
p.requestAnim(881, 0); are self explainetary.
Well, now thats done continue to Step 2:
STEP 2:
Go to your ObjectOption2 and search for:
You should see something like:
Code:
case 2214:
p.openBank();
break;
Under the 'break;' leave 1 clear line and add:
Code:
/**
*Thieving By 00o0o0oo0
*Format: ItemID || Level || EXP || Amount
**/
case 34384: //bake stall
p.Thieving(p, 995, 1, 200, 10000);
break;
case 34383: //silk stall
p.Thieving(p, 995, 20, 400, 30000);
break;
case 34387: //Fur stall
p.Thieving(p, 995, 35, 500, 45000);
break;
case 34382: //silver stall
p.Thieving(p, 995, 50, 600, 60000);
break;
case 34386: //spice stall
p.Thieving(p, 995, 65, 800, 100000);
break;
case 34385: //Gem stall
p.Thieving(p, 995, 75, 1000, 150000);
break;
/**
*End of Thieving
**/
If you would like to change the Item from cash change the numbers in the code above from
to any other Item ID and also the last number (taking Gem Stall for Example) from
to something else, depending on how much of the item you want them to get.
--------------------------------------------------
Credits:
Me
DragonKK for helping me learn to use Voids! , Thanks Dude!
--------------------------------------------------
Please, If you see any problems tell me and i'll try and fix it up. Also please take into consideration that i'm still a new coder and maybe with help from you lot like
DragonKK
Pop me some Java
I'll get better shortly.
Thanks,
Andy.
--------------------------------------------------
POST ERRORS YOU MAY GET AND I'LL LOOK AT IT AND TRY HELP!
--------------------------------------------------
Also forgot to say that this can also be used for Pickpocketing aswell. You'd do it in the same way except using NPCSpawn.cfg and NPCOption2.java
You'd use the same useage:
Code:
case ###: //Name
p.Thieving(p, ItemID, Level, EXP, Amt);[
break;
To get the case of the NPC first Spawn it Via the NPCSpawn.cfg and then go to the place where you've spawned it. Then rightclick and click "Pickpocket" and something should come up in your Run.bat CMD (the black box that appears when you click Run.bat) saying something like:
Code:
unhandled NPCOption 1 ###
### being the number. This number is the case code.
EXAMPLE:
The black box says
Code:
unhandled NPCOption 1 198
The useage would then be:
Code:
case 198: //Name
p.Thieving(p, ItemID, Level, EXP, Amt);
break;
Thanks for reading and Hope it helped.