Nathan
June 18th, 2010, 03:16
kk this is my barrows i edited.. not going to give u the arrow pointing, work it out urself...
credits: pffscape , Me
Step 1. add all these in Player class
public int killcount = 0;
public int DharokSpawned = 0;
public int VeracSpawned = 0;
public int AhrimSpawned = 0;
public int ToragSpawned = 0;
public int GuthanSpawned = 0;
public int KarilSpawned = 0;
public void sendBarrowsInterface() {
getActionSender().setString(this, "Kill Count : " + killcount, 24, 0);
getActionSender().setOverlay(this, 24);
}
public static int barrowsItems[] = {4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726,
4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759};
public static int getBarrowsReward() {
return barrowsItems[(int) (Math.random() * barrowsItems.length)];
}
Step 2. in engine class add these
/**
* barrows hill 1 - Guthan
*/
public static boolean guthanhillArea(int absX, int absY) {
return (absX >= 3574 && absX <= 3581 && absY >= 3279 && absY <= 3285);
}
/**
* barrows hill 2 - Karil
*/
public static boolean karilhillArea(int absX, int absY) {
return (absX >= 3562 && absX <= 3569 && absY >= 3272 && absY <= 3278);
}
/**
* barrows hill 3 - Dharok
*/
public static boolean dharokhillArea(int absX, int absY) {
return (absX >= 3572 && absX <= 3578 && absY >= 3295 && absY <= 3301);
}
/**
* barrows hill 4 - Ahrim
*/
public static boolean ahrimhillArea(int absX, int absY) {
return (absX >= 3563 && absX <= 3569 && absY >= 3285 && absY <= 3292);
}
/**
* barrows hill 5 - Torag
*/
public static boolean toraghillArea(int absX, int absY) {
return (absX >= 3550 && absX <= 3556 && absY >= 3279 && absY <= 3285);
}
/**
* barrows hill 6 - Verac
*/
public static boolean verachillArea(int absX, int absY) {
return (absX >= 3553 && absX <= 3560 && absY >= 3294 && absY <= 3301);
}
Step 3: add this in objectoption1
case 6707://verac
p.setCoords(3557, 3299, 0);
break;
case 6706://torag
p.setCoords(3554, 3283, 0);
break;
case 6705://karil
p.setCoords(3566, 3276, 0);
break;
case 6704://guthan
p.setCoords(3577, 3283, 0);
break;
case 6703://dharok
p.setCoords(3575, 3298, 0);
break;
case 6702://ahrim
p.setCoords(3565, 3289, 0);
break;
//End of barrows stairs
//Start of barrows
case 6771://Dharok
if (p.DharokSpawned == 0) {
p.getActionSender().sendMessage(p, "Dharok appears out of the coffin!");
Server.engine.newNPC(2026, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.DharokSpawned = 1;
} else if (p.DharokSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Dharok spawned, so there is no need to spawn another.");
}
break;
case 6821://ahrim
if (p.AhrimSpawned == 0) {
p.getActionSender().sendMessage(p, "Ahrim appears out of the coffin!");
Server.engine.newNPC(2025, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.AhrimSpawned = 1;
} else if (p.AhrimSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Ahrim spawned, so there is no need to spawn another.");
}
break;
case 6772://torag
if (p.ToragSpawned == 0) {
p.getActionSender().sendMessage(p, "Torag appears out of the coffin!");
Server.engine.newNPC(2029, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.ToragSpawned = 1;
} else if (p.ToragSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Torag spawned, so there is no need to spawn another.");
}
break;
case 6822://karil
if (p.KarilSpawned == 0) {
p.getActionSender().sendMessage(p, "Karil appears out of the coffin!");
Server.engine.newNPC(2028, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.KarilSpawned = 1;
} else if (p.KarilSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Karil spawned, so there is no need to spawn another.");
}
break;
case 6773://guthan
if (p.GuthanSpawned == 0) {
p.getActionSender().sendMessage(p, "Guthan appears out of the coffin!");
Server.engine.newNPC(2027, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.GuthanSpawned = 1;
} else if (p.GuthanSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Guthan spawned, so there is no need to spawn another.");
}
break;
case 6823://verac
if (p.VeracSpawned == 0) {
p.getActionSender().sendMessage(p, "Verac appears out of the coffin!");
Server.engine.newNPC(2030,p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.VeracSpawned = 1;
} else if (p.VeracSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Verac spawned, so there is no need to spawn another.");
}
break;
case 10284: //chest
if (p.killcount == 6) {
p.message("You open the chest...");
p.requestAnim(2246, 0);
int reward = p.getBarrowsReward();
Engine.playerItems.addItem(p, reward, 1);
p.message("...and find a " + Engine.items.getItemName(reward) + "!");
p.setCoords(3563, 3285, 0);
p.killcount = 0;
p.getActionSender().removeOverlay(p);
p.VeracSpawned = 0;
p.GuthanSpawned = 0;
p.KarilSpawned = 0;
p.ToragSpawned = 0;
p.DharokSpawned = 0;
p.AhrimSpawned = 0;
} else if (p.killcount > 6) {
p.getActionSender().sendMessage(p, "Kill all the brothers first");
}
break;
//End of barrows
step 4: add this in NPC.java
if (npcType == 2025 || npcType == 2030 || npcType == 2027 || npcType == 2028 || npcType == 2029 || npcType == 2026) {
// Barrow
p.killcount++;
if (p.killcount == 6) {
p.setCoords(3551, 9691, 0);
p.message("You can now open the chest.");
}
p.sendBarrowsInterface();
}
And last but not least in itemselect.java add this
case 952:
if (Server.engine.dharokhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3556, 9718, 3);
}
else if (Server.engine.ahrimhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3557, 9703, 3);
}
else if (Server.engine.toraghillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3568, 9683, 3);
}
else if (Server.engine.guthanhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3534, 9704, 3);
}
else if (Server.engine.verachillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3578, 9706, 3);
}
if (Server.engine.karilhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3546, 9684, 3);
} else {
p.requestAnim(830, 0);
p.getActionSender().sendMessage(p, "There is nothing to dig here....");
}
break;
last but not least. saving the killcount. for all ppl who save thier filemanafer in filemanager.java add this
stream.writeString("killcount: " +p.killcount);
and for loading add this
else if (line.startsWith("barrowkc: "))
p.barrowkc = Integer.parseInt(line.substring(10));
this is for people who save thier filemanager in player.java
bufferedwriter.write("killcount:", 0, 10);
bufferedwriter.write(Integer.toString(killcount), 0, Integer.toString(killcount).length());
bufferedwriter.newLine();
and saving
else if (s2.equals("killcount"))
killcount = Integer.parseInt(s4);
else if (s2.equals("AhrimSpawned"))
post any erros here and i will help u.
if u want saving killcount im sure u will be able to add it.
ur done <3
credits: pffscape , Me
Step 1. add all these in Player class
public int killcount = 0;
public int DharokSpawned = 0;
public int VeracSpawned = 0;
public int AhrimSpawned = 0;
public int ToragSpawned = 0;
public int GuthanSpawned = 0;
public int KarilSpawned = 0;
public void sendBarrowsInterface() {
getActionSender().setString(this, "Kill Count : " + killcount, 24, 0);
getActionSender().setOverlay(this, 24);
}
public static int barrowsItems[] = {4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726,
4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759};
public static int getBarrowsReward() {
return barrowsItems[(int) (Math.random() * barrowsItems.length)];
}
Step 2. in engine class add these
/**
* barrows hill 1 - Guthan
*/
public static boolean guthanhillArea(int absX, int absY) {
return (absX >= 3574 && absX <= 3581 && absY >= 3279 && absY <= 3285);
}
/**
* barrows hill 2 - Karil
*/
public static boolean karilhillArea(int absX, int absY) {
return (absX >= 3562 && absX <= 3569 && absY >= 3272 && absY <= 3278);
}
/**
* barrows hill 3 - Dharok
*/
public static boolean dharokhillArea(int absX, int absY) {
return (absX >= 3572 && absX <= 3578 && absY >= 3295 && absY <= 3301);
}
/**
* barrows hill 4 - Ahrim
*/
public static boolean ahrimhillArea(int absX, int absY) {
return (absX >= 3563 && absX <= 3569 && absY >= 3285 && absY <= 3292);
}
/**
* barrows hill 5 - Torag
*/
public static boolean toraghillArea(int absX, int absY) {
return (absX >= 3550 && absX <= 3556 && absY >= 3279 && absY <= 3285);
}
/**
* barrows hill 6 - Verac
*/
public static boolean verachillArea(int absX, int absY) {
return (absX >= 3553 && absX <= 3560 && absY >= 3294 && absY <= 3301);
}
Step 3: add this in objectoption1
case 6707://verac
p.setCoords(3557, 3299, 0);
break;
case 6706://torag
p.setCoords(3554, 3283, 0);
break;
case 6705://karil
p.setCoords(3566, 3276, 0);
break;
case 6704://guthan
p.setCoords(3577, 3283, 0);
break;
case 6703://dharok
p.setCoords(3575, 3298, 0);
break;
case 6702://ahrim
p.setCoords(3565, 3289, 0);
break;
//End of barrows stairs
//Start of barrows
case 6771://Dharok
if (p.DharokSpawned == 0) {
p.getActionSender().sendMessage(p, "Dharok appears out of the coffin!");
Server.engine.newNPC(2026, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.DharokSpawned = 1;
} else if (p.DharokSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Dharok spawned, so there is no need to spawn another.");
}
break;
case 6821://ahrim
if (p.AhrimSpawned == 0) {
p.getActionSender().sendMessage(p, "Ahrim appears out of the coffin!");
Server.engine.newNPC(2025, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.AhrimSpawned = 1;
} else if (p.AhrimSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Ahrim spawned, so there is no need to spawn another.");
}
break;
case 6772://torag
if (p.ToragSpawned == 0) {
p.getActionSender().sendMessage(p, "Torag appears out of the coffin!");
Server.engine.newNPC(2029, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.ToragSpawned = 1;
} else if (p.ToragSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Torag spawned, so there is no need to spawn another.");
}
break;
case 6822://karil
if (p.KarilSpawned == 0) {
p.getActionSender().sendMessage(p, "Karil appears out of the coffin!");
Server.engine.newNPC(2028, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.KarilSpawned = 1;
} else if (p.KarilSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Karil spawned, so there is no need to spawn another.");
}
break;
case 6773://guthan
if (p.GuthanSpawned == 0) {
p.getActionSender().sendMessage(p, "Guthan appears out of the coffin!");
Server.engine.newNPC(2027, p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.GuthanSpawned = 1;
} else if (p.GuthanSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Guthan spawned, so there is no need to spawn another.");
}
break;
case 6823://verac
if (p.VeracSpawned == 0) {
p.getActionSender().sendMessage(p, "Verac appears out of the coffin!");
Server.engine.newNPC(2030,p.absX+1, p.absY, p.heightLevel, 0, 0, 0, 0, false, p.playerId);
p.sendBarrowsInterface();
p.VeracSpawned = 1;
} else if (p.VeracSpawned == 1) {
p.getActionSender().sendMessage(p, "You already have Verac spawned, so there is no need to spawn another.");
}
break;
case 10284: //chest
if (p.killcount == 6) {
p.message("You open the chest...");
p.requestAnim(2246, 0);
int reward = p.getBarrowsReward();
Engine.playerItems.addItem(p, reward, 1);
p.message("...and find a " + Engine.items.getItemName(reward) + "!");
p.setCoords(3563, 3285, 0);
p.killcount = 0;
p.getActionSender().removeOverlay(p);
p.VeracSpawned = 0;
p.GuthanSpawned = 0;
p.KarilSpawned = 0;
p.ToragSpawned = 0;
p.DharokSpawned = 0;
p.AhrimSpawned = 0;
} else if (p.killcount > 6) {
p.getActionSender().sendMessage(p, "Kill all the brothers first");
}
break;
//End of barrows
step 4: add this in NPC.java
if (npcType == 2025 || npcType == 2030 || npcType == 2027 || npcType == 2028 || npcType == 2029 || npcType == 2026) {
// Barrow
p.killcount++;
if (p.killcount == 6) {
p.setCoords(3551, 9691, 0);
p.message("You can now open the chest.");
}
p.sendBarrowsInterface();
}
And last but not least in itemselect.java add this
case 952:
if (Server.engine.dharokhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3556, 9718, 3);
}
else if (Server.engine.ahrimhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3557, 9703, 3);
}
else if (Server.engine.toraghillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3568, 9683, 3);
}
else if (Server.engine.guthanhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3534, 9704, 3);
}
else if (Server.engine.verachillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3578, 9706, 3);
}
if (Server.engine.karilhillArea(p.absX, p.absY)) {
p.requestAnim(830, 0);
p.setCoords(3546, 9684, 3);
} else {
p.requestAnim(830, 0);
p.getActionSender().sendMessage(p, "There is nothing to dig here....");
}
break;
last but not least. saving the killcount. for all ppl who save thier filemanafer in filemanager.java add this
stream.writeString("killcount: " +p.killcount);
and for loading add this
else if (line.startsWith("barrowkc: "))
p.barrowkc = Integer.parseInt(line.substring(10));
this is for people who save thier filemanager in player.java
bufferedwriter.write("killcount:", 0, 10);
bufferedwriter.write(Integer.toString(killcount), 0, Integer.toString(killcount).length());
bufferedwriter.newLine();
and saving
else if (s2.equals("killcount"))
killcount = Integer.parseInt(s4);
else if (s2.equals("AhrimSpawned"))
post any erros here and i will help u.
if u want saving killcount im sure u will be able to add it.
ur done <3