Purpose : To add crystal chest which gives you rare items.
Difficulty : 2
Assumed Knowledge : Ctrl+v & c & f & G
Server Base : Druton v2, should work on all sources.
( [Only registered and activated users can see links. ] )
Classes Modified : Client.java, Item.cfg, Autospawn.cfg, Shops.cfg, Item2.java & if you have, Commandhandler.java
Procedure
Step 1 : Making Chest give items:
Open up Item2.java
You will see code:
Code:
import java.io.*;
public class Item2
{
after that add:
Code:
public static int test[] = {1,1,1,1048,1046,1044,1042,1040,1038,1050,1050,1053,1053,1055,1055,1057,6914,6914,6914,6916,6916,6916,6918,6918,6918,6920,6920,6920,6922,6922,6922,6924,6924,6924};
public static int randomtest()
{
return test[(int)(Math.random()*test.length)];
}
You can edit that int if you want, thats what items the chest gives.
Now open Client.java and search for Grind.
You should see this:
Code:
else if(useItemID == 4834 && atObjectID == 5284) // Bone grinding
{
sendMessage("You grind the "+GetItemName(4834)+" and recieve prayer xp.");
addSkillXP((240*playerLevel[5]), 5);
deleteItem(4834,getItemSlot(4834), 1);
}
Below or above add this:
Code:
else if(atObjectID == 172 && useItemID == 989) {
deleteItem(989,getItemSlot(989), 1);
addItem(Item2.randomtest(), 1);
}
Now the crystal chest in taverlry will give random items from int "test"
when you use crystal key on it.
Step 2 : Adding teleport command to chest:
Open up Client.java or in my case Commandhandler.java
Search for any command Eg:
Code:
if (command.startsWith("pickup") && (p.playerRights >= 2)) {
try {
int newItemID = Integer.parseInt(command.substring(7,12));
int newItemAmount = Integer.parseInt(command.substring(13));
if (newItemID <= 20000 && newItemID >= 0) {
p.addItem(newItemID, newItemAmount);
} else {
p.sendMessage("That Item Doesn't Exist");
}
} catch(Exception e) {
p.sendMessage("use five numbers, Eg. ::pickup 00995 1.");
}
}
Below, Or above add this:
Code:
if (command.startsWith("crystalchest")) {
p.teleportToX = 2914;
p.teleportToY = 3451;
}
now, when you type ::crystalchest it will teleport you to crystal chest.
Step 3 : Adding Key shop:
Open up client.java again
Search for Wanneshop and you should see something like this for example:
Code:
} else if (NPCID == 557) { //FOOD STORE
PutNPCCoords = true;
WanneShop = 1; //FOOD STORE
Below or above add:
Code:
} else if (NPCID == 1699) { //Key shop
PutNPCCoords = true;
WanneShop = 17; //Key Shop
NOTICE: if you already have wanneshop 17, replace it or use other shop id.
Open Shops.cfg and add this:
Code:
shop = 17 Stranger_Ghost's_Cheap_Keys 1 1 989 1000
If you want to make it so you cant sell anything just replace the second "1" with 2.
To add the shop, open Autospawn.cfg and add:
Code:
spawn = 1699 2914 3451 0 2914 3451 2912 3449 1 Ghost Shopkeeper
Now we have added the shop and shopkeeper, also we made it move lol
Step 4 : Final Touches:
this step is only for editing Item.cfg
Search for the crystal key (id:989)and replace it with:
Code:
item = 989 Crystal_key A_very_rare_and_mysterious_key. 4000000 4000000 5000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 990 Crystal_key Swap_this_note_at_any_bank_for_a_Crystal_key. 4000000 4000000 5000000 0 0 0 0 0 0 0 0 0 0 0 0
Search for Partyhats and replace all of them with:
Code:
item = 1038 Red_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1039 Red_partyhat Swap_this_note_at_any_bank_for_a_Red_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1040 Yellow_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1041 Yellow_partyhat Swap_this_note_at_any_bank_for_a_Yellow_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1042 Blue_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 40 40 40 40 40 40 40 40 40 40 40 0
item = 1043 Blue_partyhat Swap_this_note_at_any_bank_for_a_Blue_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1044 Green_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1045 Green_partyhat Swap_this_note_at_any_bank_for_a_Green_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1046 Purple_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1047 Purple_partyhat Swap_this_note_at_any_bank_for_a_Purple_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1048 White_partyhat A_nice_hat_from_a_cracker. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1049 White_partyhat Swap_this_note_at_any_bank_for_a_White_partyhat. 20000000 20000000 30000000 0 0 0 0 0 0 0 0 0 0 0 0
Now search for Santa and replace it with:
Code:
item = 1050 Santa_hat It's_a_Santa_hat. 6000000 6000000 8000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1051 Santa_hat Swap_this_note_at_any_bank_for_a_Santa_hat. 6000000 6000000 8000000 0 0 0 0 0 0 0 0 0 0 0 0
And the last but not the least Masks.
Replace all masks with:
Code:
item = 1053 Green_h'ween_mask Aaaarrrghhh_..._I'm_a_monster. 5000000 5000000 7000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1054 Green_h'ween_mask Swap_this_note_at_any_bank_for_a_Green_h'ween_mask. 5000000 5000000 7000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1055 Blue_h'ween_mask Aaaarrrghhh_..._I'm_a_monster. 5500000 5500000 7500000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1056 Blue_h'ween_mask Swap_this_note_at_any_bank_for_a_Blue_h'ween_mask. 5500000 5500000 7500000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1057 Red_h'ween_mask Aaaarrrghhh_..._I'm_a_monster. 6000000 6000000 8000000 0 0 0 0 0 0 0 0 0 0 0 0
item = 1058 Red_h'ween_mask Swap_this_note_at_any_bank_for_a_Red_h'ween_mask. 6000000 6000000 8000000 0 0 0 0 0 0 0 0 0 0 0 0
This step was only editing Item prices, if you want economical crystal chest you should finish this step.
Credits : yack me lol