Script:setshop: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 9: Line 9:
* The player cannot take whole [[Script:setcount|stacks of items]] from shop inventories, only individual items. There is no button to take all items.
* The player cannot take whole [[Script:setcount|stacks of items]] from shop inventories, only individual items. There is no button to take all items.
* If a [[Script:shopcategory|shop category]] is set, the player can only drop items with a matching [[Script:setgroup|group]] into the shop inventory. The shop can still contain items of other categories which the player will be able to buy.
* If a [[Script:shopcategory|shop category]] is set, the player can only drop items with a matching [[Script:setgroup|group]] into the shop inventory. The shop can still contain items of other categories which the player will be able to buy.
* Dragging an item out of a shop inventory is considered buying it and [[Script:addgold|deducts gold from the player's purse]] according to this formula:<br><code>floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) * (1 - [[Skills|full_intuition]] / 200))</code><br>If the player does not have enough gold in the purse then the item cannot be dragged.
* Dragging an item out of a shop inventory is considered buying it and [[Script:addgold|deducts gold from the player's purse]] according to this formula:<br><code>floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) · (1 - [[Skills|full_intuition]] / 200))</code><br>If the player does not have enough gold in the purse then the item cannot be dragged.
* Dropping items into a shop inventory is considered selling them and [[Script:addgold|adds gold to the player's purse]] according to this formula:<br><code>floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) / 3 * [[Script:setcount|count]] * (1 - [[Skills|full_intuition]] / 200))</code>
* Dropping items into a shop inventory is considered selling them and [[Script:addgold|adds gold to the player's purse]] according to this formula:<br><code>floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) / 3 · [[Script:setcount|count]] · (1 - [[Skills|full_intuition]] / 200))</code>
* The player cannot directly use or combine items in shop inventories but must first buy them by dragging the items somewhere else.
* The player cannot directly use or combine items in shop inventories but must first buy them by dragging the items somewhere else.


The entity inventory may be set to act as shop before calling {{Command|inventory create}} and is not reset with {{Command|inventory destroy}}.
The entity inventory may be set to act as shop before calling {{Command|inventory create}} and is not reset with {{Command|inventory destroy}}.
}}
}}

Latest revision as of 12:18, 26 June 2022

The setshop script command is used to set the inventory to act as a shop for an entity. Shops have different interaction compared to other inventories when opened in the HUD:

The entity inventory may be set to act as shop before calling inventory create and is not reset with inventory destroy.

Usage

setshop <enable>

Context: Any Entity

Parameters:

ParameterTypeDescription
enable bool Should this entity's inventory act as a shop