Change to Npc Dump Script

Writing moved to onExit()