You can find all the NPCs at one point by doing something like
PHP Code:
for (temp.npc : findAreaNPCs(x, y, 0.1, 0.1)) {
echo("joined classes: " @ temp.npc.joinedclasses);
}
Then just figure out which NPC you're looking for based on the joined classes or some other variable. Keep in mind it's the actual NPC object, so you can access its variables ("
this.").