implemented function pointers for npc