Thread: Project Insanity Object/NPC Problem

Results 1 to 9 of 9
  1. #1 Project Insanity Object/NPC Problem 
    Registered Member
    Join Date
    Jun 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    How do I give either an NPC or object the ability to heal Players.

    For instance, on both ImpactPK and RuneLazarus there is a fountain that heals players when clicking it.

    A code would be great!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    bump!
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Code:
    c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    			c.getPA().refreshSkill(3);
    Using switch statment.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jun 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Can you explain a little bit?
    Where would I put this code?
    (Sorry I am new to coding)
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Sure, You want it for an object, right? erm find actionhandler.java, ctrl + f search for firstclickobject NOT firstclickNpc Or secondclick anything just to clarify

    you'll see something like

    switch {
    add a case ID case Id being the Object Id


    Case ####:
    Code...
    Code...
    break; < Remember to break you won't get errors but the script won't stop and it'll fuck up [=
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jun 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Thanks a bunch this was the final output...

    Code:
    case 153:
    c.objectId = 153;
    c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    c.getPA().refreshSkill(3);
    c.playerLevel[5] = c.getLevelForXP(c.playerXP[5]);
    c.getPA().refreshSkill(5);
    c.sendMessage("I feel refreshed!");
    Except I did it in ClickingObjects.java instead of ActionHandler.java.

    Anyway thanks for the base code and all the help
    Reply With Quote  
     

  7. #7  
    Registered Member
    Division's Avatar
    Join Date
    Dec 2009
    Age
    29
    Posts
    2,208
    Thanks given
    41
    Thanks received
    78
    Rep Power
    97
    ImpactPK got released so you could rip it off
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jun 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Do you have a link?
    There are some nice aspects of it I would like to add to the current server I am working on
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Quote Originally Posted by NickDuhGreat View Post
    Thanks a bunch this was the final output...

    Code:
    case 153:
    c.objectId = 153;
    c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    c.getPA().refreshSkill(3);
    c.playerLevel[5] = c.getLevelForXP(c.playerXP[5]);
    c.getPA().refreshSkill(5);
    c.sendMessage("I feel refreshed!");
    Except I did it in ClickingObjects.java instead of ActionHandler.java.

    Anyway thanks for the base code and all the help
    Code:
    case 153:
    c.objectId = 153;
    c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    c.getPA().refreshSkill(3);
    c.playerLevel[5] = c.getLevelForXP(c.playerXP[5]);
    c.getPA().refreshSkill(5);
    c.sendMessage("I feel refreshed!");
    Code:
    case 153:
    You Don't need that and yw doesn't really matter if it's in clickingobjects or action handler.
    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

Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •