Skip to content

VendorItemStock ​

Inherits: Resource

Defines how a vendor stocks a specific item (template for runtime inventory)

Properties ​

intitem_id0
intstart_quantity1
intmax_quantity10
intitem_level0
boolcan_restocktrue
intrestock_quantity1
floatcustom_restock_hours0.0
CurrencyDefinitioncurrency_override
intvalue_override0
booloverride_vendor_value_weightfalse
floatvalue_weight_override1.0
floatitem_price_modifier1.0

Methods ​

ItemDefinitionget_item_data()
floatget_restock_interval( vendor_default_hours: float )
CurrencyDefinitionget_effective_currency( vendor_default: CurrencyDefinition )
intget_base_value()
floatget_value_weight( vendor_default: float )
intcalculate_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