-
Notifications
You must be signed in to change notification settings - Fork 105
ShopEvent
The shop is a build-in component of Valkyrie which allows scenario creators to open a menu where players can decide to buy items.
It can show random items (e.g. items of a specific trait like helms), items of a specific act (Act 1 and 2) or specific ones (e.g. a crossbow).
The shop is currently only support in Descent
Mode of Valkyrie and not for Mansions of Madness
.
Valkyrie uses a system called fame to determine which items appear in the shop menus. There are different fame levels.
Every descent item in Valkyrie has a minimum and maximum fame level. The following fame levels exist:
- insignifent (default level)
- impressive
- celebrated
- heroic
- legendary
See the following example of a build in item for details:
Lets assume fame has been set to the following levels
- impressive = 2
- celebrated = 12
- heroic = 15
- legendary = 20
[ItemCrossbow]
name={ffg:ITEM_CROSSBOW}
image="{import}/img/Item_Crossbow"
traits=ranged one_handed bow exotic act1
minfame=impressive
maxfame=celebrated
price=175
This item only appears if the heroes have reached the fame level impressive
and will not appear anymore if the have reached higher level than celebrated
. Therefore the heroes would not to have at least 2 and maximum 12 fame to see this item in the shop.
To be able to use the shop the fame system needs to be initiated correctly by settings base fame ($%fame
) and the fame levels (%famecelebrated
, $%fameheroic
, $%famelegendary
) and the variable $restock
needs to be set to 1
to force an initial restock stock of the shop.
The initial event should then look like this:
[EventStart]
operations=$%fame,=,2 $%fameimpressive,=,2 $%famecelebrated,=,6 $%fameheroic,=,12 $%famelegendary,=,16 $restock,=,1
display=false
buttons=1
event1=YourNextEvent
trigger=EventStart
To open the shop you need to add
the items (specific ones or random ones defined by trait) you would like to see in shop and then the shop once remove=#shop
.
In the same event you should also define a button to close the shop the shop ui (see close the shop below).
[EventOpenShop]
buttons=1
event1=EventCloseShop
add=QItem0 QItem1 QItem2 QItem3
remove=#shop
To close the shop just set remove=#shop
.
[EventCloseShop]
display=false
buttons=1
remove=#shop
To restock the items in the shop you need to set variable $restock
to value 1
and then call the event to open the shop again.
[EventRestock]
operations=$restock,=,1
buttons=1
event1=EventOpenShop
remove=#shop