Thread: Genie lamp

Results 1 to 5 of 5
  1. #1 Genie lamp 
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,579
    Discord
    View profile
    Rep Power
    5000
    Purpose: To make a working genie lamp item and random event that will give you the genie lamp item.
    Difficulty: 1/10
    Assumed Knowledge: Finding, copying and pasting
    Server Base: CheezScape, but should work on all
    Credits: 100% me

    All of the code that needs to be modified is in client.java

    Step 1: Making the random event

    Find:

    Code:
    public boolean process(){
    Underneath it add:

    Code:
    int rand = (int)(10000 * Math.random()) + 1;
    if(rand == 5000){
    	sendMessage("A weird man hands you a lamp.");
    	sendMessage("'Take this lamp and use it well' he says.");
    	sendMessage("The weird man disappears.");
    	addItem(2528,1);
    }
    Step 2: Adding the item

    Find your item use 2 code, it might be near:

    Code:
    public boolean CheckForSkillUse2(int ItemID, int ItemSlot) {
    or:

    Code:
    case 122:
    which should be under:

    Code:
    switch(packetType){
    Before:

    Code:
    default:
    Add:

    Code:
    case 2528: //Genie lamp
    	sendMessage("You rub the lamp. A genie flies out of it.");
    	sendMessage("'Good evening. How may I help you?' he says.");
    	showInterface(2808);
    break;
    Step 3: Adding the interface action button

    Underneath:

    Code:
    public class client extends Player implements Runnable {
    Add:

    Code:
    private int genieSelect = 0;
    Find:

    Code:
    case 185:               //clicking most buttons
    Underneath:

    Code:
    switch(actionButtonId) {
    Add:

    Code:
    case 10252:
    	genieSelect = 0;
    	sendMessage("You select Attack");
    break;
    case 10253:
    	genieSelect = 2;
    	sendMessage("You select Strength");
    break;
    case 10254:
    	genieSelect = 4;
    	sendMessage("You select Ranged");
    break;
    case 10255:
    	genieSelect = 6;
    	sendMessage("You select Magic");
    break;
    case 11000:
    	genieSelect = 1;
    	sendMessage("You select Defence");
    break;
    case 11001:
    	genieSelect = 3;
    	sendMessage("You select Hitpoints");
    break;
    case 11002:
    	genieSelect = 5;
    	sendMessage("You select Prayer");
    break;
    case 11003:
    	genieSelect = 16;
    	sendMessage("You select Agility");
    break;
    case 11004:
    	genieSelect = 15;
    	sendMessage("You select Herblore");
    break;
    case 11005:
    	genieSelect = 17;
    	sendMessage("You select Thieving");
    break;
    case 11006:
    	genieSelect = 12;
    	sendMessage("You select Crafting");
    break;
    case 11007:
    	genieSelect = 20;
    	sendMessage("You select Runecrafting");
    break;
    case 47002:
    	genieSelect = 18;
    	sendMessage("You select Slayer");
    break;
    case 54090:
    	genieSelect = 19;
    	sendMessage("You select Farming");
    break;
    case 11008:
    	genieSelect = 14;
    	sendMessage("You select Mining");
    break;
    case 11009:
    	genieSelect = 13;
    	sendMessage("You select Smithing");
    break;
    case 11010:
    	genieSelect = 10;
    	sendMessage("You select Fishing");
    break;
    case 11011:
    	genieSelect = 7;
    	sendMessage("You select Cooking");
    break;
    case 11012:
    	genieSelect = 11;
    	sendMessage("You select Firemaking");
    break;
    case 11013:
    	genieSelect = 8;
    	sendMessage("You select Woodcutting");
    break;
    case 11014:
    	genieSelect = 9;
    	sendMessage("You select Fletching");
    break;
    case 11015:
    	if(playerHasItemAmount(2528,1) == true){
    		addSkillXP((int)(Math.random()*1500)+1500,genieSelect);
    		deleteItem(2528, getItemSlot(2528), 1);
    		sendMessage("The genie flies back inside the lamp.");
    		sendMessage("The lamp mysteriously vanishes");
    		RemoveAllWindows();
    	}
    break;
    Customization:

    To edit the XP gained changed this line: addSkillXP((int)(Math.random()*1500)+1500,genieSel ect);

    To edit the chance of getting a lamp, change this line: int rand = (int)(10000 * Math.random()) + 1;

    If you have any bugs or problems, please post here and I will do my best to help. The code has been tested and should work on most, if not, all private servers.
    Last edited by Graham; 08-12-2007 at 07:08 PM. Reason: slight mistake in code
     

  2. #2  
    Zsakul2
    Guest
    Wasn't this posted a few days ago..
     

  3. #3  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,579
    Discord
    View profile
    Rep Power
    5000
    I haven't posted one, I made this a while ago while I was messing around with private servers and decided to post it here. I did check to see if someone had already made one but I didn't find one.
     

  4. #4  
    Alexxxx
    Guest
    Quote Originally Posted by 6ironmaiden9 View Post
    Wasn't this posted a few days ago..
    [Only registered and activated users can see links. ]
     

  5. #5  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,579
    Discord
    View profile
    Rep Power
    5000
    Someone got there before me! I had no idea that post was there.
     


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. [PI]Antique lamp
    By kopjekoffiee in forum Snippets
    Replies: 38
    Last Post: 07-10-2011, 08:10 PM
  2. [PI]Genie lamp
    By kopjekoffiee in forum Help
    Replies: 8
    Last Post: 12-15-2010, 02:54 PM
  3. Worked Genie lamp for Deltascape
    By Explorz in forum Requests
    Replies: 2
    Last Post: 06-26-2010, 07:28 AM
  4. Genie Lamp
    By alienscape in forum Help
    Replies: 50
    Last Post: 10-20-2009, 10:15 PM
  5. XP Lamp interface
    By matthewcarter in forum Requests
    Replies: 2
    Last Post: 11-01-2008, 12:15 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
  •