Script:shopmultiply: Difference between revisions
(Created page with "{{ScriptCommandPage |description=set the price multiplier for items bought from or sold to a shop inventory |context=any |parameters= multiplier number* Price multiplier for this shop |intro=<br> For the shop multiplier to have an effect the entity must be set to be a shop using {{Command|setshop}}. To buy an item from this shop the player must pay: floor(floor(price · multiplier · ...") |
(Document effect on repair price) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ScriptCommandPage | {{ScriptCommandPage | ||
|description=set the [[Script:setprice|price]] multiplier for items bought from or sold to a [[Script:setshop|shop inventory]] | |description=set the [[Script:setprice|price]] multiplier for items repaired, bought from or sold to a [[Script:setshop|shop inventory]] | ||
|context=any | |context=any | ||
|parameters= | |parameters= | ||
multiplier number* Price multiplier for this shop | multiplier number* Price multiplier for this shop | ||
|intro= | |intro=The default shop multiplier is 1. | ||
To buy an item from this shop the player must pay: | To buy an item from this shop the player must pay: | ||
floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) | floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) · (1 - [[Skills|full_intuition]] / 200)) | ||
When selling a (stack of) item(s) to this shop the player will be paid: | When selling a (stack of) item(s) to this shop the player will be paid: | ||
floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) / 3 | floor(floor([[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(durability / max_durability)]]) / 3 · [[Script:setcount|count]] · (1 + [[Skills|full_intuition]] / 200)) | ||
For the shop multiplier to have an effect on the the entity must be set to be a shop using {{Command|setshop}}. The shop multiplier may be set before calling {{Command|inventory create}} or {{Command|setshop|on}} and is not reset with {{Command|setshop|off}} or {{Command|inventory destroy}}. | |||
Additionally, a non-zero shop multiplier also affects the repair price returned from the <code>^repairprice_{{Highlight|entity|<entity>}}</code> system variable and [[Script:setblacksmith|shown in the HUD]]: | |||
[[Script:setprice|price]] · [[Script:shopmultiply|multiplier]] · [[Script:setdurability|(max_durability - durability) / max_durability]] | |||
The calling entity does '''not''' need to be a [[Script:setshop|shop]] for the shop multiplier to affect the repair price. | |||
}} | }} |
Latest revision as of 20:19, 8 July 2022
The shopmultiply
script command is used to set the price multiplier for items repaired, bought from or sold to a shop inventory for an entity. The default shop multiplier is 1.
To buy an item from this shop the player must pay:
floor(floor(price · multiplier · (durability / max_durability)) · (1 - full_intuition / 200))
When selling a (stack of) item(s) to this shop the player will be paid:
floor(floor(price · multiplier · (durability / max_durability)) / 3 · count · (1 + full_intuition / 200))
For the shop multiplier to have an effect on the the entity must be set to be a shop using setshop
. The shop multiplier may be set before calling inventory create
or setshop on
and is not reset with setshop off
or inventory destroy
.
Additionally, a non-zero shop multiplier also affects the repair price returned from the ^repairprice_<entity>
system variable and shown in the HUD:
price · multiplier · (max_durability - durability) / max_durability
The calling entity does not need to be a shop for the shop multiplier to affect the repair price.
Usage
shopmultiply <multiplier*>
Context: Any Entity
Parameters:
Parameter | Type | Description |
---|---|---|
multiplier |
number or variable |
Price multiplier for this shop |