- 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..
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:
Add this...
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..
Now.. add this
### = 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:
You will perhaps see some things like this..
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.
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.