Thread: Npc dialogue options.

Results 1 to 5 of 5
  1. #1 Npc dialogue options. 
    I LOVE CHEESE


    Join Date
    Oct 2007
    Age
    26
    Posts
    1,153
    Thanks given
    7
    Thanks received
    8
    Rep Power
    104
    Description: To add npc options to a npc dialogue

    Difficulty: 1

    Assumed Knowledge: C+P

    Tested Server: Cleaned v4

    Files/Classes Modified: Client.java

    Procedure
    Step 1: Open clint.java and search:
    Code:
    case 185:
    under:
    Code:
    switch(actionButtonId) {
    add:
    Code:
    case 9157:
    break;
    case 9158:
    break;
    case 9157 ill be the top option and 9158 will be the bottom
    Step 2: Do something happend when they click option.
    Lets say u want it to make it so if click first option they tele.
    add this to case 9157:
    Code:
    if (NpcDialogue == ##) {
    		PutNPCCoords = true;
    		teleportToX = --;
    		teleportToY = ++;
    RemoveAllWindows();
    }
    every time u add one to this u have to tell the server at wat dialogue is this so that why we add: if (NpcDialogue == ##) { change the ## to ur dialogues case. ++ and -- are ur teleport cords and lets say u want to make it seconds option close it. add this to case 9158:
    Code:
    if (NpcDialogue == ##) {
    RemoveAllWindows();
    }
    That basicaly how in the codes is it wroten it remove all windows so when they click it it will close all but u can make with case 9158 w/e u want just add the code in there and when u click the option will make effect case 9158 aint always for closing.

    Step 3: Adding the options appear in dialogue.
    go to public void updatenpcchat and add:
    Code:
    			case ##:
    				sendFrame171(1, 2465);
    				sendFrame171(0, 2468);
    				sendFrame126("Choose an option", 2460);
    				sendFrame126("Yes, please", 2461);
    				sendFrame126("No, Thanks", 2462);
    				sendFrame164(2459);
    				NpcDialogueSend = true;
    				break;
    This works like ur normals dialogues just that were it says yes,please and no,thanks u can change to any option u want yes please is case 9157 and no, thanks is case 9158


    If u dont have delcare: (ONLY IF U DONT HAVE!)
    Code:
    	public void sendFrame126(String s, int id) {
    		outStream.createFrameVarSizeWord(126);
    		outStream.writeString(s);
    		outStream.writeWordA(id);
    		outStream.endFrameVarSizeWord();
    		flushOutStream();
    	}
    public void sendFrame171(int MainFrame, int SubFrame) {
    		outStream.createFrame(171);
    		outStream.writeByte(MainFrame);
    		outStream.writeWord(SubFrame);
    		flushOutStream();
    	}
    public void sendFrame164(int Frame) {
    		outStream.createFrame(164);
    		outStream.writeWordBigEndian_dup(Frame);
    		flushOutStream();
    	}
    Best i could explain
    Credits: ME


     

  2. #2  
    Banned

    Join Date
    Jan 2008
    Posts
    965
    Thanks given
    2
    Thanks received
    17
    Rep Power
    0
    Very nice tutorial.. i think i will use for my server i dont want portal nemore
     

  3. #3  
    I LOVE CHEESE


    Join Date
    Oct 2007
    Age
    26
    Posts
    1,153
    Thanks given
    7
    Thanks received
    8
    Rep Power
    104
    ty for support mate


     

  4. #4  
    Registered Member
    Anton's Avatar
    Join Date
    Jan 2008
    Posts
    1,197
    Thanks given
    0
    Thanks received
    5
    Rep Power
    249
    That's ripped of my member maker V3 "

    Nice try tough.
     

  5. #5  
    I LOVE CHEESE


    Join Date
    Oct 2007
    Age
    26
    Posts
    1,153
    Thanks given
    7
    Thanks received
    8
    Rep Power
    104
    Rofl ur member maker wat the **** is that rofl? Made 100% by me noob


     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •