Thread: [PI] How Do I Make an NPC Give You an Option to Teleport ?

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [PI] How Do I Make an NPC Give You an Option to Teleport ? 
    Registered Member
    Join Date
    Mar 2011
    Age
    29
    Posts
    36
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Well I use to know this, but I stopped coding for a while so I forgot how to code the most basic stuff, but if someone could tell me I would appreciate it.

    And before someone tells me to "Use the search button" I've done that, and got no luck.

    Base: Exion's PI Server.

    (Will Rep if you can help)
    Reply With Quote  
     

  2. #2  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Quote Originally Posted by Shady View Post
    Well I use to know this, but I stopped coding for a while so I forgot how to code the most basic stuff, but if someone could tell me I would appreciate it.

    And before someone tells me to "Use the search button" I've done that, and got no luck.

    Base: Exion's PI Server.

    (Will Rep if you can help)

    Alright ill helpout K so, first you want too open up your dialougehandler.java
    Next you need to add a case for your dialouge
    Heres a example of mine:
    Code:
    case 83:
    			sendOption2("Ancient Prayers",  "Normal Prayers");
    			c.dialogueAction = 62;
    		break;
    Next you would go into actionhandler.java under Public void firstClickNpc
    And add a similar code to this

    Code:
    case 4342:
    			c.getDH().sendDialogues(83, npcType);
    			break;
    4342 being the npc id and 83 being the dialouge case from before
    so you would click it and it would send those options, mine is setup for ancient prayers but here is how it would look now go into clickbuttons.java and search for
    case 9158:
    under it add
    Code:
    } else if (c.dialogueAction == 62) {
    					c.pcPoints = 0;
    					c.setSidebarInterface(5, 5608);
    					c.startAnimation(645);
    					c.sendMessage("You Feel your ancient prayers drawn from you.");
    				c.getCurse().resetCurse();
    				c.getCombat().resetPrayers();
    62 being the dialogue action from the code in dialougehandler.Mine is setup for ancient prayers so, you would need too delete all the stuff from pcpoints too c.getcombat and add

    c.getPA().startTeleport2(2524, 3587, 0);

    you should know what too do with that now, and if you need the id of the other option click it and it will tell you the action id in your cmd, then search that in clickingbuttons and add something similer to the above.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2011
    Age
    29
    Posts
    36
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Hmm, everything seems to work but i got 2 errors in ClickingButtions.java
    Code:
    src\server\model\players\packets\ClickingButtons.java:424: 'else' without 'if'
                                                                            } else i
    f (c.dialogueAction == 62) {
                                                                              ^
    src\server\model\players\packets\ClickingButtons.java:441: orphaned case
                            case 29188:
                            ^
    2 errors
    Press any key to continue . . .
    any idea how to fix this?
    Reply With Quote  
     

  4. #4  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Quote Originally Posted by Shady View Post
    Hmm, everything seems to work but i got 2 errors in ClickingButtions.java
    Code:
    src\server\model\players\packets\ClickingButtons.java:424: 'else' without 'if'
                                                                            } else i
    f (c.dialogueAction == 62) {
                                                                              ^
    src\server\model\players\packets\ClickingButtons.java:441: orphaned case
                            case 29188:
                            ^
    2 errors
    Press any key to continue . . .
    any idea how to fix this?
    Paste your entire code here please.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2011
    Age
    29
    Posts
    36
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Okay,
    Code:
    } else if (c.dialogueAction == 62) {
    					c.getPA().startTeleport2(2524, 3587, 0);
                                                                               break;
    Reply With Quote  
     

  6. #6  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Quote Originally Posted by Shady View Post
    Okay,
    Code:
    } else if (c.dialogueAction == 62) {
    					c.getPA().startTeleport2(2524, 3587, 0);
                                                                               break;
    from case 9158: down too the end right before the next case post it here.... sorry for not being clear
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2011
    Age
    29
    Posts
    36
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    It's no problem
    Code:
    case 9158:
    					} else if (c.dialogueAction == 62) {
    					c.getPA().startTeleport2(2524, 3587, 0);
                                                                               break;
    				if (c.dialogueAction == 8) {
    					c.getPA().fixAllBarrows();
    				} else {
    				c.dialogueAction = 0;
    				c.getPA().removeAllWindows();
    				}
    				break;
    Reply With Quote  
     

  8. #8  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Quote Originally Posted by Shady View Post
    It's no problem
    Code:
    case 9158:
                                                                            } else if (c.dialogueAction == 62) {
    					} else if (c.dialogueAction == 62) {
    					c.getPA().startTeleport2(2524, 3587, 0);
                                                                               break;
    				if (c.dialogueAction == 8) {
    					c.getPA().fixAllBarrows();
    				} else {
    				c.dialogueAction = 0;
    				c.getPA().removeAllWindows();
    				}
    				break;
    Replace that with this
    Code:
    case 9158:
    if (c.dialogueAction == 8) {
    					c.getPA().fixAllBarrows();
                              }
    			if (c.dialogueAction == 62) {
    					c.getPA().startTeleport2(2524, 3587, 0);
    				} else {
    				c.dialogueAction = 0;
    				c.getPA().removeAllWindows();
    				}
    				break;
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Mar 2011
    Age
    29
    Posts
    36
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Many thanks! Repped, and sorry for being so nooby xD
    Reply With Quote  
     

  10. #10  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Quote Originally Posted by Shady View Post
    Many thanks! Repped, and sorry for being so nooby xD
    No problem mate
    Reply With Quote  
     

  11. Thankful user:


Page 1 of 2 12 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. How do I add a 6th teleport option?
    By Mister Pure in forum Help
    Replies: 4
    Last Post: 12-24-2010, 03:40 AM
  2. [pi] 'more' teleport option
    By Monster in forum Help
    Replies: 4
    Last Post: 12-20-2010, 03:18 PM
  3. Help with this Option teleport
    By Harambe_ in forum Help
    Replies: 3
    Last Post: 07-17-2010, 01:43 PM
  4. Replies: 2
    Last Post: 06-01-2009, 08:10 AM
  5. Teleport option
    By Kryptic in forum Help
    Replies: 3
    Last Post: 05-25-2009, 01:09 PM
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
  •