PDA

View Full Version : z508/525 Barrows z508/525



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

Nathan'
June 18th, 2010, 03:32
Cheers for posting this dude.

Off topic - Nice name

Nathan
June 18th, 2010, 03:33
Cheers for posting this dude.

Off topic - Nice name

lol np. some1 give me the digging and stuff. i added rest

Faab234
June 18th, 2010, 07:03
Ok, Nice job.

Nathan'
June 18th, 2010, 07:04
Just got to get the kill count working now.

Aaron
June 18th, 2010, 07:05
Nice Job on this.

owner lorenzo
June 18th, 2010, 11:30
Can i have credits its "pffscape" i added this before data crash
Great work with the chest i was adding it in my v2
Btw ur barrow KC wont save in player file

Break
June 18th, 2010, 11:54
Great guide, Give credits.

Kih
June 18th, 2010, 13:00
Compiling now...
.\net\com\codeusa\npcs\NPC.java:335: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.killcount++;
^
.\net\com\codeusa\npcs\NPC.java:336: cannot find symbol
symbol : variable killcount
location: class net.com.codeusa.npcs.NPC
if (killcount == 6) {
^
.\net\com\codeusa\npcs\NPC.java:337: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.setCoords(3551, 9691, 0);
^
.\net\com\codeusa\npcs\NPC.java:338: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.message("You can now open the chest.");
^
.\net\com\codeusa\npcs\NPC.java:340: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.sendBarrowsInterface();
^
5 errors
Druk op een toets om door te gaan. . .

5 errors, fixed the other 27 :-)

Nathan
June 18th, 2010, 13:14
Compiling now...
.\net\com\codeusa\npcs\NPC.java:335: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.killcount++;
^
.\net\com\codeusa\npcs\NPC.java:336: cannot find symbol
symbol : variable killcount
location: class net.com.codeusa.npcs.NPC
if (killcount == 6) {
^
.\net\com\codeusa\npcs\NPC.java:337: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.setCoords(3551, 9691, 0);
^
.\net\com\codeusa\npcs\NPC.java:338: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.message("You can now open the chest.");
^
.\net\com\codeusa\npcs\NPC.java:340: cannot find symbol
symbol : variable p
location: class net.com.codeusa.npcs.NPC
p.sendBarrowsInterface();
^
5 errors
Druk op een toets om door te gaan. . .

5 errors, fixed the other 27 :-)


for the p error. try player. for killcount. declare it in player.java

Break
June 18th, 2010, 13:22
for the p error. try player. for killcount. declare it in player.java

Sorry, worng.
Change all p into player.
Example:

p.sendBarrowsInterface();
Into:

player.sendBarrowsInterface();.

Nathan
June 18th, 2010, 15:10
Sorry, worng.
Change all p into player.
Example:

p.sendBarrowsInterface();
Into:

player.sendBarrowsInterface();.

well i dont know what base hes using...

jamie
June 19th, 2010, 05:19
Cheers. good TuT

Nathan
June 20th, 2010, 13:10
Cheers. good TuT

thanks ;)

Kih
June 22nd, 2010, 09:12
Compiling now...
.\net\com\codeusa\npcs\NPC.java:335: cannot find symbol
symbol : variable player
location: class net.com.codeusa.npcs.NPC
player.killcount++;
^
.\net\com\codeusa\npcs\NPC.java:336: cannot find symbol
symbol : variable player
location: class net.com.codeusa.npcs.NPC
if (player.killcount == 6) {
^
.\net\com\codeusa\npcs\NPC.java:337: cannot find symbol
symbol : variable player
location: class net.com.codeusa.npcs.NPC
player.setCoords(3551, 9691, 0);
^
.\net\com\codeusa\npcs\NPC.java:338: cannot find symbol
symbol : variable player
location: class net.com.codeusa.npcs.NPC
player.message("You can now open the chest.");
^
.\net\com\codeusa\npcs\NPC.java:340: cannot find symbol
symbol : variable player
location: class net.com.codeusa.npcs.NPC
player.sendBarrowsInterface();
^
5 errors

Using Codeusa (508/525) Declared killcount in player.java. Still this error popping up.

Nathan
June 22nd, 2010, 14:00
kk fixed now. missed something out. should work. i deleted all mine and added tut with no errors.

owner lorenzo
June 22nd, 2010, 15:04
Btw my name Was pffscape without the "t" xD u can post my name now if u can

Perfection
June 22nd, 2010, 15:05
Cool, But barrows on a z508/z525 isn't very nice :(

phil
June 22nd, 2010, 15:09
Well done on this hope it goes well..

phil
June 22nd, 2010, 15:10
Btw my name Was pffscape without the "t" xD u can post my name now if u can

Lol you think .. go to generation x and youll see barrows isn't that bad

Nathan
June 22nd, 2010, 15:11
probs make 1 file called barrows.java. and use arrays. idk yet.

owner lorenzo
June 22nd, 2010, 17:27
Lol you think .. go to generation x and youll see barrows isn't that bad
Lol im real Pffscape what ever if u dont belive me ..

u back 4 m0r
March 16th, 2011, 23:26
Bro I added this a long time back and it worked, but out of no where it just started crashing the whole server after one person kills one of the barrows brothers please help.

MonarchX
April 24th, 2011, 02:42
Nice!