Code-x
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Code-x

Code-x Private Server
 
HomeHome  PortalPortal  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Object Clicked Showes NPC Dialog

Go down 
AuthorMessage
Purehit
Newbie
Newbie



Number of posts : 13
Registration date : 2008-06-27

Object Clicked Showes NPC Dialog Empty
PostSubject: Object Clicked Showes NPC Dialog   Object Clicked Showes NPC Dialog Icon_minitimeWed Jul 16, 2008 10:18 pm

Purpose: To make so when you click an object, you get npc dialog.

Difficulty: Easy

Server Base:
Any

Classes Modified:
Client.java

Ok, let's get started. First open up your client.java and search for:

Code:
// first Click npc

Now scroll down, until you see this:

Code:
NpcWanneTalk = A NUMBER WILL BE HERE;

Now look for the last little piece of code that has that in it. And below it add this:

Code:
else if (NPCID == NPC ID HERE) {
                                 skillX = server.npcHandler.npcs[NPCSlot].absX;
                                 skillY = server.npcHandler.npcs[NPCSlot].absY;
                                                NpcWanneTalk = CASE NUMBER HERE;

Now where it says NPC ID HERE of course you put the id of the NPC so let's use 656 as an example. Now where it says CASE NUMBER HERE you put in the case number where your NPC Dialog information will be, don't worry I'll get to that soon. So let's use 100 as our case number for an example.

Ok now your code should look like this:

Code:
else if (NPCID == 656) {
                                 skillX = server.npcHandler.npcs[NPCSlot].absX;
                                 skillY = server.npcHandler.npcs[NPCSlot].absY;
                                                NpcWanneTalk = 100;

Ok good. Now search for the following:

Code:
case 1306:


If you don't have that, you should, but if you don't search for this:

Code:
case "ID OF AN OBJECT IN YOUR SERVER":

For you people that would keep "ID OF AN OBJECT IN YOUR SERVER" there, don't. Do what it says.

Ok so after when you search that in, you should see "break;" after all the codes in that case. Well after "break;" press enter. So after we press enter paste the following:

Code:
case YOUROBJECTID:
VoidForDialog();
break;

Ok so replace YOUROBJECTID with the object id that you want to click so the npc dialog shows. Let's use 300 as an example, which is a hay stack.


Now add this void:

Code:
                public void VoidForDialog() {
                        sendFrame200(4901, 591);
                 sendFrame126(GetNpcName(NpcTalkTo), 4902);
                  sendFrame126("", 4903);
                  sendFrame126("This is PRIVATE PROPERTY!", 4904);
                 sendFrame126("Get away from here now!", 4905);
                  sendFrame126("", 4906);
                  sendFrame75(NpcTalkTo, 4901);
                  sendFrame164(4900);
                  NpcDialogueSend = true;
   }

There! Now your done! Click your object and it should do something like this:

Object Clicked Showes NPC Dialog K5V84142

Thanks for reading this tutorial! Hoped it helped!

Credits: Purehit, Seven Lives (Both Me)
Back to top Go down
 
Object Clicked Showes NPC Dialog
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Code-x :: General Chat :: runescape private [TUT] section-
Jump to: