Table of Contents

Class MerchantTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll
[CreateAssetMenu(fileName = "New Merchant", menuName = "FishMMO/Character/Merchant/Merchant", order = 1)]
public class MerchantTemplate : CachedScriptableObject<MerchantTemplate>, ICachedObject
Inheritance
Object
ScriptableObject
MerchantTemplate
Implements
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

Abilities

List of abilities that this merchant can offer or use.

public List<AbilityTemplate> Abilities

Field Value

List<AbilityTemplate>

AbilityEvents

List of ability events associated with this merchant (e.g., triggers for special actions).

public List<AbilityEvent> AbilityEvents

Field Value

List<AbilityEvent>

BuysItems

Whether this merchant buys items from the player.

public bool BuysItems

Field Value

bool

Remarks

Off by default so adding the sell path does not silently turn every existing merchant — including quest givers and trainers that happen to use a merchant template — into a general fence. Content opts in.

Description

Description of the merchant, used for tooltips and UI.

public string Description

Field Value

string

Items

List of items available for sale by this merchant.

public List<BaseItemTemplate> Items

Field Value

List<BaseItemTemplate>

SellPriceMultiplier

Fraction of an item's template price the merchant pays for it.

[Range(0, 1)]
public float SellPriceMultiplier

Field Value

float

Remarks

Lives on the template, and therefore on the server, because it is half of the sale price and the client is never allowed to contribute to a price. The payout is floor(Template.Price * SellPriceMultiplier) * quantity, computed server-side from the item actually found in the named slot.

icon

Addressable reference to the icon sprite for this merchant.

public AssetReferenceSprite icon

Field Value

AssetReferenceSprite

Properties

Icon

The icon representing this merchant in the UI (loaded at runtime on client).

public Sprite Icon { get; }

Property Value

Sprite

Name

The display name of the merchant (from the ScriptableObject's name).

public string Name { get; }

Property Value

string

Methods

OnLoad(string, string, int)

Called when the merchant template is loaded into cache. Loads the icon on the client.

public override void OnLoad(string typeName, string resourceName, int resourceID)

Parameters

typeName string
resourceName string
resourceID int

OnUnload(string, string, int)

Called when the merchant template is unloaded from cache. Releases the icon on the client.

public override void OnUnload(string typeName, string resourceName, int resourceID)

Parameters

typeName string
resourceName string
resourceID int