scootersam
July 20th, 2010, 01:51
well this is a npc dialogue tut, i stugled on this untill i downloaded cjs source and looked how to do it...
so 50% creds to him and the rest to me but here i go
ok open up dialogue options.java and npcpacket handler
we will start with npc packet handler
so you want to add this part in, it makes the npc start the dialogue.
if(npc.getId() == ###) {
p.turnTemporarilyTo(npc);
npc.turnTemporarilyTo(p);
p.getActionSender().sendChatboxInterface(241);
p.getActionSender().animateInterface(9849, 241, 2);
p.getActionSender().sendNPCOnInterface(####, 241, 2);
p.getActionSender().sendString("npc namet", 241, 3);
p.getActionSender().sendString("your start chat of your dialogue", 241, 4);
p.what u will difine in player.java = 1;
}
#### = npc id
you want to add your text in there and your npc ids etc
now open up dialogueoptions.java
and add this
if(player.DukeD == 1) {
player.what u wiill difine = 0;
this.sendDialouge(player, "Hi .", ""+player.getUsername(), 0);
player.what you will difine = 2;
break;
}
}
at the end just before =2 that goes on tochatbox number 2 so for each chatbox make sure thats an extra number.. and for the top one that has to be the same as the one on the bottom accept the first chatbox is allways 0
ok nwo to difine your dialogue
open player.java
and add this
public int (the name you want but without brackets);
and thats it i hope i helped out =/
so 50% creds to him and the rest to me but here i go
ok open up dialogue options.java and npcpacket handler
we will start with npc packet handler
so you want to add this part in, it makes the npc start the dialogue.
if(npc.getId() == ###) {
p.turnTemporarilyTo(npc);
npc.turnTemporarilyTo(p);
p.getActionSender().sendChatboxInterface(241);
p.getActionSender().animateInterface(9849, 241, 2);
p.getActionSender().sendNPCOnInterface(####, 241, 2);
p.getActionSender().sendString("npc namet", 241, 3);
p.getActionSender().sendString("your start chat of your dialogue", 241, 4);
p.what u will difine in player.java = 1;
}
#### = npc id
you want to add your text in there and your npc ids etc
now open up dialogueoptions.java
and add this
if(player.DukeD == 1) {
player.what u wiill difine = 0;
this.sendDialouge(player, "Hi .", ""+player.getUsername(), 0);
player.what you will difine = 2;
break;
}
}
at the end just before =2 that goes on tochatbox number 2 so for each chatbox make sure thats an extra number.. and for the top one that has to be the same as the one on the bottom accept the first chatbox is allways 0
ok nwo to difine your dialogue
open player.java
and add this
public int (the name you want but without brackets);
and thats it i hope i helped out =/