Cool, Thanks for contributing
|
|
Welcome to a tutorial mainly based around the Zenith Server (667). This tutorial is going show you how to edit what happens when you click an item, eg it teleports you somewhere or gives you an item.
My Example in this is going to be a donator lamp. This is so people can donate for a lamp and gain the lamp in their inventory, also allows easy sellable donators through players.
Method:
Step 1:
Go to your Source file and find the file named "InventoryOptions.java". This is the file that contains all the clickable items that you want to edit.
Step 2:
Search for the item "6199" (this is mystery box). Below this is where you are going to write all your new lines of coding.
Step 3:
Below the end of the 6199 Case. Paste this code:
You've now added the Lamp into your Coding!Code:if (itemId == 2528) { // Item you're Editing player.getInventory().deleteItem(2528, 1); // Makes sure item isn't kept once clicked for (int i = 0; i < RandomItems.length; i++) player.getInventory().addItem(RandomItems[i], 1); // Makes sure item is there player.setNextGraphics(new Graphics(6)); // A Cool animation I added with the lamp player.setDonator(true); // Makes them Donator player.getPackets().sendGameMessage("<col=00ff00><shad=000000>You are now a Full Zenith Donator!"); // Message to the Clicker for (Player players : World.getPlayers()) players.getPackets().sendGameMessage("<col=00ff00><shad=000000>[Donations] Zenith Welcomes a New Donator Today!"); // Shows everyone A New Donator return; }
Step 4:
Save the file, and go into your Source folder again. Compile and Run your server.
Finished!
You're now Done! It should look like this!
The Emote!
The Chat!
Have fun Editting your Clicks!
Charlie.


Thanks for sharing ;]
[/QUOTE]player.setNextGraphics(new Graphics(6)); // A Cool animation I added with the lamp
[/QUOTE] i like the look of Graphics(92)) better lol
I like that you explained what each line of code meant, good for the newbies![]()
| « 667/704 Making NPC's talk - And teleport | 614 Autocasting (Ancients) » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |