VendorItemStock ​
Inherits: Resource
Defines how a vendor stocks a specific item (template for runtime inventory)
Properties ​
int | item_id | 0 |
int | start_quantity | 1 |
int | max_quantity | 10 |
int | item_level | 0 |
bool | can_restock | true |
int | restock_quantity | 1 |
float | custom_restock_hours | 0.0 |
CurrencyDefinition | currency_override | |
int | value_override | 0 |
bool | override_vendor_value_weight | false |
float | value_weight_override | 1.0 |
float | item_price_modifier | 1.0 |
Methods ​
ItemDefinition | get_item_data() |
float | get_restock_interval( vendor_default_hours: float ) |
CurrencyDefinition | get_effective_currency( vendor_default: CurrencyDefinition ) |
int | get_base_value() |
float | get_value_weight( vendor_default: float ) |
int | calculate_sell_price( vendor_definition: VendorDefinition ) |
Property descriptions ​
int item_id = 0 ​
The item ID this stock entry refers to
int start_quantity = 1 ​
The starting quantity when vendor is first created/restocked. Set to -1 for unlimited stock.
int max_quantity = 10 ​
The maximum quantity this vendor will stock (0 = unlimited)
int item_level = 0 ​
For an item that is generated (it rolls or scales with its item level): the item level of what is bought. 0 = the level of the buyer
bool can_restock = true ​
Whether this item restocks over time
int restock_quantity = 1 ​
How many to add per restock cycle
float custom_restock_hours = 0.0 ​
Custom restock interval for this item (overrides vendor default, 0 = use vendor default)
Currency Override
CurrencyDefinition currency_override ​
Override the vendor's default currency for this specific item
int value_override = 0 ​
Override the item's base value (0 = use item's default value)
Pricing Modifiers
bool override_vendor_value_weight = false ​
Override the vendor's value weight for this specific item
float value_weight_override = 1.0 ​
Custom value multiplier for this item only
float item_price_modifier = 1.0 ​
Additional markup/discount for this specific item (1.0 = normal, 1.5 = 50% markup)
Method descriptions ​
ItemDefinition get_item_data() ​
Get the ItemDefinition this stock refers to
float get_restock_interval( vendor_default_hours: float ) ​
Get the effective restock interval for this item
CurrencyDefinition get_effective_currency( vendor_default: CurrencyDefinition ) ​
Get the currency to use for this item
int get_base_value() ​
Get the base value for pricing calculations
float get_value_weight( vendor_default: float ) ​
Get the value weight for pricing calculations
int calculate_sell_price( vendor_definition: VendorDefinition ) ​
Calculate final sell price for this item