Vendor

Hook Documentation for Vendor Module.

Functions

MODULE:CanPlayerAccessVendor(client, entity)

Determines whether a player can access a vendor.

Parameters

  • client Player

    The player attempting to access the vendor.

  • entity Entity

    The vendor entity.

Returns

  • bool

    Whether the player is allowed to access the vendor.

MODULE:OnCharTradeVendor(client, vendor, item, isSellingToVendor, character)

Called when a character trades with a vendor.

Parameters

  • client Player

    The player character trading with the vendor.

  • vendor Entity

    The vendor entity being traded with.

  • item Entity

    The item being traded.

  • isSellingToVendor Boolean

    Indicates if the trade involves selling to the vendor.

  • character Entity

    The character entity of the player.

MODULE:OnOpenVendorMenu(self)

Called when the vendor menu is opened.

Parameters

  • self Entity

    The vendor entity.

MODULE:PlayerAccessVendor(activator, self)

Called when a player accesses a vendor.

Parameters

  • activator Player

    The player accessing the vendor.

  • self Entity

    The vendor entity.

MODULE:VendorClassUpdated(vendor, id, allowed)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's allowed classes are updated.

Parameters

  • vendor Entity

    The vendor entity whose classes were updated.

  • id String

    The ID of the class.

  • allowed Boolean

    Whether the class is allowed or not.

MODULE:VendorEdited(vendor, key)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called after a delay when a vendor's data is edited.

Parameters

  • vendor Entity

    The vendor entity whose data is being edited.

  • key String

    The key related to the specific data being edited.

MODULE:VendorExited()

Called when a player exits from interacting with a vendor.

MODULE:VendorFactionUpdated(vendor, id, allowed)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's allowed factions are updated.

Parameters

  • vendor Entity

    The vendor entity whose factions were updated.

  • id String

    The ID of the faction.

  • allowed Boolean

    Whether the faction is allowed or not.

MODULE:VendorItemMaxStockUpdated(vendor, itemType, value)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's item maximum stock is updated.

Parameters

  • vendor Entity

    The vendor entity.

  • itemType String

    The type of the item.

  • value Integer

    The new maximum stock value.

MODULE:VendorItemModeUpdated(vendor, itemType, value)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's item mode is updated.

Parameters

  • vendor Entity

    The vendor entity.

  • itemType String

    The type of the item.

  • value Integer

    The new mode value.

MODULE:VendorItemPriceUpdated(vendor, itemType, value)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's item price is updated.

Parameters

  • vendor Entity

    The vendor entity.

  • itemType String

    The type of the item.

  • value Integer

    The new price value.

MODULE:VendorItemStockUpdated(vendor, itemType, value)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's item stock is updated.

Parameters

  • vendor Entity

    The vendor entity.

  • itemType String

    The type of the item.

  • value Integer

    The new stock value.

MODULE:VendorMoneyUpdated(vendor, money, oldMoney)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a vendor's money is updated.

Parameters

  • vendor Entity

    The vendor entity.

  • money Integer

    The new money value.

  • oldMoney Integer

    The previous money value.

MODULE:VendorOpened(vendor)

Called when a vendor is opened.

Parameters

  • vendor Entity

    The vendor entity that was opened.

MODULE:VendorSynchronized(vendor)

Called when vendor synchronization data is received.

Parameters

  • vendor Entity

    The vendor entity whose data has been synchronized.

MODULE:VendorTradeEvent(client, entity, uniqueID, isSellingToVendor)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when a player attempts to trade with a vendor.

Parameters

  • client Player

    The player attempting to trade.

  • entity Entity

    The vendor entity.

  • uniqueID String

    The unique ID of the item being traded.

  • isSellingToVendor Boolean

    Indicates if the player is selling to the vendor.

MODULE:getPriceOverride(self, uniqueID, price, isSellingToVendor)

Gets the price override for an item.

Parameters

  • self Entity

    The vendor entity.

  • uniqueID String

    The unique ID of the item.

  • price Integer

    The original price of the item.

  • isSellingToVendor Boolean

    Indicates if the player is selling to the vendor.

Returns

  • int

    The overridden price.