Need help with formula that gives X extra gold for n charges of the item sold. Here are some examples:
1 charge on item sold -> 0 extra gold
2 charges on item sold -> 5 extra gold
3 charges on item sold -> 5+10=15 extra gold
4 charges on item sold -> 5+10+15=30 extra gold
5 charges on item sold -> 5+10+15+20=50 extra gold
etc.
The result must contain the gold for the charge 5x(n-1) plus the gold for all the charges smaller than it. Example:
If the item has 3 charges, then it must sell for 5x(3-1)+5x(2-1)+5x(1-1) = X gold, where X = 15
I need the math formula for this.
EDIT: Already got it. 5x[(n^2-n)/2)]
Now I have to know how to put this in the trigger.
If I'm not wrong "Arithmetics" only allows for simple operations.
The gold has to be added to triggering player.
1 charge on item sold -> 0 extra gold
2 charges on item sold -> 5 extra gold
3 charges on item sold -> 5+10=15 extra gold
4 charges on item sold -> 5+10+15=30 extra gold
5 charges on item sold -> 5+10+15+20=50 extra gold
etc.
The result must contain the gold for the charge 5x(n-1) plus the gold for all the charges smaller than it. Example:
If the item has 3 charges, then it must sell for 5x(3-1)+5x(2-1)+5x(1-1) = X gold, where X = 15
I need the math formula for this.
EDIT: Already got it. 5x[(n^2-n)/2)]
Now I have to know how to put this in the trigger.
If I'm not wrong "Arithmetics" only allows for simple operations.
The gold has to be added to triggering player.