Make NPCs use JavaScript on initialisation and interaction to allow for conditionals, setting of variables and custom listener registration