Thread: Adding dialogues to your Project Insanity

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1 Adding dialogues to your Project Insanity 
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Purpose: To add dialogues to your server.
    Difficulty: 1/10
    Assumed Knowledge: Common sense
    Classes Modified: DialogueHandler.java and ActionHandler.java


    First open your DialogueHandler.java and you'll see something like this:
    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.
    Code:
    		case 35:
    			sendNpcChat2("TEXT NUMBER 1","TEXT NUMBER 2.", c.talkingNpc, "NPCNAME");
    			c.nextChat = ID FOR CASE YOU WANT TO SHOW WHEN U CLICK "CLICK HERE TO CONTINUE";
    		break;
    If you edit that it will look something like this.
    Code:
    		case 35:
    			sendNpcChat2("Welcome to Runescape.","http://www.runescape.com", c.talkingNpc, "Man");
    			c.nextChat = 36;
    		break;
    If you want your Character to talk to him then create a new case and at the "c.nextChat = (add the id of that case here so when u click "click here to continue" it shows the reply);"
    Code:
                    case 36:
    			sendPlayerChat1("TEXT HERE.");
    		break;
    When you modify it its going to look like this.
    Code:
                    case 36:
    			sendPlayerChat1("Okay.");
    		break;
    Now go to Actionhandler.java and search for
    Code:
    	public void firstClickNpc(int npcType) {
    		c.clickNpcType = 0;
    		c.npcClickIndex = 0;
    		switch(npcType) {
    Here you are going to add the dialogue to the npc you selected (Man).
    Create a new case:
    Code:
    			case (NPC ID HERE):
    				c.getDH().sendDialogues((DIALOGUE CASE ID HERE), npcType);
    			break;
    If you edit it its going to look like this:
    Code:
    			case 2:
    				c.getDH().sendDialogues(35, npcType);
    			break;
    Now just compile and you will get this.

    If i helped you, there's a thanks button
    If you get any error (its almost impossible to get one) add me on msn/skype
    MSN: [Only registered and activated users can see links. ]
    SKYPE: santiagolimonta
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    FuckThePolice's Avatar
    Join Date
    Feb 2009
    Age
    27
    Posts
    846
    Thanks given
    29
    Thanks received
    57
    Rep Power
    87
    Nice tut explains alot and its colorful me likey colors and penguins..
    Reply With Quote  
     

  4. #3  
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Thanks max, This is my third tutorial :3
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

  5. #4  
    The One And Only

    KaiserCo's Avatar
    Join Date
    Dec 2010
    Posts
    2,420
    Thanks given
    509
    Thanks received
    445
    Rep Power
    209
    add onto it about dialogue actions cause those mindfuck me
    Reply With Quote  
     

  6. #5  
    AleroBio Owner

    Join Date
    Feb 2011
    Posts
    362
    Thanks given
    26
    Thanks received
    13
    Rep Power
    0
    looks good... good job
    Reply With Quote  
     

  7. #6  
    Banned
    Join Date
    Jan 2010
    Posts
    189
    Thanks given
    1
    Thanks received
    6
    Rep Power
    0
    Lookin pretty good there Fury!
    Keep up the good work!
    Reply With Quote  
     

  8. #7  
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Quote Originally Posted by gunnz94 View Post
    Lookin pretty good there Fury!
    Keep up the good work!
    Thanks man, BTW call me santiago not fury ;D
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    Mar 2011
    Posts
    4,064
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by Mac Miller View Post
    add onto it about dialogue actions cause those mindfuck me
    those are basically used for actionButtons,because when you add sendOptions the ActionButtons are from 9191-9194 so with the dialogueActions youll be able to tell them apart so when you want to add an action to it youll do something like

    heres an example

    I want a dialogue to tele me somewhere so in DH ill add

    Code:
    case 1014:
    sendOption2("Yes, I want to be teleported",  "No");
    c.dialogueAction = 1014;
    c.nextChat = 5;
    break;
    then in ClickingButtons i would add

    Code:
    } else if (c.dialogueAction == 1014) { // this is why you need a dialogue action
                      c.getPA().movePlayer( ####, ####, #);		
    }
    Reply With Quote  
     

  10. Thankful user:


  11. #9  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    26
    Posts
    9,736
    Thanks given
    1,754
    Thanks received
    3,102
    Rep Power
    5000
    vary nice and simple.
    hopefully more servers of today will have more of this
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  12. #10  
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Quote Originally Posted by xxifish i x View Post
    vary nice and simple.
    hopefully more servers of today will have more of this
    Thanks man ;D yeah very simple.
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

Page 1 of 4 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Adding drops on Project Insanity?
    By Throat in forum Help
    Replies: 3
    Last Post: 04-25-2012, 12:43 PM
  2. Project Insanity (Adding stats to potions)
    By Juggalo Family in forum Help
    Replies: 7
    Last Post: 09-01-2010, 03:05 AM
  3. Replies: 3
    Last Post: 05-09-2010, 05:40 PM
  4. Adding Lunar spellbook on project insanity
    By pineapple pie in forum Requests
    Replies: 0
    Last Post: 05-02-2010, 05:46 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •