Check if the inventory contains [Material] Check the amount of [Material] in the player's inventory Multiply the amount of [Material] by the price per item Remove the items from the inventory, and deposit the previously calculated amount