Some really basic algorithms for item calculations to fix NPC compile.