So, I'm trying to create a scenario where the player has the option to sell all (only all or none) an NPC for 50$ per item.
So...as far as I can tell I need to create a variable based on the amount of item X in the player's inventory, then remove a number of that item equal to that variable.
The problem is that I then want to add $ based on that variable, but I can only add a fixed amount or an amount equal to the variable. If I want to add 50 $ per item I'd have to create 50 "add gold" commands with an amount equal to the variable.
The only other thing I can think of is to multiply the original variable by 50, do an add gold command equal to the new variable amount, and then divide the variable by 50 and then reduce the player's inventory of items by an amount equal to the variable.
Is there an easier way, or is this my best bet?
So...as far as I can tell I need to create a variable based on the amount of item X in the player's inventory, then remove a number of that item equal to that variable.
The problem is that I then want to add $ based on that variable, but I can only add a fixed amount or an amount equal to the variable. If I want to add 50 $ per item I'd have to create 50 "add gold" commands with an amount equal to the variable.
The only other thing I can think of is to multiply the original variable by 50, do an add gold command equal to the new variable amount, and then divide the variable by 50 and then reduce the player's inventory of items by an amount equal to the variable.
Is there an easier way, or is this my best bet?