PI 317 Easiest Way to make even a non talking NPC talk and teleport you! 5 minutes!
Probably usually more difficult but I made this simple. If you can spawn an NPC you can figure this out for sure
difficulty now 1/10
I made this because I looked for a while for the easiest way, and then I just decided to copy exactly how the routes were for the NPC's that already teleported me and I feel like I have an easier way to put things for people who maybe think like me to understand this is a three step process.
starting from finish to beginning in the teleport process I felt worked better so here's how I'd do it from now on.
#1 In clicking buttons.Java
Code:
}
if (c.dialogueAction == 18400) {
TeleportExecutor.teleport(c, new Position(3094, 3243, 0));
c.getPA().closeAllWindows();
18400 is the dialogue action that causes the teleportexecutor to commence.
obviously the new position has the X then Y coordinates
#2 In dialoguehandler.java
Code:
case 18400:
sendNpcChat2("Hello there, young adventurer!",
"Would you like to go to Draynor?", c.talkingNpc,
"Go to Draynor");
c.nextChat = 18401;
break;
case 18401:
sendOption2("Yes",
"No");
c.dialogueAction = 18400;
c.nextChat = 0;
18400 on this line is the dialogue action that triggers the teleport so they must match
next chat 18401 causes case 18401 to load for the last step of this process to happen.. Edit what he says and coordinates so far and it will function after the last step
#3 this would be the most sensitive part so make sure you place it in the right space
In Actionhandler.Java you must match the case to the NPC desired to speak all of this above.
Paste what is below between other cases and it should run smoothly
Code:
case 6080:
c.getDH().sendDialogues(18400, npcType);
break;
so case 6080 is the gnome trainer just fyi
so match this to any npc ID you wish and then spawn that NPC and it would say exactly this. Make sure numbers don't duplicate and it'll work fine
If you have problems make sure the process works in order from 3-1 with the next numbers in this sequence all matching
If you have questions feel free to post or message me