Discounts
How to add and apply discounts to items
Last updated
How to add and apply discounts to items
Last updated
This is a new feature as of v1.2.0 of the Poké Mart Plugin. It allows you to setup discounts that would apply to all items in a store. Right now there's no way to exclude an item from a discount but it might be in the future.
Enabling discount is done by adding discount:
and a Game Variable ID.
There are 3 ways to setup a discount
The first way is by using a variable and assigning an array of values (in percentage (4 = 4% discount on the item's price).
27
= Game Variable ID 27.
[0, 1, 4, 7, 11] = An Array with 1 or more discount values.
0 = discount used when Game Variable 27 equals to 0.
1 = discount used when Game Variable 27 equals to 1.
4 = discount used when Game Variable 27 equals to 2.
7 = discount used when Game Variable 27 equals to 3.
11 = discount used when Game Variable 27 equals to 4.
Each number in the array has an index, the index starts at 0. The script will use the index that matches the value of the variable. If a game variable would have been set too high, you'll be notified.
The second way is by using a combination with an Item that is first required to be owned by the player and a Game Variable. Again you assign an array of values. You can combine multiple Variables with the same Item but you can't repeat a game variable. If you do, you might get the wrong discount as result. It's also possible to use negative values, this will result in overcharge instead of discount. (-2 = 2% extra on the item's price).
:COUPONA = Item ID :COUPONA
26 = Game Variable ID 26.
[0, 3, 6, 8 ,10]
28 = Game Variable ID 28.
[0, -2, -5]
You can combine discount and overcharge values in the same array but it could be easier to mange to keep them separated.
For Example you can have a game variable increase by 1 for each time the player blacks out. You can start with a discount of 10 and then decrease it each time.
Of course you can combine this here as well with an item.
When Game Variable 29 would become higher than 11, the discount/overcharge would become 0. To prevent that from happening, you can work with a conditional to only increase the variable if it's smaller than 11. (There are 12 values but remember the first value is 0). A good place to increase the variable would be the start over event. But this is only an example so that's up to you how you do it.
The third way is by using the value of the value directly. This means that it's independable from an array you setup in DISCOUNTS. The script will use the value of the Game Variable you put in the pokemart command to use as the discount/overcharge.
You are allowed to put -30 instead of 30 as this will make the discount an overcharge instead. Even if there's a way to make the Game Variable's value negative, you can reuse the Game Variable 30 to use as a discount for another store instead.
0 = discount used when Gam Variable 26 equals to 0.
3 = discount used when Game Variable 26 equals to 1.
6 = discount used when Game Variable 26 equals to 2.
8 = discount used when Game Variable 26 equals to 3.
10 = discount used when Game Variable 26 equals to 4.
0 = overcharge used when Game Variable 28 equals to 0.
-2 = overcharge used when Game Variable 28 equals to 1.
-5 = overcharge used when Game Variable 28 equals to 2.