[c12483] Improvements for NPC summoning code