Script:setshop: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "{{ScriptCommandPage |description=set the inventory to act as a shop |context=any |parameters= enable bool Should this entity's inventory act as a shop |intro=Shops have different interaction compared to other inventories when opened in the HUD: * Shop inventories are automatically sorted when opened with matching items being combined into stacks if possible. * The player cannot take whole [...")
 
mNo edit summary
Line 12: Line 12:
* 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 inventor may be set to act as shop before calling {{Command|inventory create}} and is not reset with {{Command|inventory destroy}}.
}}
}}

Revision as of 11:20, 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 inventor 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