[tut] Npc Dialogue (Clean!)

Newbie Spellweaver
Joined
Apr 26, 2008
Messages
16
Reaction score
1
Npc Dialogue
Created by: Roger
Hardness: 3/10

(Roger from Havenworld)

First of all, you got to declare this method..
At the end of your client java add this..

Code:
public void npt() {
  sendFrame200(4883, 591);
  sendFrame126(GetNpcName(NpcTalkTo), 4884);
  sendFrame75(NpcTalkTo, 4883);
  sendFrame164(4882);
  NpcDialogueSend = true;
  }

It's a bit diffrent from other npc dialogue tuts, but this will clean it up in the long run.
Basicilly it tells it when you use the npt(); void to do all this, which sends frame, gets the npc name etc.

In Client.java serach:
Code:
public void UpdateNPCChat() {

Add this...

Code:
case 11:
  npt();
  sendFrame126("What you want to say here?"4885);
  break;

You see that npt();?
That's the void we called on, it does what the void does, just in a shorter form..
It'll save up room when you have to do many dialogues.

The sendFrame126("What you want to say here?"4885); is what the npc will say and the interface ID.
Break; , well you must know what that means.

=============================================


Now, to make it work..
In your Client.java search for..
Code:
First click

Now.. add this
Code:
}
else if (NPCID == ###) {
  skillX = server.npcHandler.npcs[NPCSlot].absX;
  skillY = server.npcHandler.npcs[NPCSlot].absY;
  NpcWanneTalk = %%%;
  }

### = NPC ID
%%% = Case ID



**NOTE**
You must not have the same case or it will not work. For longer converstions read on..
=============================================

Extended NPC DIALOGUE

Let's say we wanted to make more npc dialogue?
Well, we would make some more cases.

After case 11, add case 12, 13, etc.
Well, to do that we must link it.

In Client.java search:
Code:
case 40:

You will perhaps see some things like this..
Code:
if (NpcDialogue == 16 || NpcDialogue == 17 || NpcDialogue == 18) {
  NpcDialogue += 1;
  NpcDialogueSend = false;
    } else if
      ((NpcDialogue == 19)) {
      NpcDialogue = 0;
      NpcDialogueSend = false;
      RemoveAllWindows();
        } else {
        closeInterface();
        }

What it means is, if DIALOGUE CASE = 16 or 17 or 18, go up by ONE case.
But if DIALOGUE case = 19, dont send anything and remove all windows.

You'll get it.. after that bracket you can add what you have learned.
 
Bad tut you dont even tell us how to stick the NPC in a certain place like I know you enter coords but were? Thanks anyway I just find a better more easier tut
 
no this is good, he is assuming you know it.

There are many tuts on how to make NPC's.

I didnt see How to add npc in title? hes talking about dialogue -.-
 
Yea but problem is doesnt really work for me I didnt even think bout using my autospawn 0.0 dont know why sorry bout that earlier but yet still doesnt work for me I done it all in client.java gives me 100 errors when compiling
 
Bad tut you dont even tell us how to stick the NPC in a certain place like I know you enter coords but were? Thanks anyway I just find a better more easier tut

The title actualy says '[tut] Npc Dialogue (Clean!)' which basically means a tut for NPC Dialogue and not a tut for how to create an NPC. Anyway this is a nice tut thanks :thumbup1:
 
Back