Skip to content

ShopEvent

Quantumrunner edited this page Jan 29, 2024 · 6 revisions

What is the shop?

The shop is a build-in component of Valkyrie which allows scenario creators to open a menu where players can decide to buy items.

grafik

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).

Where to use the shop?

The shop is currently only support in Descent Mode of Valkyrie and not for Mansions of Madness.

How to use the shop?

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:

  1. insignifent (default level)
  2. impressive
  3. celebrated
  4. heroic
  5. legendary

See the following example of a build in item for details:

Lets assume fame has been set to the following levels

  1. impressive = 2
  2. celebrated = 12
  3. heroic = 15
  4. 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.

Initializing fame system for a scenario

To be able to use the shop the fame system needs to be initiated correctly by settings base fame ($%fame) and the fame levels ($%fameimpressive, $%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

Open the shop

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

Close the shop

To close the shop just set remove=#shop.

[EventCloseShop]
display=false
buttons=1
remove=#shop

Restock

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
Clone this wiki locally