Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[tut] Npc Dialogue (Clean!)

Initiate Mage
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.
 
Junior Spellweaver
Joined
May 14, 2007
Messages
123
Reaction score
0
Re: Npc Dialogue (Clean!)

Nice, cleanly set out, easy to read, great for new people to use!
 
change my name already!
Member
Joined
Apr 10, 2007
Messages
3,202
Reaction score
1,956
Re: Npc Dialogue (Clean!)

You forgot the [Tut] tags mate :p

But pretty cool guide!
 
Junior Spellweaver
Joined
May 14, 2007
Messages
123
Reaction score
0
is this for what they NPC say above there heads, or what they say when you talk to them?
 
Canadian
Member
Joined
Dec 4, 2007
Messages
1,936
Reaction score
96
is this for what they NPC say above there heads, or what they say when you talk to them?

Dialogue would be what they say to you. To change what's over their heads, as I recall, you go into NPCHandler.java or something of the sort.
 
Junior Spellweaver
Joined
May 14, 2007
Messages
123
Reaction score
0
yeah i got it now, Figured it out for myself!
 
Initiate Mage
Joined
Apr 12, 2008
Messages
7
Reaction score
0
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
 
Junior Spellweaver
Joined
May 14, 2007
Messages
123
Reaction score
0
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 -.-
 
Initiate Mage
Joined
Apr 12, 2008
Messages
7
Reaction score
0
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
 
Initiate Mage
Joined
Feb 16, 2009
Messages
24
Reaction score
0
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
Top