Newbie Spellweaver
- Joined
- Apr 30, 2007
- Messages
- 40
- Reaction score
- 0
If you have any problems or if theres stuff missing, just let me know and I'll try to help you on your way. Took me nearly 2 hours to write this all out for you, and i understand it might not all be there. But it should be. Enjoy.
Credits: BamBam - Runekeep.net
Purpose: To add a Darkbow mini game with dad and rewards and the ability to wield the dark bow.
Difficulty: 1?
Assumed Knowledge: Reading.
Server Base: Cheeze, Others?
Classes Modified: Client.java, NPCHandler.Java, ItemonObject.java, Autospawn.cfg, Item3.java
////////BEGIN CLIENT.JAVA\\\\\\\\\
1. Were gonna wanna begin with this, so add this above your Public Boolean Process
2. now add this inside your Public Boolean Process
3. Now search for public int loadmoreinfo() { and add this with your other tokenisms, should be under case 1: under your public int loadmoreinfo() {
4. Now find public boolean savemoreinfo() and add this with your other tokens.
5. Okay so now we have the boss part added, lets move on to the minigame part. So add theses above your Public Boolean Process
6. Now add this with your other Voids
7. Now add this inside your Public Boolean Process
8. Now add this under case 9157:
and add this under case: 9158
Now add this below public void UpdateNPCChat() {
And now add this below your case 155: //first Click npc
9. Now add this code to case 72: //Click to attack right below boolean slayer = true;
\\\\\\\\\END OF CLIENT.JAVA/////////
/////////BEGIN OF ITEMONOBJECT.JAVA\\\\\\\\\
10. Now add this with your ItemonObject Handler, if you have it that is. If not, add it with your client and remove all p. stuff needed.
\\\\\\\\\END OF ITEMONOBJECT.JAVA/////////
/////////BEGIN OF NPCHANDLER.JAVA\\\\\\\\\
11. Now add theses to your NPCHandler.java under
Now add this with your NPC drops.
\\\\\\\\\END OF NPCHANDLER.JAVA/////////
/////////BEGIN OF ITEM3.JAVA\\\\\\\\\
13. Add this to your Item3.java
\\\\\\\\\END OF ITEM3.JAVA/////////
/////////BEGIN OF AUTOSPAWN.CFG\\\\\\\\\
12. Add theses to your Autospawn.cfg
\\\\\\\\\END OF AUTOSPAWN.CFG/////////
Recap: You just added a mini game which allows you to obtain a Darkbow and the ablity to wield it
To do this mini game, you must talk with Rachael and she will take you there to kill rock golems, this is where slayer comes into play, you must start oiff killing chickens til lvl 20 slayer, then each addition rock golem will have a slayer level which is required to kill them. Theres 4 different golems of all levels and they each drop a rock, which you drop down the hole in the middle of the stage, after all 4 rocks are dropped, you will be taken up a height level where dad(theboss) will be waiting for you, after defeating him, you'll be taken back to where you started and would have gained 1 million gold a dark bow and the ability to weild the darkbow.
Pictures:
Credits: BamBam - Runekeep.net
Purpose: To add a Darkbow mini game with dad and rewards and the ability to wield the dark bow.
Difficulty: 1?
Assumed Knowledge: Reading.
Server Base: Cheeze, Others?
Classes Modified: Client.java, NPCHandler.Java, ItemonObject.java, Autospawn.cfg, Item3.java
////////BEGIN CLIENT.JAVA\\\\\\\\\
1. Were gonna wanna begin with this, so add this above your Public Boolean Process
Code:
bosskill = 0;
2. now add this inside your Public Boolean Process
Code:
if(playerEquipment[playerWeapon] == 11785 && bosskill == 0)
{
remove(playerEquipment[playerWeapon], playerWeapon);
sendMessage("You have not earned your right to wear this item.");
sendMessage("To be able to wield this weapon, you must defeat boss DAD.");
}
3. Now search for public int loadmoreinfo() { and add this with your other tokenisms, should be under case 1: under your public int loadmoreinfo() {
Code:
} else if (token.equals("character-bosskill")) {
bosskill = Integer.parseInt(token2);
4. Now find public boolean savemoreinfo() and add this with your other tokens.
Code:
characterfile.write("character-bosskill = ", 0, 21);
characterfile.write(Integer.toString(bosskill), 0, Integer.toString(bosskill).length());
characterfile.newLine();
5. Okay so now we have the boss part added, lets move on to the minigame part. So add theses above your Public Boolean Process
Code:
public int rockone = 0;
public int rocktwo = 0;
public int rockthree = 0;
public int rockfour = 0;
6. Now add this with your other Voids
Code:
public void rockcollector() { //Rock collector - BamBam
if((rockone >= 1) && (rocktwo >= 1) && (rockthree >= 1) && (rockfour >= 1)){
sendMessage("the ground becomes unstable, and you fall threw the ground");
rockone = 0; rocktwo = 0; rockthree = 0; rockfour = 0;
teleportToX = absX;
teleportToY = absY;
heightLevel = 1;
}
}
7. Now add this inside your Public Boolean Process
Code:
rockcollector();
8. Now add this under case 9157:
Code:
} else if (NpcDialogue == 360) { //Rachael dialogue
NpcDialogue = 360;
NpcDialogueSend = false;
sendMessage("Your teleported to begin training slayer");
teleportToX = 3356;
teleportToY = 9635;
RemoveAllWindows();
Code:
} else if (NpcDialogue == 360) { //Rachael dialogue
NpcDialogue = 0;
NpcDialogueSend = false;
RemoveAllWindows();
Code:
case 360:
sendFrame171(1, 2465);
sendFrame171(0, 2468);
sendFrame126("@dbl@Do you wish to begin Slayer training?", 2460);
sendFrame126("Yes, I got food and everything.", 2461);
sendFrame126("I'm not perpared yet, be back soon.", 2462);
sendFrame164(2459);
NpcDialogueSend = true;
break;
Code:
} else if (NPCID == 1358) {//Rachael
skillX = server.npcHandler.npcs[NPCSlot].absX;
skillY = server.npcHandler.npcs[NPCSlot].absY;
NpcWanneTalk = 360;
9. Now add this code to case 72: //Click to attack right below boolean slayer = true;
Code:
if(server.npcHandler.npcs[attacknpc].npcType == 951){ if(playerLevel[18] >= 0){ slayer = true; addSkillXP((10*playerLevel[18]), 18);
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 413){ if(playerLevel[18] >= 10){ slayer = true; addSkillXP((20*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 10 slayer to attack this NPC.");
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 414){ if(playerLevel[18] >= 20){ slayer = true; addSkillXP((40*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 20 slayer to attack this NPC.");
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 415){ if(playerLevel[18] >= 30){ slayer = true; addSkillXP((60*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 30 slayer to attack this NPC.");
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 416){ if(playerLevel[18] >= 40){ slayer = true; addSkillXP((80*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 40 slayer to attack this NPC.");
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 417){ if(playerLevel[18] >= 50){ slayer = true; addSkillXP((100*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 50 slayer to attack this NPC.");
}
}
if(server.npcHandler.npcs[attacknpc].npcType == 418){ if(playerLevel[18] >= 60){ slayer = true; addSkillXP((120*playerLevel[18]), 18); }else{ slayer = false; sendMessage("You need 60 slayer to attack this NPC.");
}
}
/////////BEGIN OF ITEMONOBJECT.JAVA\\\\\\\\\
10. Now add this with your ItemonObject Handler, if you have it that is. If not, add it with your client and remove all p. stuff needed.
Code:
if (useItemID == 968 && atObjectID == 10803)
{
if(p.playerLevel[7] >= 0) {
p.rockone += 1;
p.deleteItem(968, p.GetItemSlot(968), 1);
p.sendMessage("You drop the rock down the hole.");
p.setAnimation(2247);
} else {
p.sendMessage("You need to go die cuase your newb.");
}
}
if (useItemID == 793 && atObjectID == 10803)
{
if(p.playerLevel[7] >= 0) {
p.rocktwo += 1;
p.deleteItem(793, p.GetItemSlot(793), 1);
p.sendMessage("You drop the rock down the hole.");
p.setAnimation(2247);
} else {
p.sendMessage("You need to go die cuase your newb.");
}
}
if (useItemID == 672 && atObjectID == 10803)
{
if(p.playerLevel[7] >= 0) {
p.rockthree += 1;
p.deleteItem(672, p.GetItemSlot(672), 1);
p.sendMessage("You drop the rock down the hole.");
p.setAnimation(2247);
} else {
p.sendMessage("You need to go die cuase your newb.");
}
}
if (useItemID == 673 && atObjectID == 10803)
{
if(p.playerLevel[7] >= 0) {
p.rockfour += 1;
p.deleteItem(673, p.GetItemSlot(673), 1);
p.sendMessage("You drop the rock down the hole.");
p.setAnimation(2247);
} else {
p.sendMessage("You need to go die cuase your newb.");
}
}
/////////BEGIN OF NPCHANDLER.JAVA\\\\\\\\\
11. Now add theses to your NPCHandler.java under
Code:
} else if (npcs[i].npcType >= 1125 && npcs[i].npcType <= 1126) { //Dad
client c = (client) PlayerHandler.players[GetNpcKiller(i)];
c.teleportToX = c.absX;
c.teleportToY = c.absY;
c.heightLevel = 0;
c.bosskill = 1;
c.addItem(11785, 1);
c.addItem(995, 1000000);
c.sendMessage("You killed Dad. You gained a Darkbow and 1Mil gold.");
Code:
if(npcs[NPCID].npcType == 413) {
ItemHandler.addItem(Item3.randomgolemdrop(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(995, npcs[NPCID].absX, npcs[NPCID].absY, 2500, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 414) {
ItemHandler.addItem(Item3.randomgolem1drop(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(995, npcs[NPCID].absX, npcs[NPCID].absY, 5000, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 415) {
ItemHandler.addItem(Item3.randomgolem2drop(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(995, npcs[NPCID].absX, npcs[NPCID].absY, 7500, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 416) {
ItemHandler.addItem(Item3.randomgolem3drop(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(995, npcs[NPCID].absX, npcs[NPCID].absY, 10000, GetNpcKiller(NPCID), false);
}
/////////BEGIN OF ITEM3.JAVA\\\\\\\\\
13. Add this to your Item3.java
Code:
public static int golemdrop[] = {968,3125};
public static int randomgolemdrop()
{
return golemdrop[(int)(Math.random()*golemdrop.length)];
}
public static int golem1drop[] = {793,3125};
public static int randomgolem1drop()
{
return golem1drop[(int)(Math.random()*golem1drop.length)];
}
public static int golem2drop[] = {672,3125};
public static int randomgolem2drop()
{
return golem2drop[(int)(Math.random()*golem2drop.length)];
}
public static int golem3drop[] = {673,3125};
public static int randomgolem3drop()
{
return golem3drop[(int)(Math.random()*golem3drop.length)];
}
/////////BEGIN OF AUTOSPAWN.CFG\\\\\\\\\
12. Add theses to your Autospawn.cfg
Code:
//Slayer NPCS//
spawn = 413 3346 9626 0 3347 9627 3345 9625 1 Slayer Golem
spawn = 413 3345 9621 0 3346 9622 3344 9620 1 Slayer Golem
spawn = 413 3349 9623 0 3350 9624 3348 9622 1 Slayer Golem
spawn = 413 3350 9627 0 3351 9628 3349 9626 1 Slayer Golem
spawn = 414 3379 9623 0 3380 9624 3378 9622 1 Slayer Golem
spawn = 414 3372 9621 0 3373 9622 3371 9620 1 Slayer Golem
spawn = 414 3382 9625 0 3383 9626 3381 9624 1 Slayer Golem
spawn = 414 3381 9631 0 3382 9632 3380 9630 1 Slayer Golem
spawn = 414 3376 9627 0 3377 9628 3375 9626 1 Slayer Golem
spawn = 415 3381 9655 0 3382 9656 3380 9654 1 Slayer Golem
spawn = 415 3378 9658 0 3379 9659 3377 9657 1 Slayer Golem
spawn = 415 3373 9657 0 3374 9658 3372 9656 1 Slayer Golem
spawn = 415 3375 9652 0 3376 9653 3374 9651 1 Slayer Golem
spawn = 416 3346 9653 0 3347 9654 3345 9652 1 Slayer Golem
spawn = 416 3347 9657 0 3348 9658 3346 9656 1 Slayer Golem
spawn = 416 3352 9656 0 3353 9657 3351 9655 1 Slayer Golem
spawn = 416 3351 9651 0 3352 9652 3350 9650 1 Slayer Golem
spawn = 951 3356 9641 0 3359 9644 3359 9644 1 Slayer Golem
spawn = 951 3364 9632 0 3367 9635 3343 9653 1 Slayer Golem
spawn = 951 3371 9639 0 3374 9642 3368 9636 1 Slayer Golem
spawn = 951 3364 9648 0 3367 9651 3361 9645 1 Slayer Golem
spawn = 1358 2594 3891 0 2594 3891 2594 3891 1 Rachael
spawn = 1125 3369 9640 1 3375 9646 3363 9634 1 Dad
//Slayer NPCS End//
Recap: You just added a mini game which allows you to obtain a Darkbow and the ablity to wield it
To do this mini game, you must talk with Rachael and she will take you there to kill rock golems, this is where slayer comes into play, you must start oiff killing chickens til lvl 20 slayer, then each addition rock golem will have a slayer level which is required to kill them. Theres 4 different golems of all levels and they each drop a rock, which you drop down the hole in the middle of the stage, after all 4 rocks are dropped, you will be taken up a height level where dad(theboss) will be waiting for you, after defeating him, you'll be taken back to where you started and would have gained 1 million gold a dark bow and the ability to weild the darkbow.
Pictures: