made by Monte Zuma = me
in npc handler add this voids
Code:
public void npcSpeech(int i, int i1, int i2, int i3, String s){
if (npcs[i].npcType == i1) {
if (misc.random2(i2) == i3) {
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = s;
}
}
}
and
Code:
public void npcspeech(int i){
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[10];
boolean EndOfFile = false;
int ReadMode = 0;
BufferedReader characterfile = null;
try {
characterfile = new BufferedReader(new FileReader("./npcspeech.cfg"));
} catch(FileNotFoundException fileex) {
misc.println("npcspeech.cfg: not found.");
}
try {
line = characterfile.readLine();
} catch(IOException ioexception) {
misc.println("npcspeech.cfg ERROR");
}
while(EndOfFile == false && line != null) {
line = line.trim();
int spot = line.indexOf("=");
if (spot > -1) {
token = line.substring(0, spot);
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token3 = token2_2.split("\t");
if(token.equals("speech")){
int NPCID = Integer.parseInt(token3[0]);
int RanNum = Integer.parseInt(token3[1]);
int Num = Integer.parseInt(token3[2]);
String s = token3[3].replaceAll("_", " ");
npcSpeech(i, NPCID, RanNum, Num, s);
}
} else {
if (line.equals("[EOF]")) {
try { characterfile.close(); } catch(IOException ioexception) { }
}
}
try {
line = characterfile.readLine();
} catch(IOException ioexception1) { EndOfFile = true; }
}
try { characterfile.close(); } catch(IOException ioexception) { }
}
in misc.java if you DONT have add:
Code:
public static int random2(int range) {
return (int)((java.lang.Math.random() * range) + 1);
}
then in process inside npchandler add:
then make a file called npcspeech.cfg and add this inside:
Code:
//------NpcID---speed---1--------shout-----------made by monte zuma--------------------
speech = 2244 20 1 me lumbride guide, rep monte zuma
and ur done, u can easy add new lines
and it doesnt need an reboot to make the text update, you can edit without reboot
monte zuma