Thread: [PI] Item Npc Dialogue

Results 1 to 8 of 8
  1. #1 [PI] Npc dialogue quest 
    Registered Member Beandog's Avatar
    Join Date
    Mar 2013
    Posts
    218
    Thanks given
    22
    Thanks received
    9
    Rep Power
    4
    hey guys so ive been working on this miniquest for some time now, i got most of it figured it out on my own, it requires the player to grab ned a bottle of rum from a crate in his cellar. i have it set so when a player talks to ned he asks why there in his house, and then gets to the point that he wants u to grab him his rum, once the player goes down and grabs the rum then they go talk to him again he opens up a new dialouge and the bottle is taken from the players inventory (kinda like oh thanks for the bottle) but for some weird reason once one player gives him his bottle it seems for every other player (or acc i just made) ned talks to them as if they got him the bottle to, so it just dosnt quite make sence. heres my actionhandler to trigger the dialouge with the bottle:


    Code:
    case 918:
              c.getDH().sendDialogues(420, npcType);
              if(c.getItems().playerHasItem(8940, 1)) {
              c.getItems().deleteItem(8940, 1);
              } else {
              c.getDH().sendDialogues(428, npcType);
              }
              break;

    and if necessary heres the dialogue


    Code:
     case 420:
                 sendNpcChat2("Hey there Friend!","Might i ask why your in my house?", c.talkingNpc, "Al");
                 c.nextChat = 421;
              break;
              case 421:
                 sendPlayerChat1("Oh You know, Just clicking on random door's intruding on things.");
                 c.nextChat = 422;
              break;
              case 422:
                 sendNpcChat2("HAHAHA i like you!","You Have quite a since of humour!", c.talkingNpc, "Al");
                 c.nextChat = 423;
              break;
              case 423:
                 sendPlayerChat1("HaHa yeah, I guess i do. Is there anything you need help with?");
                 c.nextChat = 424;
              break;
              case 424:
                 sendNpcChat2("Well now that you mention it..","Could you grab me a bottle from the cellar?", c.talkingNpc, "Al");
                 c.nextChat = 425;
              break;
              case 425:
                 sendPlayerChat1("Im looking for an Adventure, Im not your bartender!");
                 c.nextChat = 426;
              break;
              case 426:
                 sendNpcChat2("Ohh but wait! Its not just an ordinary cellar..","No, no its a scary place, ive been hearing lots of noises", c.talkingNpc, "Al");
                 c.nextChat = 427;
              break;
              case 427:
                 sendNpcChat2("Grab me some Red rum from the cellar and i will"," tell you all about it.", c.talkingNpc, "Al");
                 c.nextChat = 0;
              break;
              case 428:
                 sendNpcChat2("Thank you very much Friend!","now as i was saying, there seems to be alot of...", c.talkingNpc, "Al");
                 c.nextChat = 429;
              break;
              case 429:
                 sendNpcChat2("Weird stuff happening down there, I was down there yesterday"," and something caught my eye..", c.talkingNpc, "Al");
                 c.nextChat = 430;
              break;
    Could someone please tell me an easy fix or what i did/ didnt do right, Thanks
    Reply With Quote  
     

  2. #2  
    Registered Member Beandog's Avatar
    Join Date
    Mar 2013
    Posts
    218
    Thanks given
    22
    Thanks received
    9
    Rep Power
    4
    Would Really like to know
    BUMP
    Reply With Quote  
     

  3. #3  
    Donator
    Insanity_'s Avatar
    Join Date
    Apr 2013
    Age
    31
    Posts
    63
    Thanks given
    6
    Thanks received
    3
    Rep Power
    11
    you have to make an int such as bottleGiven = false in player.java and player save. and when that player has given him the bottle do bottelGiven = true and make the dialogue detect if bottleGiven = true send dialogue.. something along those lines might work.

    if you want further help just pm me your skype name.
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Registered Member Beandog's Avatar
    Join Date
    Mar 2013
    Posts
    218
    Thanks given
    22
    Thanks received
    9
    Rep Power
    4
    Quote Originally Posted by black out View Post
    you have to make an int such as bottleGiven = false in player.java and player save. and when that player has given him the bottle do bottelGiven = true and make the dialogue detect if bottleGiven = true send dialogue.. something along those lines might work.

    if you want further help just pm me your skype name.
    Thanks man but i dont use skype, how exactly would i go about this?
    Reply With Quote  
     

  6. #5  
    Naughty Toys
    Toys's Avatar
    Join Date
    Sep 2013
    Posts
    201
    Thanks given
    21
    Thanks received
    9
    Rep Power
    37
    In playsave.java you will basically need to pick one of the other things (Pcpoints or pkpoints whatever your server has)
    and copy it into a new one and change it to "BottleGiven" or like "MiniQuestName" but you can either have it set to true or false, or using a number system.
    Reply With Quote  
     

  7. Thankful user:


  8. #6  
    Registered Member Beandog's Avatar
    Join Date
    Mar 2013
    Posts
    218
    Thanks given
    22
    Thanks received
    9
    Rep Power
    4
    Alright ill give this a try, Thanks guys
    Reply With Quote  
     

  9. #7  
    Registered Member

    Join Date
    Dec 2011
    Age
    29
    Posts
    794
    Thanks given
    92
    Thanks received
    84
    Rep Power
    250
    Code:
    case 918:
              c.getDH().sendDialogues(420, npcType);
              if(c.getItems().playerHasItem(8940, 1)) {
              c.getItems().deleteItem(8940, 1);
              } else {
              c.getDH().sendDialogues(428, npcType);
              }
              break;
    The code is wrong...

    Code:
    	case 918:
              if(c.getItems().playerHasItem(8940, 1)) {
              c.getDH().sendDialogues(428, npcType);
              c.getItems().deleteItem(8940, 1);
              } else {
              c.getDH().sendDialogues(420, npcType);
              }
    	break;
    I have a tip for you, while writing the code always keep in mind how the code is going to get processed.

    Reply With Quote  
     

  10. #8  
    Registered Member The Dark Wizard's Avatar
    Join Date
    Aug 2013
    Posts
    66
    Thanks given
    2
    Thanks received
    0
    Rep Power
    9
    Quote Originally Posted by FortNightAtmo View Post
    Code:
    case 918:
              c.getDH().sendDialogues(420, npcType);
              if(c.getItems().playerHasItem(8940, 1)) {
              c.getItems().deleteItem(8940, 1);
              } else {
              c.getDH().sendDialogues(428, npcType);
              }
              break;
    The code is wrong...

    Code:
    	case 918:
              if(c.getItems().playerHasItem(8940, 1)) {
              c.getDH().sendDialogues(428, npcType);
              c.getItems().deleteItem(8940, 1);
              } else {
              c.getDH().sendDialogues(420, npcType);
              }
    	break;
    I have a tip for you, while writing the code always keep in mind how the code is going to get processed.
    FortNightAtmo got it. What was happening was that if the player had the bottle, it would delete it and send dialogue 420; nothing else. What the 'else' is saying is, "If the player does not have a bottle, I should send dialogue 428." That's why it kept going to dialogue 428 even without the bottle.

    If there's hundreds of tutorials about this on google, I sure as heck haven't found any.
    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. [PI] Items on Dialogue (REP++) [/PI]
    By Blaketon in forum Help
    Replies: 8
    Last Post: 01-27-2012, 10:07 PM
  2. [PI] Items on Dialogue (REP++) [/PI]
    By Blaketon in forum Help
    Replies: 0
    Last Post: 01-26-2012, 10:40 PM
  3. Replies: 0
    Last Post: 12-25-2010, 05:34 PM
  4. 508 how to add item with your npc dialogue
    By noi172 in forum Tutorials
    Replies: 8
    Last Post: 03-01-2009, 05:21 PM
  5. Npc Dialogue Item Giving! Help!
    By Core in forum Help
    Replies: 6
    Last Post: 12-08-2008, 04:41 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
  •