Thread: Project NoDoze - Npc Dialogue

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Project NoDoze - Npc Dialogue 
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    Yes can be done a lot better, and will this snippet shall be updated when I get round to finishing a better version off, my reason of posting this snippet is that it seems to me that people are not using the base due to a few reasons, this being one of them. Anyway...


    Client class
    Code:
    public int TalkingNpcId = -1, nextDialogueId = 0;
    Code:
    	private DialogueHandler dialogueHandler = new DialogueHandler(this);
    	
    	public DialogueHandler getDialogueHandler() {
    		return dialogueHandler;
    	}

    DialogueAction class
    Code:
    		if(client.nextDialogueId > 0)
    			client.getDialogueHandler().sendDialogues(client.nextDialogueId, client.clickedNPCID);
    		else
    			client.getDialogueHandler().sendDialogues(0, -1);

    Create new class named DialogueHandler
    Code:
    package com.rs2.model.npc;
    
    import com.rs2.model.player.Client;
    
    public class DialogueHandler {
    	
    	private Client client;
    	
    	public DialogueHandler(Client client) {
    		this.client = client;
    	}
    	public void sendDialogues(int dialogue, int NpcId) {
    		NpcId = client.TalkingNpcId;
    		switch (dialogue) {
    		case 1:
    			client.getActionSender().sendNpcDialogue("Hello my name is Ghost.", "I have some business to be doing...", "Ghost", NpcId);
    			client.nextDialogueId = 2;
    			break;
    		case 2:
    			client.getActionSender().sendNpcDialogue("Bye", "[cough]Noob.[/cough]", "Ghost", NpcId);
    			client.nextDialogueId = 0;
    			break;
    		}
    	}
    }

    ActionSender class
    Code:
    	/**
    	* Npc's Dialogue.
    	*/
    	
    	public void sendNpcDialogue(String message, String NpcName, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(NpcName, 4889);
    		sendQuest(message, 4890);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);
    		
    	}
    
    	public void sendNpcDialogue(String message, String message1, String name, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(name, 4889);
    		sendQuest(message, 4890);
    		sendQuest(message1, 4891);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);
    	}
    	
    	public void sendNpcDialogue(String message, String message1, String message2, String name, int NpcId) {
    		sendFrame200(4894, 591);
    		sendQuest(name, 4895);
    		sendQuest(message, 4896);
    		sendQuest(message1, 4897);
    		sendQuest(message2, 4898);
    		sendFrame75(NpcId, 4894);
    		sendFrame164(4893);
    	}
    	
    	public void sendNpcDialogue(String message, String message1, String message2, String message3, String name, int NpcId) {
    		sendFrame200(4901, 591);
    		sendQuest(name, 4902);
    		sendQuest(message, 4903);
    		sendQuest(message1, 4904);
    		sendQuest(message2, 4905);
    		sendQuest(message3, 4906);
    		sendFrame75(NpcId, 4901);
    		sendFrame164(4900);
    	}

    Usage.

    WalkToNpc class
    Find
    Code:
    /** 1st click npc **/
    Or (depending on the npc)

    Code:
    /** 2nd click npc **/
    Then add
    Code:
    			case NpcId:
    						return 2;//Dialogues
    Obviously change NpcId, scroll up find
    Code:
    public static void startTask(Client client) {
    Then go down to
    Code:
    case TALK:
    add
    Code:
    			switch (client.clickedNPCID) {
    			case NpcId:
    				client.getDialogueHandler().sendDialogues(dialogueId, client.clickedNPCID);
    				break;
    			default:
    				client.getDialogueHandler().sendDialogues(-1, client.clickedNPCID);
    				break;
    			}
    Once again change the dialogueId. There you go dialogues for no-doze, obviously this was done in minutes, just for the noobs that dont know how rip something as small as this and who are complaining.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    I'll be adding player dialogue methods later, cba to do it now.
    Reply With Quote  
     

  4. #3  
    Registered Member rs r's Avatar
    Join Date
    Oct 2009
    Age
    27
    Posts
    268
    Thanks given
    31
    Thanks received
    6
    Rep Power
    6
    Nvm didnt read


    Nice thanks for this
    Reply With Quote  
     

  5. #4  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    I guess not many people use no-doze...
    Reply With Quote  
     

  6. #5  
    Registered Member Aintaro.'s Avatar
    Join Date
    Sep 2010
    Posts
    998
    Thanks given
    188
    Thanks received
    213
    Rep Power
    37
    Code:
    public void sendNpcDialogue(String message, String NpcName, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(NpcName, 4889);
    		sendQuest(message, 4890);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);	
    	}
    can be
    Code:
    public void sendNpcDialogue(String message, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(npcHandler.getNpcListName(npcId), 4889);
    		sendQuest(message, 4890);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);	
    	}
    other than that, goodjob i guess.

    btw, Never heard of project no doze
    Reply With Quote  
     

  7. #6  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    Shut up man... and where's the difference, you just fucking silly blud :@. Nah jk, thanks for pointing out i suppose, but you're wrong, no-doze is shard base. It would be like
    Code:
    public void sendNpcDialogue(String message, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(GameEngine.getNPCManager().npcDefinitions.get(NpcId).getName();, 4889);
    		sendQuest(message, 4890);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);	
    	}
    Reply With Quote  
     

  8. #7  
    Registered Member Aintaro.'s Avatar
    Join Date
    Sep 2010
    Posts
    998
    Thanks given
    188
    Thanks received
    213
    Rep Power
    37
    Quote Originally Posted by FPS Russia View Post
    Shut up man... and where's the difference, you just silly blud.
    to be exactly.

    public void sendNpcDialogue(String message, int NpcId) {
    sendFrame200(4888, 591);
    sendQuest(npcHandler.getNpcListName(npcId), 4889);
    sendQuest(message, 4890);
    sendFrame75(NpcId, 4888);
    sendFrame164(4887);
    }
    Reply With Quote  
     

  9. #8  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    Read it now... lol, I went for a shit, whilst editing my post... And you mean to be exact.
    Reply With Quote  
     

  10. #9  
    Registered Member Aintaro.'s Avatar
    Join Date
    Sep 2010
    Posts
    998
    Thanks given
    188
    Thanks received
    213
    Rep Power
    37
    Quote Originally Posted by FPS Russia View Post
    Shut up man... and where's the difference, you just fucking silly blud :@. Nah jk, thanks for pointing out i suppose, but you're wrong, no-doze is shard base. It would be like
    Code:
    public void sendNpcDialogue(String message, int NpcId) {
    		sendFrame200(4888, 591);
    		sendQuest(GameEngine.getNPCManager().npcDefinitions.get(NpcId).getName();, 4889);
    		sendQuest(message, 4890);
    		sendFrame75(NpcId, 4888);
    		sendFrame164(4887);	
    	}
    No problem, time is money.
    Reply With Quote  
     

  11. #10  
    Project NoDoze - Npc Dialogue



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    good job but you can send all the dialogue frames in one method lol

    Attached image
    Reply With Quote  
     

Page 1 of 2 12 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. Replies: 15
    Last Post: 07-05-2011, 05:55 AM
  2. Object Spawning (Project nodoze) (paypal)
    By Agent Dev++ in forum Help
    Replies: 3
    Last Post: 05-18-2011, 04:05 AM
  3. Replies: 17
    Last Post: 01-01-2010, 08:02 PM
  4. Replies: 1
    Last Post: 03-05-2008, 12:47 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •