Purpose: To have working enchant Onyx jewelry spell on your server.

Difficulty: 1/10 very simple...

Assumed Knowledge: How to C&P.

Server Base: All.

Classes Modified: Client.java

Required Stuff: A server.

Procedure: Alright guys, today I'm going to teach you a basic nooby tutorial, but it should be useful on your server. Please don't flame this topic if you have nothing nice to say, I realize this is not a very advanced tutorial.

Anyways, lets get started.

First open up your server folder, and go to client.java.
Press Ctrl + F, find this.

Code:
case 237: //Magic on Items
Scroll down a bit until you find the Dragonstone Enchant
under it, code this in.
(We're doing this step-by-step, I will explain what everything means, I support learning not leeching.)
Type this in.
Code:
else if(castSpell == 6003) { //Enchant Lvl-6(onyx)
k else if just opens up the code, castSpell is the id for the actual enchant onyx sprite on your magic tab.

Moving on.
Code:
if(playerLevel[6] >= 87) {
This just says if your magic lvl is greater than or equal to 87, allow you to do the following code.

Here come's a big chunk. We'll take this slow.
Code:
if(castOnItem == 6575) {
	deleteItem(castOnItem, castOnSlot, 1);
	addItem(6583, 1);
	addSkillXP(102, 6);
				}
K now if(castOnItem == 6575) {, that means, that you cast enchant onyx on item 6575(onyx ring). Now, deleteItem(castOnItem, castOnSlot, 1); that means that it will delete item 6575, the item that enchant onyx was cast on, and the slot that it was at. 1); is the quantity of the item. addItem(6583, 1); It means what it says, add the item 6583(ring of stone) with a quantity of 1. AddSkillXP(102, 6); If you'll notice, the code in the beginning says playerLevel[6]
playerLevel[6] is magic, and 102 is the amount of XP you get added to that skill. You should know what the closing bracket means.

Code:
else if(castOnItem == 6581) {
	deleteItem(castOnItem, castOnSlot, 1);
	addItem(6585, 1);
	addSkillXP(102, 6);
	} else {
Same thing, just with onyx amulet and amulet of fury, then we close that. The else afterwards means, if you did not cast it on one of those two items, it will continue with the next code.

Code:
	sendMessage("This needs to be cast on Onyx Jewelry");
				}
Self-explanatory.

The next code is if you do not have 87 Magic.
Code:
			} else {
				sendMessage("You need atleast 87 Magic to cast Enchant Lvl-6 Jewelry");
			}
		}
Then we close the whole thing, which was the castSpell at the beginning.

Now if the breaking up confused you a little bit on how the code should look, have no fear, here's the whole thing.

Code:
		else if(castSpell == 6003) { //Enchant lvl 6(onyx)
			if(playerLevel[6] >= 87) {
				if(castOnItem == 6575) {
					deleteItem(castOnItem, castOnSlot, 1);
					addItem(6583, 1);
					addSkillXP(102, 6);
				}
				else if(castOnItem == 6581) {
					deleteItem(castOnItem, castOnSlot, 1);
					addItem(6585, 1);
					addSkillXP(102, 6);
				} else {
					sendMessage("This needs to be cast on Onyx Jewelry");
				}
			} else {
				sendMessage("You need atleast 87 Magic to cast Enchant Lvl-6 Jewelry");
			}
		}
Hope you guys enjoyed this tutorial, and if you have any errors, which you shouldn't. Please post them here, or PM me, I shall get back to you as soon as I can.

If you use these, please post and let me know if my tutorial was helpful or not.

~Thanks.

Credits: Me, and someone else I can't remember at this moment who posted an interface list.(Sorry I couldn't give Creds to whoever did.)