ADMIN PLEASE REMOVE UNCOMPLETED FORM THE TITLE - thanks.
This is a simple npcdialogue handler I made.
This probably can be coded neater and made more efficient, v1.3 for now:
Code:
/* @DialogueHandler
* ------V1.4--------
* -Feel free to use and change whatever you want-
* Coded by Xxislx from rune-server.ee
*/
public class DialogueHandler {
public void UpdateNPCChat2(int a) {
client c = (client) server.playerHandler.players[a];
switch(c.NpcDialogue) {
default:
c.talk("It looks like I dont have anything to say, tell the admin", 1);
break;
case 4:
c.talk2("This is a test", "i am testing if dialogue is working", 1);
break;
case 5:
c.talk2("As you can see i can continue on talking", "looks like this works", 1);
break;
case 6:
c.ptalk("Cool looks that i can talk too", "");
break;
case 8:
c.choice("Yes", "No");
}
}
public void moveon (int a) {
client c = (client) server.playerHandler.players[a];
switch(c.NpcDialogue) {
case 4:
case 5:
c.NpcDialogue += 1;
c.NpcDialogueSend = false;
break;
case 6:
c.NpcDialogue = 0;
c.NpcDialogueSend = false;
c.RemoveAllWindows();
break;
}
}
public void yesorno (int a){
client c = (client) server.playerHandler.players[a];
switch (c.actionButtonId){
case 9159://this is the upper text
switch (c.NpcDialogue) {
case 8:
//What ever you want goes here add c.
break;
}
break;
case 9158:
switch (c.NpcDialogue) {
case 8:
//What ever you want to do, add c.
break;
}
break;
}
}
}
This goes in client:
Code:
public void talk2(String text, String text2, int npc) {
sendFrame200(4901, 591);
sendFrame126(GetNpcName(npc), 4902);
sendFrame126("", 4903);
sendFrame126(text, 4904);
sendFrame126(text2, 4905);
sendFrame126("", 4906);
sendFrame75(npc, 4901);
sendFrame164(4900);
NpcDialogueSend = true;
}
Also in client if you want player to talk and options
Code:
public void choice(String text, String text2){
changeText126("Select an Option", 2460);
changeText126(text, 2461);
changeText126(text2, 2462);
sendFrame164(2459);
}
public void ptalk(String text, String text2) {
sendFrame200(615, 974);
sendFrame126(playerName, 975);
sendFrame126(text, 976);
sendFrame126(text2, 977);
sendFrame185(974);
sendFrame164(973);
NpcDialogueSend = true;
}
This goes on ur updatenpcchat void
Code:
server.DialogueHandler.UpdateNPCChat2(playerId);
this goes below case 40:
Code:
if (NpcDialogue != 0){
server.DialogueHandler.moveon(playerId);
}
this goes below case 185:
Code:
server.DialogueHandler.yesorno(playerId);
Pics:

LOG: -You don't have to read the following
v 1.0- Only supports dialogue.
V 1.1- Supports case 40.
V 1.2- Added player dialogue example
v 1.3- Using switching statement for case 40.
v 1.4- Added supports for choice, case 9158 and 9159