Okay so basically what this does instead of examining an NPC and it says "its an NPC" or some other useless text it will pop up with the actual examines (same as runescape)
1. add this in your utils folder:
Code:
package com.cindra.utilities;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author Daenerys
*
*/
public class NPCExamines {
private static Map<Integer, String> npcExamines = new HashMap<Integer, String>();
public static void init() {
try (BufferedReader file = new BufferedReader(new FileReader(
"./data/npcs/unpackedExamines.txt"))) {
while (true) {
final String line = file.readLine();
if (line == null) {
break;
}
if (line.startsWith("//")) {
continue;
}
final String[] valuesArray = line.split(" - ");
npcExamines.put(Integer.valueOf(valuesArray[0]), valuesArray[1]);
}
Logger.log("NPCExamines", "Successfully loaded "+npcExamines.size()+" NPC Examines.");
} catch (Exception e) {
e.printStackTrace();
}
}
public static String getExamine(int npcId) {
return npcExamines.get(npcId);
}
}
2. Next in launcher, or if your using my server its initializer, add this
Code:
NPCExamines.init();
3. In your NPCManager (NPCHandler), in the examine method, add this.
Code:
player.getPackets().sendNPCMessage(0, 15263739, npc, NPCExamines.getExamine(npc.getId()));
4. Finally, in data/npcs/ you need to add this
https://mega.co.nz/#!dpoAkaKI!69jVFR...jX2jDlT_-aGtEo
Note - If one of the examines say "COULDN'T DUMP NPC, DO MANUALLY" it means the dump failed and you need to manually add the examine into the text file.
I've already added all the failed ones up to about 1000.
If i missed anything post below.