make a new file in the skills folder named Hunter.java and add all of this in it
Code:
package server.model.players.skills;
import server.model.players.Client;
import server.Config;
import server.util.Misc;
public class Hunter {
Client c;
public Hunter(Client c) {
this.c = c;
}
public void CatchImpling(String npcName, int Net, int npcId, int itemId, int AmtExp, int Req, int playerId) {
//npcName = Server.npcHandler.getNpcListName(npcId);
if (System.currentTimeMillis() - c.foodDelay >= 1500) {
if (c.playerLevel[21] >= Req) {
if (HasNet()) {
if (c.getItems().playerHasItem(11260,1)){
HandleCatch(itemId, AmtExp, Req, "Impling");
}else{
c.sendMessage("you need a impling jar to catch this");
return;
}
} else {
c.sendMessage("You need to equip a butterfly net!");
return;
}
} else {
c.sendMessage("You need atleast "+ Req +" Hunter To catch that Impling!");
return;
}
c.foodDelay = System.currentTimeMillis();
}
}
public void CatchButterfly(String npcName, int Net, int npcId, int itemId, int AmtExp, int Req, int playerId) {
//npcName = Server.npcHandler.getNpcListName(npcId);
if (System.currentTimeMillis() - c.foodDelay > 1500) { //anti spamm
if (c.playerLevel[21] >= Req) { //first we check if he's high enough to catch
if (HasNet()) {
HandleCatch(itemId, AmtExp, Req, "Butterfly");
} else {
c.sendMessage("You need to be wearing a butterfly net!");
return;
}
} else {
c.sendMessage("You need at least "+ Req +" Hunter To catch that Butterfly!");
return;
}
c.foodDelay = System.currentTimeMillis();
}
}
public void HandleCatch(int ID, int XP,int Req, String Name) {
if (c.playerLevel[21] + Misc.random(10) > Misc.random(20) + Req) {
c.sendMessage("You Cought a"+ Name +"!");
c.getItems().addItem(ID, 1);
c.startAnimation(6999);
c.getPA().addSkillXP(XP, 21);
} else {
c.sendMessage("You Failed To Catch The "+Name+".");
c.startAnimation(6999);
}
}
public boolean HasNet(){
if (c.playerEquipment[c.playerWeapon] == 10010 || c.playerEquipment[c.playerWeapon] == 11259){
return true;
}else{
return false;
}
}
public void RefreshRabbits() {
c.getPA().object(19337, 2257, 3336, 0, 10);
c.getPA().object(19337, 2261, 3334, 1, 10);
}
public void giveRabbit() {
if (Misc.random(10) < 3){
if (Misc.random(25) == 1){
c.getItems().addItem(10132, 1);
}else{
c.getItems().addItem(3226, 1);
}
}else{
c.sendMessage("you fail to catch the rabbit.");
}
}
}
now open client.java
look for catchnpc and catchhunternpc
remove both of those methods
now look for this
Code:
private Crafting crafting = new Crafting(this);
then add this under it
Code:
private Hunter hunter = new Hunter(this);
now still in client look for
Code:
public Crafting getCrafting()
and then add this under that
Code:
public Hunter getHunter() {
return hunter;
}
now go to auctionhandler and find the hunter npcs and change the beginning of the imps to this
Code:
c.gethunter().CatchImpling
and change the beginning of the butterfly to this
Code:
c.gethunter().CatchButterfly
they should look like this
Code:
c.gethunter().CatchImpling("Dragon Impling", 10010, 6064, 11256, 25000, 90, c.playerId);
c.gethunter().CatchButterfly("Black Warlock", 10010, 5082, 10014, 18000, 85, c.playerId);
and last for now add this under object first click in actionhandler
Code:
case 19337:
int X = c.objectX;
int Y = c.objectY;
c.getPA().object(-1, X, Y, 0, 10);
c.rabbitNeedSpawn = true;
c.rabbitTimer = 15;
c.getPA().addSkillXP(1500, 21);
c.getPA().object(19338, X, Y, 0, 10);
c.sendMessage("you flush the rabbit out the hole and find a rabbit");
c.gethunter().giveRabbit();
break;
now add this in your client.java at the top near all the other int's
Code:
public boolean rabbitNeedSpawn = false;
public int rabbitTimer = 0;
then add this in the client.java process
Code:
if (rabbitNeedSpawn == true && rabbitTimer <= 0){
RefreshRabbits();
}else{
rabbitTimer -- ;
}
add this anywhere in client.java
Code:
public void RefreshRabbits() {
getPA().object(19337, 2257, 3336, 0, 10);
getPA().object(19337, 2261, 3334, 1, 10);
}
public void giveRabbit() {
if (Misc.random(10) <= 2){
if (Misc.random(25) == 1){
getItems().addItem(10132, 1);
}else{
getItems().addItem(3226, 1);
}
}else{
sendMessage("you fail to catch the rabbit.");
}
http://www.rune-server.org/runescape...0-done-pi.html