You do not need to use findnpc or the (@ "var") syntax if the NPC or weapon name is standard.
Here is my implementation for the class, just showing how the NPC is registered:
PHP Code:
function onCreated() {
dbnpc_name.register(this);
}
In the dbnpc:
PHP Code:
public function register(npcobj) {
this.(@ "n" @ npcobj.id) = npcobj;
}
I think it is better to be using functions in this case.