Derranged
June 22nd, 2010, 03:28
Hello, this thread will constantly be updated with way for a new coder to have a great 562 server.
Please do not flame about that some of this was taken from Rune-Serva cause I was the one who posted some of this onto there.
Part 1: How to customise your client.
Part 2: How to create commands.
Part 3: How to change the lumby tele in magic book work.
Part 4: How to add extra food eating.
Part 5: How to change the default in-game messages.
Part 6: How to add the genie lamp.
Part 7: How to make an object work.
Do not put in the " " onto any words I have.
Part One
How To Customise A Client
Open up your client and first search for "client".
It should show up as a .java file.
Open it and search:
Class131_Sub2_Sub7.aString5636 =
Now beside that there should be something like this:
Omg-Scape.no-ip.com
Change that to your no-ip or if you wish to play your server offline or on your own to edit use 127.0.0.1
Now once you have finished with that open up Applet_Sub1.java and search for:
Class158.aFrame2095.setTitle
Beside that should be something like this:
Treadly-scape [562]
Change that to the name of your server.
Now go back to the start of your client folder and click build.
Once it says its finished then you may run your server and play.
Part Two
How To Create Commands
First off open up your source.
Search for "Command" in the search box.
Now to create a command for the normal players. click the Commands.java
Now scroll down a bit and you'll start to see something like this:
if(cmd[0].equals("::hunt")) {
player.getActionSender().removeTab1();
if(player.SafeZone()) {
player.getTele().telePlayer(player, 2340, 3541, 0, 0);
} else if (Location.wildernessLevel(player.getLocation()) > 20) {
player.sm("you cannot teleport above 20 wilderness");
} else {
player.getTele().telePlayer(player, 2340, 3541, 0, 0);
}
Now that is a command which will teleport you to hunting.
If you wish to change the ::home command so it goes to your home place do CTRL + F and search for "::home"
Now a command should come up which should look like this.
if(cmd[0].equals("::home")) {
player.getActionSender().removeTab1();
if(player.SafeZone()) {
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
} else if (Location.wildernessLevel(player.getLocation()) > 20) {
player.sm("you cannot teleport above 20 wilderness");
} else {
player.getTele().telePlayer(player, 3161, 3634, 0, 2);
}
Now in both of the "player.getTele().telePlayer(player, 3161, 3634, 0, 2);"
You will want to only change the "3161, 3634" to your home coords which ingame can be found out by typing "coords" into the admin command box.
Now once change you may compile and save but this is not all to this.
If you wish to make a command which give a player items this is how you will need to set it out.
if (cmd[0].equals("::pots")) {
if (!player.SafeZone()) {
player.sm("You cant spawn items at wilderness/BountyHunter");
return;
}
player.getInventory().addItem(139, 1);
player.getInventory().addItem(2440, 1);
player.getInventory().addItem(2436, 1);
player.getInventory().addItem(2442, 1);
}
Now this commands gives you 4 pots. To change the pots you have to change the "139, 1" in the "player.getInventory().addItem(139, 1);"
The "139" is the item id and the "1" is the ammount.
You can remake this command into anything you want like this:
if (cmd[0].equals("::dh")) {
if (!player.SafeZone()) {
player.sm("You cant spawn items at wilderness/BountyHunter");
return;
}
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
}
Part Three
How to change the lumy tele in magic book to your home
Follow this link in your folder.
Src > Com > RS2HD > PacketHandler > ActionButtonPacketHandler
Search for:
case 24:
It should look something like this:
case 24:
//player.homeTele = 18;
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
break;
Change the two 4 digit numbers which are shown in mine as " 3161 and 9634 " to your homes code.
Now under that are some other ones which look like that.
The first one is Varrock.
The next is Lumby.
The next is Fally.
The next is Cammy.
And the next is Ardougne.
Now if you wish to, you may add a message when you tele by adding player.sm("insert message here");
Like this.
case 24:
//player.homeTele = 18;
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
player.sm("You teleport home.");
break;
Part 4
How to add extra food eating
Follow this link in your folder.
Data > Scripts > Food
Now once you scroll to the bottom there should be this.
# sea turtle:
def item_select_397(player, slot):
eat(player, 397, slot, 21)
Now, both of the "397" numbers are the item's id and the "21" is how much health it gives you.
Now leave a gap and write a new one with the name of the food you are adding or copy and paste the Sea Turtle one and use it as a base. Now if you have one then open an item list. Search up food from rs that you know of.
Now for people who are to lazy to do even that, here is a list that contains a heap of food.. You may customize the hp given to your will.
# pink sweets:
def item_select_4564(player, slot):
eat(player, 4564, slot, 8)
# green sweets:
def item_select_4563(player, slot):
eat(player, 4563, slot, 9)
# red sweets:
def item_select_4562(player, slot):
eat(player, 4562, slot, 16)
# purple sweets:
def item_select_4561(player, slot):
eat(player, 4561, slot, 13)
# white sweets:
def item_select_4560(player, slot):
eat(player, 4560, slot, 9)
# blue sweets:
def item_select_4558(player, slot):
eat(player, 4558, slot, 19)
# deep blue sweets:
def item_select_4562(player, slot):
eat(player, 4562, slot, 16)
# plain pizza:
def item_select_2289(player, slot):
eat(player, 2289, slot, 16)
# 1/2 plain pizza:
def item_select_2291(player, slot):
eat(player, 2291, slot, 8)
# meat pizza:
def item_select_2293(player, slot):
eat(player, 2293, slot, 18)
# 1/2 meat pizza:
def item_select_2295(player, slot):
eat(player, 2295, slot, 9)
# anchovy pizza:
def item_select_2297(player, slot):
eat(player, 2297, slot, 16)
# 1/2 anchovy pizza:
def item_select_2299(player, slot):
eat(player, 2299, slot, 8)
# pineapple pizza:
def item_select_2301(player, slot):
eat(player, 2301, slot, 16)
# 1/2 pineapple pizza:
def item_select_2303(player, slot):
eat(player, 2303, slot, 8)
I hope you all will use this if you need this.
PS: For people who don't know, in the same folder is the thing were you can change what it says once you eat the food. It looks something like this: ("You just ate the " + item.getDefinition().getName() + "."). So change the first part of it to your will.
Part Five
How to change the default in-game messages
Follows this path in your folder.
Data > Scripts > Authentication
Now scroll down and you'll see a message.
That message is the message that will appear every time you login.
Change that message or add even more messages by copy and pasting the first one under itself.
Now to change messages that a new player get's when he/she logs in.
Follow this patch in your folder.
Src > Com > Rs2HD > Net > ActionSender
Now in the file search for:
if(player.starter == 0) {
Now a bit under that there should be a message/s saying welcome or something. Change those to what you want it to say to new players. Also right under the "if(player.starter ==0) {" There should be something that is giving items. That is the starter kit. Change those items to whatever you wish the stater kit to be.
Part Six
How To Add Genie Lamp
Credits to Cj and Yerfy
Search ActionButtonPacketHandler.
Now add this to it:
/*
*Created by cj & yerfy
*
*\
case 134:
if(buttonId == 29) { //ATTACK
player.genieLamp = 0;
} else if(buttonId == 30) { //STRENGTH
player.genieLamp = 2;
} else if(buttonId == 31) { //DEFENCE
player.genieLamp = 1;
} else if(buttonId == 32) { //RANGE
player.genieLamp = 4;
} else if(buttonId == 33) { //PRAYER
player.genieLamp = 5;
} else if(buttonId == 34) { //HITPOINTS
player.genieLamp = 3;
} else if(buttonId == 35) { //MAGIC
player.genieLamp = 6;
} else if(buttonId == 52) { //SUMMONING
player.genieLamp = 23;
} else if(buttonId == 39) { //CRAFTING
player.genieLamp = 12;
} else if(buttonId == 36) { //AGILITY
player.genieLamp = 16;
} else if(buttonId == 37) { //HERBLORE
player.genieLamp = 15;
} else if(buttonId == 38) { //THIEVING
player.genieLamp = 17;
} else if(buttonId == 43) { //FISHING
player.genieLamp = 10;
} else if(buttonId == 47) { //RUNECRAFTING
player.genieLamp = 20;
} else if(buttonId == 48) { //SLAYER
player.genieLamp = 18;
} else if(buttonId == 50) { //FARMING
player.genieLamp = 19;
} else if(buttonId == 41) { //MINING
player.genieLamp = 14;
} else if(buttonId == 42) { //SMITHING
player.genieLamp = 13;
} else if(buttonId == 49) { //HUNTER
player.genieLamp = 21;
} else if(buttonId == 45) { //COOKING
player.genieLamp = 7;
} else if(buttonId == 44) { //FIREMAKEING
player.genieLamp = 11;
} else if(buttonId == 46) { //WOODCUTTING
player.genieLamp = 8;
} else if(buttonId == 40) { //FLETCHING
player.genieLamp = 9;
} else if(buttonId == 51) { //CONSTRUCTION
player.genieLamp = 22;
} else if(buttonId > 35 && buttonId < 52) {
} else if(buttonId == 28) { //Cancel
player.getActionSender().sendCloseInterface();
} else if(buttonId == 2) { //Confirm
switch(player.genieLamp) {
case 0:
player.getSkills().addXp(0, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 1:
player.getSkills().addXp(1, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getInventory().deleteItem(2528, 1);
player.getActionSender().sendCloseInterface();
break;
case 2:
player.getSkills().addXp(2, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 3:
player.getSkills().addXp(3, 400);
player.getActionSender().sendMessage("The lamp granted you experiance points");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 4:
player.getSkills().addXp(4, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 5:
player.getSkills().addXp(5, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 6:
player.getSkills().addXp(6, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 7:
player.getSkills().addXp(7, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 8:
player.getSkills().addXp(8, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 9:
player.getSkills().addXp(9, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 10:
player.getSkills().addXp(10, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 11:
player.getSkills().addXp(11, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 12:
player.getSkills().addXp(12, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 13:
player.getSkills().addXp(13, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 14:
player.getSkills().addXp(14, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 15:
player.getSkills().addXp(15, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 16:
player.getSkills().addXp(16, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 17:
player.getSkills().addXp(17, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 18:
player.getSkills().addXp(18, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 19:
player.getSkills().addXp(19, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 20:
player.getSkills().addXp(20, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 21:
player.getSkills().addXp(21, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 22:
player.getSkills().addXp(22, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 23:
player.getSkills().addXp(23, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
}
break;
}
break;
Now open up player.java
And declare this:
public int genieLamp = 0;
Now open up ItemPacketHander.java
case 2528://lamp
player.getActionSender().sendInterface(134, false);
break;
make sure this code is under
private void itemSelect(final Player player, final IoSession session, final Packet packet)
Part Seven
How to make an object work
Ok now, I am not the best at doing this yet so do not flame.
Open Object1PacketHandler and scroll down until you start to see the cases.
Now in-game, if you see a bookshelf or a chest and you want it to give you an items then follow this:
Click on the object ingame and hava look at its id, Now in Object1 on the new case add its id:
like this
case 5378:
Now under that type:
player.getInventory().addItem(item id, ammount);
Now if you wish to give it a message add this under it:
player.sm("Input message here");
And under it put the:
Break;
There, now your done with that. Now if you want an object to teleport you somewere you just replace the:
player.getInventory().additem(bleh, bleh);
With this:
player.getTele().telePlayer(player, x, y, height, 1);
Now you have it done.
End Of Guide
Please Post Any Suggestion For Me To Add To This Guide
Please do not flame about that some of this was taken from Rune-Serva cause I was the one who posted some of this onto there.
Part 1: How to customise your client.
Part 2: How to create commands.
Part 3: How to change the lumby tele in magic book work.
Part 4: How to add extra food eating.
Part 5: How to change the default in-game messages.
Part 6: How to add the genie lamp.
Part 7: How to make an object work.
Do not put in the " " onto any words I have.
Part One
How To Customise A Client
Open up your client and first search for "client".
It should show up as a .java file.
Open it and search:
Class131_Sub2_Sub7.aString5636 =
Now beside that there should be something like this:
Omg-Scape.no-ip.com
Change that to your no-ip or if you wish to play your server offline or on your own to edit use 127.0.0.1
Now once you have finished with that open up Applet_Sub1.java and search for:
Class158.aFrame2095.setTitle
Beside that should be something like this:
Treadly-scape [562]
Change that to the name of your server.
Now go back to the start of your client folder and click build.
Once it says its finished then you may run your server and play.
Part Two
How To Create Commands
First off open up your source.
Search for "Command" in the search box.
Now to create a command for the normal players. click the Commands.java
Now scroll down a bit and you'll start to see something like this:
if(cmd[0].equals("::hunt")) {
player.getActionSender().removeTab1();
if(player.SafeZone()) {
player.getTele().telePlayer(player, 2340, 3541, 0, 0);
} else if (Location.wildernessLevel(player.getLocation()) > 20) {
player.sm("you cannot teleport above 20 wilderness");
} else {
player.getTele().telePlayer(player, 2340, 3541, 0, 0);
}
Now that is a command which will teleport you to hunting.
If you wish to change the ::home command so it goes to your home place do CTRL + F and search for "::home"
Now a command should come up which should look like this.
if(cmd[0].equals("::home")) {
player.getActionSender().removeTab1();
if(player.SafeZone()) {
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
} else if (Location.wildernessLevel(player.getLocation()) > 20) {
player.sm("you cannot teleport above 20 wilderness");
} else {
player.getTele().telePlayer(player, 3161, 3634, 0, 2);
}
Now in both of the "player.getTele().telePlayer(player, 3161, 3634, 0, 2);"
You will want to only change the "3161, 3634" to your home coords which ingame can be found out by typing "coords" into the admin command box.
Now once change you may compile and save but this is not all to this.
If you wish to make a command which give a player items this is how you will need to set it out.
if (cmd[0].equals("::pots")) {
if (!player.SafeZone()) {
player.sm("You cant spawn items at wilderness/BountyHunter");
return;
}
player.getInventory().addItem(139, 1);
player.getInventory().addItem(2440, 1);
player.getInventory().addItem(2436, 1);
player.getInventory().addItem(2442, 1);
}
Now this commands gives you 4 pots. To change the pots you have to change the "139, 1" in the "player.getInventory().addItem(139, 1);"
The "139" is the item id and the "1" is the ammount.
You can remake this command into anything you want like this:
if (cmd[0].equals("::dh")) {
if (!player.SafeZone()) {
player.sm("You cant spawn items at wilderness/BountyHunter");
return;
}
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
player.getInventory().addItem(item id, 1);
}
Part Three
How to change the lumy tele in magic book to your home
Follow this link in your folder.
Src > Com > RS2HD > PacketHandler > ActionButtonPacketHandler
Search for:
case 24:
It should look something like this:
case 24:
//player.homeTele = 18;
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
break;
Change the two 4 digit numbers which are shown in mine as " 3161 and 9634 " to your homes code.
Now under that are some other ones which look like that.
The first one is Varrock.
The next is Lumby.
The next is Fally.
The next is Cammy.
And the next is Ardougne.
Now if you wish to, you may add a message when you tele by adding player.sm("insert message here");
Like this.
case 24:
//player.homeTele = 18;
player.getTele().telePlayer(player, 3161, 9634, 0, 2);
player.sm("You teleport home.");
break;
Part 4
How to add extra food eating
Follow this link in your folder.
Data > Scripts > Food
Now once you scroll to the bottom there should be this.
# sea turtle:
def item_select_397(player, slot):
eat(player, 397, slot, 21)
Now, both of the "397" numbers are the item's id and the "21" is how much health it gives you.
Now leave a gap and write a new one with the name of the food you are adding or copy and paste the Sea Turtle one and use it as a base. Now if you have one then open an item list. Search up food from rs that you know of.
Now for people who are to lazy to do even that, here is a list that contains a heap of food.. You may customize the hp given to your will.
# pink sweets:
def item_select_4564(player, slot):
eat(player, 4564, slot, 8)
# green sweets:
def item_select_4563(player, slot):
eat(player, 4563, slot, 9)
# red sweets:
def item_select_4562(player, slot):
eat(player, 4562, slot, 16)
# purple sweets:
def item_select_4561(player, slot):
eat(player, 4561, slot, 13)
# white sweets:
def item_select_4560(player, slot):
eat(player, 4560, slot, 9)
# blue sweets:
def item_select_4558(player, slot):
eat(player, 4558, slot, 19)
# deep blue sweets:
def item_select_4562(player, slot):
eat(player, 4562, slot, 16)
# plain pizza:
def item_select_2289(player, slot):
eat(player, 2289, slot, 16)
# 1/2 plain pizza:
def item_select_2291(player, slot):
eat(player, 2291, slot, 8)
# meat pizza:
def item_select_2293(player, slot):
eat(player, 2293, slot, 18)
# 1/2 meat pizza:
def item_select_2295(player, slot):
eat(player, 2295, slot, 9)
# anchovy pizza:
def item_select_2297(player, slot):
eat(player, 2297, slot, 16)
# 1/2 anchovy pizza:
def item_select_2299(player, slot):
eat(player, 2299, slot, 8)
# pineapple pizza:
def item_select_2301(player, slot):
eat(player, 2301, slot, 16)
# 1/2 pineapple pizza:
def item_select_2303(player, slot):
eat(player, 2303, slot, 8)
I hope you all will use this if you need this.
PS: For people who don't know, in the same folder is the thing were you can change what it says once you eat the food. It looks something like this: ("You just ate the " + item.getDefinition().getName() + "."). So change the first part of it to your will.
Part Five
How to change the default in-game messages
Follows this path in your folder.
Data > Scripts > Authentication
Now scroll down and you'll see a message.
That message is the message that will appear every time you login.
Change that message or add even more messages by copy and pasting the first one under itself.
Now to change messages that a new player get's when he/she logs in.
Follow this patch in your folder.
Src > Com > Rs2HD > Net > ActionSender
Now in the file search for:
if(player.starter == 0) {
Now a bit under that there should be a message/s saying welcome or something. Change those to what you want it to say to new players. Also right under the "if(player.starter ==0) {" There should be something that is giving items. That is the starter kit. Change those items to whatever you wish the stater kit to be.
Part Six
How To Add Genie Lamp
Credits to Cj and Yerfy
Search ActionButtonPacketHandler.
Now add this to it:
/*
*Created by cj & yerfy
*
*\
case 134:
if(buttonId == 29) { //ATTACK
player.genieLamp = 0;
} else if(buttonId == 30) { //STRENGTH
player.genieLamp = 2;
} else if(buttonId == 31) { //DEFENCE
player.genieLamp = 1;
} else if(buttonId == 32) { //RANGE
player.genieLamp = 4;
} else if(buttonId == 33) { //PRAYER
player.genieLamp = 5;
} else if(buttonId == 34) { //HITPOINTS
player.genieLamp = 3;
} else if(buttonId == 35) { //MAGIC
player.genieLamp = 6;
} else if(buttonId == 52) { //SUMMONING
player.genieLamp = 23;
} else if(buttonId == 39) { //CRAFTING
player.genieLamp = 12;
} else if(buttonId == 36) { //AGILITY
player.genieLamp = 16;
} else if(buttonId == 37) { //HERBLORE
player.genieLamp = 15;
} else if(buttonId == 38) { //THIEVING
player.genieLamp = 17;
} else if(buttonId == 43) { //FISHING
player.genieLamp = 10;
} else if(buttonId == 47) { //RUNECRAFTING
player.genieLamp = 20;
} else if(buttonId == 48) { //SLAYER
player.genieLamp = 18;
} else if(buttonId == 50) { //FARMING
player.genieLamp = 19;
} else if(buttonId == 41) { //MINING
player.genieLamp = 14;
} else if(buttonId == 42) { //SMITHING
player.genieLamp = 13;
} else if(buttonId == 49) { //HUNTER
player.genieLamp = 21;
} else if(buttonId == 45) { //COOKING
player.genieLamp = 7;
} else if(buttonId == 44) { //FIREMAKEING
player.genieLamp = 11;
} else if(buttonId == 46) { //WOODCUTTING
player.genieLamp = 8;
} else if(buttonId == 40) { //FLETCHING
player.genieLamp = 9;
} else if(buttonId == 51) { //CONSTRUCTION
player.genieLamp = 22;
} else if(buttonId > 35 && buttonId < 52) {
} else if(buttonId == 28) { //Cancel
player.getActionSender().sendCloseInterface();
} else if(buttonId == 2) { //Confirm
switch(player.genieLamp) {
case 0:
player.getSkills().addXp(0, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 1:
player.getSkills().addXp(1, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getInventory().deleteItem(2528, 1);
player.getActionSender().sendCloseInterface();
break;
case 2:
player.getSkills().addXp(2, 400);
player.getActionSender().sendMessage("You have just been granted xp!");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 3:
player.getSkills().addXp(3, 400);
player.getActionSender().sendMessage("The lamp granted you experiance points");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 4:
player.getSkills().addXp(4, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 5:
player.getSkills().addXp(5, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 6:
player.getSkills().addXp(6, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 7:
player.getSkills().addXp(7, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 8:
player.getSkills().addXp(8, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 9:
player.getSkills().addXp(9, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 10:
player.getSkills().addXp(10, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 11:
player.getSkills().addXp(11, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 12:
player.getSkills().addXp(12, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 13:
player.getSkills().addXp(13, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 14:
player.getSkills().addXp(14, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 15:
player.getSkills().addXp(15, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 16:
player.getSkills().addXp(16, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 17:
player.getSkills().addXp(17, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 18:
player.getSkills().addXp(18, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 19:
player.getSkills().addXp(19, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 20:
player.getSkills().addXp(20, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 21:
player.getSkills().addXp(21, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 22:
player.getSkills().addXp(22, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
case 23:
player.getSkills().addXp(23, 400);
player.getActionSender().sendMessage("You have been granted xp for the chosen skill");
player.getActionSender().sendCloseInterface();
player.getInventory().deleteItem(2528, 1);
break;
}
break;
}
break;
Now open up player.java
And declare this:
public int genieLamp = 0;
Now open up ItemPacketHander.java
case 2528://lamp
player.getActionSender().sendInterface(134, false);
break;
make sure this code is under
private void itemSelect(final Player player, final IoSession session, final Packet packet)
Part Seven
How to make an object work
Ok now, I am not the best at doing this yet so do not flame.
Open Object1PacketHandler and scroll down until you start to see the cases.
Now in-game, if you see a bookshelf or a chest and you want it to give you an items then follow this:
Click on the object ingame and hava look at its id, Now in Object1 on the new case add its id:
like this
case 5378:
Now under that type:
player.getInventory().addItem(item id, ammount);
Now if you wish to give it a message add this under it:
player.sm("Input message here");
And under it put the:
Break;
There, now your done with that. Now if you want an object to teleport you somewere you just replace the:
player.getInventory().additem(bleh, bleh);
With this:
player.getTele().telePlayer(player, x, y, height, 1);
Now you have it done.
End Of Guide
Please Post Any Suggestion For Me To Add To This Guide