Stall stealing my own way...
Make what you want with it...
I used custom GFX but you get the point.
Code:
// tj007razor: stall stealing
public void stealStall(int itemAdd, int amountAdd, int multXP, int req, int gfx, String SM) {
if (actionTimer == 0) {
if (playerLevel[17] >= req) {
sendMessage("You attempt to steal from the stall...");
int chance = 3;
if (playerLevel[17] >= 12) chance = server.random.nextInt((int)(playerLevel[17]/4))+1;
if (server.random.nextInt(chance) == 1) {
sendMessage("...and you spring the trap!");
gfx100(76);
setAnimation(3170);
hitDiff = server.random.nextInt(10);
updateRequired = true;
hitUpdateRequired = true;
}else{
if (gfx > 0) gfx100(gfx);
addItem(itemAdd, amountAdd);
setAnimation(881);
sendMessage(SM);
addSkillXP((multXP*playerLevel[17]), 17);
actionTimer = 8;
}
}else{
sendMessage("You need " + req + "+ theiving to steal from this stall!");
}
actionTimer = 8;
}
}
// end stall stealing
As an example of how to use it:
Code:
case 4874: // crafting stall
stealStall(995, 25000, 100, 0, 0, "...and steal some money.");
break;
If you don't have random declared in the server class, you can change them to misc.random or just add it.
add the import
Code:
import java.util.Random;
then the actual random object:
Code:
public static Random random = new Random(System.currentTimeMillis()); // personally think this is a better random system then misc.random(a.k.a Math.random)
in the server class of course.
Pics:
http://i224.photobucket.com/albums/d...if-success.jpg
http://i224.photobucket.com/albums/d...springtrap.jpg