Here I was bored, and thought you guys could use a base
, there is no anti-leech and don't say I didn't make this without proof and don't flame me please.
Code:
package core.skills;
import core.players.Player;
public class slayerClass {
private int task;
private int amount;
public int[][] appendData = {
{1, 200, 90}
};
public void proceedtoSlayer(Player p) {
if(!p.slayerTask) {
setTask(getRandomTasks(1));
setAmount(getRandomAmount());
p.frames.sendMessage(p, "You have just recevied a slayer task and it is " + task + ".");
p.frames.sendMessage(p, "You have to kill " + amount);
}
if(p.slayerTask) {
getFinishedTask(p);
}
resetSlayer(p);
}
private void getFinishedTask(Player p) {
if(amount < 1) {
p.frames.sendMessage(p, "You have finished your slayer task, please return to a Slayer Master ");
p.frames.sendMessage(p, "to get a new one.");
}
p.frames.sendMessage(p, "You have not completed your slayer task, please comeback when you have!");
}
private void resetSlayer(Player p) {
task = 0;
amount = 0;
p.slayerTask = false;
}
private int getRandomAmount() {
return appendData[(int)(Math.random() * (appendData.length))][0];
}
private int getRandomTasks(int range) {
return (int) (Math.random() * (range + 1));
}
public void setAmount(int amount) {
this.amount = amount;
}
public int getAmount() {
return amount;
}
public void setTask(int task) {
this.task = task;
}
public int getTask() {
return task;
}
}


