xxavixx
Apprentice
Description: Add working Npc dialogues with options
Difficulty: 1/10
Assumed Knowledge: Basic java.
Tested Server: Czar
Files/Classes Modified: Client.java
Procedure
Step 1: Go into your client.java and look for:
Step 2: Now add this: (change the case number to an unused one)
Step 3: For selection an option you add: (change the case number to an unused one).
Step 4: For making dialogue continue, search for:
Then you will see something like this:
Copy this and change the # for the case number of the first dialogue.
Now scroll down a little and you will see something similar to what you saw before but like this:
Add The option dialogue case number.
Step 5: Making Options work:
For this part, we will be working with case 9157 and 9158.
Case 9157 = OPTION 1 (most of the time the "yes" option)
Case 9158 = OPTION 2 (most of the time the "no" option)
Search for:
This is the basic OPTION 1:
You can add a lot of stuff here for example:
The thing above can be used for case 9158, but mostly it is the "no" option, so you can add something like this:
Credits: xxavixx
Difficulty: 1/10
Assumed Knowledge: Basic java.
Tested Server: Czar
Files/Classes Modified: Client.java
Procedure
Step 1: Go into your client.java and look for:
Code:
public void UpdateNPCChat() {
Step 2: Now add this: (change the case number to an unused one)
Code:
case #:
sendFrame200(4883, 591);
sendFrame126(GetNpcName(NpcTalkTo), 4884);
sendFrame126("What you want npc to say", 4885);
sendFrame75(NpcTalkTo, 4883);
sendFrame164(4882);
NpcDialogueSend = true;
break;
Step 3: For selection an option you add: (change the case number to an unused one).
Code:
case #:
sendFrame171(1, 2465);
sendFrame171(0, 2468);
sendFrame126("Select an Option", 2460);
sendFrame126("OPTION 1", 2461);
sendFrame126("OPTION 2.", 2462);
sendFrame164(2459);
NpcDialogueSend = true;
break
Step 4: For making dialogue continue, search for:
Code:
case 40:
Then you will see something like this:
Code:
if (NpcDialogue == 1 || NpcDialogue == 3)
NpcDialogue += 1;//this is saying that if npc dialogue is 1, go to 2.
NpcDialogueSend = false;
Copy this and change the # for the case number of the first dialogue.
Code:
|| NpcDialogue == #
Now scroll down a little and you will see something similar to what you saw before but like this:
Code:
if (NpcDialogue == # || NpcDialogue == #)
NpcDialogue = 0;//this mean the dialogue is
NpcDialogueSend = false;//discontinued
RemoveAllWindows();
Add The option dialogue case number.
Step 5: Making Options work:
For this part, we will be working with case 9157 and 9158.
Case 9157 = OPTION 1 (most of the time the "yes" option)
Case 9158 = OPTION 2 (most of the time the "no" option)
Search for:
Code:
case 9157
This is the basic OPTION 1:
Code:
else if (NpcDialogue == #) {
NpcDialogue = #;// this tells it to send a new dialogue.
NpcDialogueSend = false;
}
You can add a lot of stuff here for example:
Code:
RemoveAllWindows();
customCommand("a command");
sendFrame126("What you want to say", 4885);
sendMessage("What u want to say");
teleportToX = ####;
teleportToY = ####;
openUpBank();
openUpShop(shop number);
The thing above can be used for case 9158, but mostly it is the "no" option, so you can add something like this:
Code:
else if (NpcDialogue == 41) {
NpcDialogue = 0;
NpcDialogueSend = false;
RemoveAllWindows();
}//this those nothing and closes the dialogue.
Credits: xxavixx

