npcs[i].forceChat("Hi I'm an npc.");
To make them talk all the time go to NPCHandler.java under the npc folder search for process() and put this under that void
if (npcs[i].npcType == NPCID){
if (Misc.random(2) <= 3) {
npcs[i].updateRequired = true;
npcs[i].forceChat("I'm talking all the time!!!!");
}
}
To make it when you attack the npc:
Search:
CombatAssitant.java - attackNPC(int i) {
The code above also doesn't make them talk every time you attack them als if you wanted to make them say random things make the code this:if (Server.npcHandler.npcs[i].npcType == NPCID){
if (Misc.random(2) <= 3) {
Server.npcHandler.npcs[i].updateRequired = true;
Server.npcHandler.npcs[i].forceChat("I'm talking all the time!!!!");
}
}
The code above makes them talk 3/4 of the time saying different things.if (Server.npcHandler.npcs[i].npcType == NPCID){
rand = Misc.random(3);
Server.npcHandler.npcs[i].updateRequired = true;
if (rand == 0) {
//no chat here
} else if (rand == 1) {
Server.npcHandler.npcs[i].forceChat("My chat #1!!!!");
} else if (rand == 2) {
Server.npcHandler.npcs[i].forceChat("MY chat #2!!!!");
} else if (rand == 3) {
Server.npcHandler.npcs[i].forceChat("My chat #4!!!!");
}
}
}
Hope I helped