Code:
package server.model.players;
public class DialogueHandler {
private Client c;
public DialogueHandler(Client client) {
this.c = client;
}
/**
* Handles all talking
* @param dialogue The dialogue you want to use
* @param npcId The npc id that the chat will focus on during the chat
*/
public void sendDialogues(int dialogue, int npcId) {
c.talkingNpc = npcId;
switch(dialogue) {
case 0:
c.talkingNpc = -1;
c.getPA().removeAllWindows();
c.nextChat = 0;
break;
case 1:
sendStatement("You found a hidden tunnel! Do you want to enter it?");
c.dialogueAction = 1;
c.nextChat = 2;
break;
case 2:
sendOption2("Yea! I'm fearless!", "No way! That looks scary!");
c.dialogueAction = 1;
c.nextChat = 0;
break;
case 3:
sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I can assign you a slayer task suitable to your combat level.",
"Would you like a slayer task?", c.talkingNpc, "Duradel");
c.nextChat = 4;
break;
case 5:
sendNpcChat4("Hello adventurer...", "My name is Kolodion, the master of this mage bank.", "Would you like to play a minigame in order ",
"to earn points towards recieving magic related prizes?", c.talkingNpc, "Kolodion");
c.nextChat = 6;
break;
case 6:
sendNpcChat4("The way the game works is as follows...", "You will be teleported to the wilderness,",
"You must kill mages to recieve points,","redeem points with the chamber guardian.", c.talkingNpc, "Kolodion");
c.nextChat = 15;
break;
case 11:
sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I can assign you a slayer task suitable to your combat level.",
"Would you like a slayer task?", c.talkingNpc, "Duradel");
c.nextChat = 12;
break;
case 12:
sendOption2("Yes I would like a slayer task.", "No I would not like a slayer task.");
c.dialogueAction = 5;
break;
case 13:
sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I see I have already assigned you a task to complete.",
"Would you like me to give you an easier task?", c.talkingNpc, "Duradel");
c.nextChat = 14;
break;
case 14:
sendOption2("Yes I would like an easier task.", "No I would like to keep my task.");
c.dialogueAction = 6;
break;
case 15:
sendOption2("Yes I would like to play", "No, sounds too dangerous for me.");
c.dialogueAction = 7;
break;
case 16:
sendOption2("I would like to reset my barrows brothers.", "I would like to fix all my barrows");
c.dialogueAction = 8;
break;
case 17:
sendOption5("Air", "Mind", "Water", "Earth", "More");
c.dialogueAction = 10;
c.dialogueId = 17;
c.teleAction = -1;
break;
case 18:
sendOption5("Fire", "Body", "Cosmic", "Astral", "More");
c.dialogueAction = 11;
c.dialogueId = 18;
c.teleAction = -1;
break;
case 19:
sendOption5("Nature", "Law", "Death", "Blood", "More");
c.dialogueAction = 12;
c.dialogueId = 19;
c.teleAction = -1;
break;
case 20:
sendNpcChat2("Hello "+c.playerName+", Welcome to Runescape.","The owner is Santiago", c.talkingNpc, "Hans");
c.nextChat = 21;
break;
case 21:
sendNpcChat2("Remember forums!","http://www.runescape.com", c.talkingNpc, "Hans");
c.nextChat = 22;
break;
case 22:
sendPlayerChat1("Ok bro, Thanks for this!");
c.nextChat = 23;
break;
case 23:
sendNpcChat2("Other thing you need to know is that Mods And Admins","Got a crown before their names.", c.talkingNpc, "Hans");
c.nextChat = 24;
break;
case 24:
sendNpcChat2("You'll find players with the Donator Rank they are awesome.","Donator Rank Can be purchased for 5m rsgp or $5.", c.talkingNpc, "Hans");
c.nextChat = 25;
break;
case 25:
sendNpcChat2("Donators got awesome benefits and..","If you need more Help, Pm Santiago.", c.talkingNpc, "Hans");
c.nextChat = 26;
break;
case 26:
sendPlayerChat1("Okay Thanks, TTYL.");
break;
case 27:
sendNpcChat2("Hello "+c.playerName+", Welcome to Runescape.","I will tell you the rules!", c.talkingNpc, "Harry");
c.nextChat = 28;
break;
case 28:
sendNpcChat2("No hacking. No spamming.","No glitching. No autotypers/clickers.", c.talkingNpc, "Harry");
c.nextChat = 29;
break;
case 29:
sendNpcChat2("Do not abuse your powers.","Do not annoy Santiago. No offensive language.", c.talkingNpc, "Harry");
c.nextChat = 30;
break;
case 30:
sendPlayerChat1("Is there some rules about real runescape?");
c.nextChat = 31;
break;
case 31:
sendNpcChat2("Yeah, Dont trade Rs accounts","or runescape GP here.", c.talkingNpc, "Harry");
c.nextChat = 32;
break;
case 32:
sendPlayerChat1("Okay man, I remember the rules.");
c.nextChat = 33;
break;
case 33:
sendNpcChat2("If you forget one just talk with me again.","Good luck with the server.", c.talkingNpc, "Harry");
c.nextChat = 34;
break;
case 34:
sendPlayerChat1("Okay bro thanks for all your help.");
c.nextChat = 3000000;
break;
}
}
/*
* Information Box
*/
public void sendStartInfo(String text, String text1, String text2, String text3, String title) {
c.getPA().sendFrame126(title, 6180);
c.getPA().sendFrame126(text, 6181);
c.getPA().sendFrame126(text1, 6182);
c.getPA().sendFrame126(text2, 6183);
c.getPA().sendFrame126(text3, 6184);
c.getPA().sendFrame164(6179);
}
/*
* Options
*/
private void sendOption(String s, String s1) {
c.getPA().sendFrame126("Select an Option", 2470);
c.getPA().sendFrame126(s, 2471);
c.getPA().sendFrame126(s1, 2472);
c.getPA().sendFrame126("Click here to continue", 2473);
c.getPA().sendFrame164(13758);
}
private void sendOption2(String s, String s1) {
c.getPA().sendFrame126("Select an Option", 2460);
c.getPA().sendFrame126(s, 2461);
c.getPA().sendFrame126(s1, 2462);
c.getPA().sendFrame164(2459);
}
private void sendOption3(String s, String s1, String s2) {
c.getPA().sendFrame126("Select an Option", 2460);
c.getPA().sendFrame126(s, 2461);
c.getPA().sendFrame126(s1, 2462);
c.getPA().sendFrame126(s2, 2462);
c.getPA().sendFrame164(2459);
}
public void sendOption4(String s, String s1, String s2, String s3) {
c.getPA().sendFrame126("Select an Option", 2481);
c.getPA().sendFrame126(s, 2482);
c.getPA().sendFrame126(s1, 2483);
c.getPA().sendFrame126(s2, 2484);
c.getPA().sendFrame126(s3, 2485);
c.getPA().sendFrame164(2480);
}
public void sendOption5(String s, String s1, String s2, String s3, String s4) {
c.getPA().sendFrame126("Select an Option", 2493);
c.getPA().sendFrame126(s, 2494);
c.getPA().sendFrame126(s1, 2495);
c.getPA().sendFrame126(s2, 2496);
c.getPA().sendFrame126(s3, 2497);
c.getPA().sendFrame126(s4, 2498);
c.getPA().sendFrame164(2492);
}
/*
* Statements
*/
private void sendStatement(String s) { // 1 line click here to continue chat box interface
c.getPA().sendFrame126(s, 357);
c.getPA().sendFrame126("Click here to continue", 358);
c.getPA().sendFrame164(356);
}
/*
* Npc Chatting
*/
private void sendNpcChat1(String s) {
}
private void sendNpcChat2(String s, String s1, int ChatNpc, String name) {
c.getPA().sendFrame200(4888, 591);
c.getPA().sendFrame126(name, 4889);
c.getPA().sendFrame126(s, 4890);
c.getPA().sendFrame126(s1, 4891);
c.getPA().sendFrame75(ChatNpc, 4888);
c.getPA().sendFrame164(4887);
}
private void sendNpcChat4(String s, String s1, String s2, String s3, int ChatNpc, String name) {
c.getPA().sendFrame200(4901, 591);
c.getPA().sendFrame126(name, 4902);
c.getPA().sendFrame126(s, 4903);
c.getPA().sendFrame126(s1, 4904);
c.getPA().sendFrame126(s2, 4905);
c.getPA().sendFrame126(s3, 4906);
c.getPA().sendFrame75(ChatNpc, 4901);
c.getPA().sendFrame164(4900);
}
/*
* Player Chating Back
*/
private void sendPlayerChat1(String s) {
c.getPA().sendFrame200(969, 591);
c.getPA().sendFrame126(c.playerName, 970);
c.getPA().sendFrame126(s, 971);
c.getPA().sendFrame185(969);
c.getPA().sendFrame164(968);
}
private void sendPlayerChat2(String s, String s1) {
c.getPA().sendFrame200(974, 591);
c.getPA().sendFrame126(c.playerName, 975);
c.getPA().sendFrame126(s, 976);
c.getPA().sendFrame126(s1, 977);
c.getPA().sendFrame185(974);
c.getPA().sendFrame164(973);
}
private void sendPlayerChat3(String s, String s1, String s2) {
c.getPA().sendFrame200(980, 591);
c.getPA().sendFrame126(c.playerName, 981);
c.getPA().sendFrame126(s, 982);
c.getPA().sendFrame126(s1, 983);
c.getPA().sendFrame126(s2, 984);
c.getPA().sendFrame185(980);
c.getPA().sendFrame164(979);
}
private void sendPlayerChat4(String s, String s1, String s2, String s3) {
c.getPA().sendFrame200(987, 591);
c.getPA().sendFrame126(c.playerName, 988);
c.getPA().sendFrame126(s, 989);
c.getPA().sendFrame126(s1, 990);
c.getPA().sendFrame126(s2, 991);
c.getPA().sendFrame126(s3, 992);
c.getPA().sendFrame185(987);
c.getPA().sendFrame164(986);
}
}
Now you are going to make a new case.