Thread: [667] How to customise Click Items (Mystery Box etc) [667]

Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1 [667] How to customise Click Items (Mystery Box etc) [667] 
    Registered Member Lorus's Avatar
    Join Date
    Jun 2013
    Posts
    25
    Thanks given
    1
    Thanks received
    4
    Rep Power
    50
    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:
    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;
    		}
    You've now added the Lamp into your Coding!

    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.
    Reply With Quote  
     

  2. #2  
    Aganoth Developer

    Aust1n's Avatar
    Join Date
    Aug 2012
    Posts
    1,860
    Thanks given
    280
    Thanks received
    406
    Rep Power
    60
    Cool, Thanks for contributing



    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Nov 2010
    Age
    11
    Posts
    2,645
    Thanks given
    158
    Thanks received
    280
    Rep Power
    0
    Thanks for sharing ;]
    Reply With Quote  
     

  4. #4  
    The Emperor of the Sands

    Azir's Avatar
    Join Date
    Nov 2008
    Posts
    2,468
    Thanks given
    8
    Thanks received
    487
    Rep Power
    117
    been done before.


    Reply With Quote  
     

  5. #5  
    Registered Member Lorus's Avatar
    Join Date
    Jun 2013
    Posts
    25
    Thanks given
    1
    Thanks received
    4
    Rep Power
    50
    Quote Originally Posted by King J Scape View Post
    been done before.
    Been done again.
    Reply With Quote  
     

  6. #6  
    Registered Member Rich guy's Avatar
    Join Date
    May 2013
    Posts
    759
    Thanks given
    33
    Thanks received
    30
    Rep Power
    43
    Quote Originally Posted by InnovationDEV View Post
    Been done again.
    Got that's error
    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.” ― Albert Einstein
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Sep 2012
    Posts
    6
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    [/QUOTE]player.setNextGraphics(new Graphics(6)); // A Cool animation I added with the lamp


    [/QUOTE] i like the look of Graphics(92)) better lol
    Reply With Quote  
     

  8. #8  
    Registered Member Fawkes's Avatar
    Join Date
    Jul 2013
    Posts
    147
    Thanks given
    2
    Thanks received
    13
    Rep Power
    11
    I like that you explained what each line of code meant, good for the newbies


    Behind this mask, there's an idea.
    Reply With Quote  
     

  9. #9  
    Coder in training
    Alienware's Avatar
    Join Date
    Oct 2011
    Age
    24
    Posts
    518
    Thanks given
    35
    Thanks received
    58
    Rep Power
    12
    Quote Originally Posted by Rich guy View Post
    got an error can you help me with it add me on skype turmoil.ko1
    Not sure if serious...... >.>
    Reply With Quote  
     

  10. Thankful user:


  11. #10  
    Let the games begin!

    Angeloflife's Avatar
    Join Date
    Jul 2013
    Age
    23
    Posts
    754
    Thanks given
    21
    Thanks received
    147
    Rep Power
    83
    thanks might use this
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [667/7**]How To Edit/Pack Item Bonuses
    By TaterMater in forum Tutorials
    Replies: 23
    Last Post: 07-21-2014, 07:41 PM
  2. Replies: 1
    Last Post: 12-24-2012, 12:12 AM
  3. [667]How to rename an item[667]
    By Vip3r in forum Tutorials
    Replies: 18
    Last Post: 11-03-2012, 09:32 PM
  4. (667)How to add a non-working item.
    By Du Haist in forum Help
    Replies: 1
    Last Post: 06-22-2012, 09:36 PM
  5. 667 How to make wear item
    By Zond in forum Help
    Replies: 0
    Last Post: 03-29-2012, 08:35 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •