Skip to content

Special Fields

darvid edited this page Jan 4, 2013 · 1 revision

Special fields are key names used in Trine schema models that aren't used by columns in existing tables. Some special fields offer additional functionality and convenience, and some are required by Trine.

method

Required. Defines how the model should be pushed to the database. For more information, see Using Methods.

merge-from

Used by the MERGE method. See Using Methods.

items

Rather than requiring you to manually write hundreds of npc_vendor models, Trine makes it easy to populate vendors with the items field in npc/CreatureTemplate models. items must be a sequence of names, item IDs (item_template.entry values), or nested sequences containing item IDs, which are generally obtained from using tags such as !getitems or !query.

Note that you can also use the !include tag to separate item lists from vendor models, e.g. items: !include "itemlists/some_item_list.yml".

Example

npc:
  - method: MERGE
    merge-from: {name: High Overlord Saurfang (1)}
    entry: 50018
    name: Saurfang
    subname: Tier 10 Heroic
    npcflag: VENDOR
    items: &TIER10
      - !getitems {ItemLevel: 277, name: Sanctified Scourgelord %}
      - !getitems {ItemLevel: 277, name: Sanctified Ymirjar Lord's %}
      - !getitems {ItemLevel: 277, name: Sanctified Lasherweave %}
      - !getitems {ItemLevel: 277, name: Sanctified Ahn'Kahar %}
      - !getitems {ItemLevel: 277, name: Sanctified Bloodmage %}
      - !getitems {ItemLevel: 277, name: Sanctified Lightsworn %}
      - !getitems {ItemLevel: 277, name: Sanctified Crimson Acolyte %}
      - !getitems {ItemLevel: 277, name: Sanctified Shadowblade %}

extended_costs

extended_costs expects a mapping consisting of two keys: where and cost, cost referring to an ID from ItemExtendedCost.dbc. The where key is simply a where mapping with which you can select the items associated with a specific extended cost.

Example

npc:
  - method: MERGE
    merge-from: {name: Overseer Savryn}
    entry: 50013
    name: Jasper
    subname: Wrathful Weapons
    npcflag: VENDOR
    items: !include "itemlists/wrath_weapons.yml"
    extended_costs:
      - where: {InventoryType: TWO_HAND}
        cost: 2386
      - where: {InventoryType: [WEAPON, MAIN_HAND, RANGED_wEAPON, RANGED_RIGHT]}
        cost: 2381
      - where: {InventoryType: [OFF_HAND, SHIELD, TOME]}
        cost: 2372
      - where: {InventoryType: [RELIC, THROWN]}
        cost: 2382