Thread: [PI] Use Item on Object

Results 1 to 7 of 7
  1. #1 [PI] Use Item on Object 
    Registered Member
    Join Date
    Aug 2011
    Posts
    211
    Thanks given
    17
    Thanks received
    19
    Rep Power
    17
    Hi, I'm trying to make an object that when you used a summoning charm on it, you would gain X amount of Summoning Experience. The problem is, when I try and use the charm on the obelisk, I disconnect and never gain any experience. Do you know why?

    Here is my UseItem.java: Java - Rune-Server Official Pastebin
    The code for my object is at line 50.

    Thanks!
    Reply With Quote  
     

  2. #2  
    Trap God

    Join Date
    Jun 2010
    Age
    28
    Posts
    570
    Thanks given
    27
    Thanks received
    26
    Rep Power
    4
    Put (GreencharmItemID, Amount) ?
    "What was done to me was monstrous."
    "And they created a monster."
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2011
    Posts
    211
    Thanks given
    17
    Thanks received
    19
    Rep Power
    17
    I tried that with Gold Charms but I still DC.
    Reply With Quote  
     

  4. #4  
    Trap God

    Join Date
    Jun 2010
    Age
    28
    Posts
    570
    Thanks given
    27
    Thanks received
    26
    Rep Power
    4
    Add it in ActionHandler.java

    somthing like that so when u click the object
    it checks for item id, and if u have it, it deletes it then
    gives u XP

    Code:
    case ####:
    if (c.getItems().playerHasItem(ID, Amount)) {
    c.getItems().deleteItem(ID, Amount);
    c.addXp(ID, Amount);
    c.sendMessage("You have gained EXP");
     } Else {
    c.sendMessage("you need whatevere amount of whaterver to use this obilesk");
    } 
    break;
    You gunna have to find the addexp method your self.
    "What was done to me was monstrous."
    "And they created a monster."
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2011
    Posts
    211
    Thanks given
    17
    Thanks received
    19
    Rep Power
    17
    Alright, thanks man, repped. The case number is the Obby ID right?

    EDIT: It didn't work. =/
    Reply With Quote  
     

  6. #6  
    Trap God

    Join Date
    Jun 2010
    Age
    28
    Posts
    570
    Thanks given
    27
    Thanks received
    26
    Rep Power
    4
    Pastebin your actionhandler, and pm me the link ill fix it
    "What was done to me was monstrous."
    "And they created a monster."
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2011
    Posts
    211
    Thanks given
    17
    Thanks received
    19
    Rep Power
    17
    Pmed.
    Reply With Quote  
     


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. Replies: 9
    Last Post: 06-30-2011, 11:02 PM
  2. Replies: 1
    Last Post: 06-21-2011, 06:40 PM
  3. Replies: 3
    Last Post: 07-01-2010, 04:19 AM
  4. Replies: 2
    Last Post: 03-23-2010, 10:17 PM
  5. Replies: 26
    Last Post: 03-13-2009, 07:49 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
  •