Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 7390:
- sendOption2("Yes", "No");
- c.nextChat = 7391;
- break;
- /*Arnold*/
- case 33:
- sendNpcChat4("Hello!", "My names Arnold, pleasure to meet you.", "I'm the treasurer for our little village here", "which means", c.talkingNpc, "Arnold");
- c.nextChat = 34;
- break;
- case 34:
- sendNpcChat4( "I can either sell you items", "or let you acces your bank account", "which would you like", "to do?", c.talkingNpc, "Arnold");
- c.nextChat = 35;
- break;
- case 35:
- c.dialogueAction = 100;
- sendOption2("Trade", "Bank");
- break;
- /*End Arnold*/
- /*Ramu*/
- case 36:
- sendNpcChat4("What do you want?", "I don't even care, I don't have time", "for annoyances like you", "go away!", c.talkingNpc, "Ramaru");
- break;
- /*End Ramu*/
- /*George*/
- case 37:
- sendPlayerChat1("Hello!");
- c.nextChat = 38;
- break;
- case 38:
- sendNpcChat2("Hey there mate!", "What can I do for you?", c.talkingNpc, "George");
- c.nextChat = 39;
- break;
- case 39:
- sendPlayerChat1("Nothing really, I just wanted to chat ");
- c.nextChat = 40;
- break;
- case 40:
- sendNpcChat2("Right..", "I'm really busy right now, so maybe another time", c.talkingNpc, "George");
- break;
- /*End George*/
- 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:
- sendNpcChat4("Hello there.", "I am one of the shop owners here.", "I can sell you basic survival gear.",
- "Would you like to browse through my goods?", c.talkingNpc, "Shop Keeper");
- c.nextChat = 21;
- break;
- case 21:
- sendOption2("Yes", "No");
- c.getShops().openShop(1);
- break;
- case 22:
- sendNpcChat4("Hi there.", "I'm Gerrant, an expert fisher.", "I can sell you any fishing gear you'd need.",
- "Would you like to see what I have in store?", c.talkingNpc, "Gerrant");
- c.nextChat = 23;
- break;
- case 23:
- sendOption2("Yes", "No");
- c.getShops().openShop(2);
- break;
- case 25:
- sendNpcChat4("Hello.", "You look like you could use some food.", "Or maybe some supplies an adventurer like you would need.",
- "Would you like to see what I have to offer?", c.talkingNpc, "Shop Assistant");
- c.nextChat = 26;
- break;
- case 26:
- sendOption2("Yes", "No");
- c.getShops().openShop(3);
- break;
- case 27:
- sendNpcChat4("Hi, I'm a gem trader from Al Kharid.", "I'm a skilled crafter with years of experience", "and I have made many amulets from my gems.",
- "Would you like to see what I have to offer?", c.talkingNpc, "Gem Trader");
- c.nextChat = 28;
- break;
- case 28:
- sendOption2("Yes", "No");
- c.getShops().openShop(7);
- break;
- case 29:
- sendNpcChat4("Hi there.", "I'm a skilled chief and baker with years of experience", "and I have cooked many things.",
- "Would you like to see what I have to offer?", c.talkingNpc, "Baker");
- c.nextChat = 30;
- break;
- case 30:
- sendOption2("Yes", "No");
- c.getShops().openShop(4);
- break;
- case 31:
- sendNpcChat4("Hello", "I sell herblore ingredients", "and vials for good prices.",
- "Would you like to see what I have to offer?", c.talkingNpc, "Jatix");
- c.nextChat = 30;
- break;
- case 32:
- sendOption2("Yes", "No");
- c.getShops().openShop(7);
- break;
- case 41://Lumbridge Guide
- sendNpcChat4("Hello there good sir, I am the Lumbridge guide", "It's my job to give players such as yourself", "directions and advice. I'm a little busy", "right now tho, can you come back later?", c.talkingNpc, "Lumbridge Guide");
- break;
- case 42:
- sendPlayerChat2("Hello there!", "My name is + c.playerName");
- c.nextChat = 43;
- break;
- case 43:
- sendNpcChat1("Oh, hello there + c.playerName", c.talkingNpc, "Man");
- break;
- case 44:
- sendNpcChat2("Oh, hello there lovely.", "I'd love to stay and chat but I have to run, bye!", c.talkingNpc, "Women");
- break;
- case 45:
- sendNpcChat4("Hallo there mate!", "The names Bob, and axes are what I love", "Anyfing I can do fer ya?", c.talkingNpc, "Bob");
- c.nextChat = 46;
- 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
- */
- public 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, 9847);
- c.getPA().sendFrame126(name, 4889);
- c.getPA().sendFrame126(s, 4890);
- c.getPA().sendFrame126(s1, 4891);
- c.getPA().sendFrame75(ChatNpc, 4888);
- c.getPA().sendFrame164(4887);
- }
- public void sendNpcChat3(String s, String s1, String s2, int ChatNpc, String name) {
- c.getPA().sendFrame200(4894, 9847);
- c.getPA().sendFrame126(name, 4895);
- c.getPA().sendFrame126(s, 4896);
- c.getPA().sendFrame126(s1, 4897);
- c.getPA().sendFrame126(s2, 4898);
- c.getPA().sendFrame75(ChatNpc, 4894);
- c.getPA().sendFrame164(4893);
- }
- 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 chats 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);
- }
- }
Add Comment
Please, Sign In to add comment