Reference: CraftDef.txt

Purpose

Contains all the recipes available for use by the Advanced Crafting panel. The syntax for conditions and actions is pretty bad, but it works for its intended purpose.

File Format

Table file. Tab separated values.
Comment character: semicolon (;)
First line is always ignored (assumed as header).

Table rows:
FilterName Not used in the server.
In# Number of input items. Used at a glance to determine if a recipe should be checked.
Out# Number of output items. Used at a glance to determine if the player has enough free inventory space.
Conditions List of conditions that must be passed. Sorting is important. See details.
Actions List of actions if the recipe matches the input ingredients.

Conditions

The provided items are sorted by the server. You must take this into consideration when specifying item indexes.

Sort order (lowest to highest):
mType, then mID

These values are ItemDef properties. See those files for info.

The first parameter is always an index into the sorted item Slot array (zero based).
The second parameter is the condition name.
Remaining parameters are specific to the condition.

All parameters must be separated by commas. Don't include spaces. All conditions separated by a pipe ( | )

List of conditions and arguments:

Condition Full Parameter String
Real Usage Example
Notes, and description of example.
requireid slotIndex,requireid,itemID,itemCount
0,requireid,20524,3
Require a specific item and stack count.

Ex: The item in Slot 0 must be a stack of 3 Amber (mID=20524).

requireidxmult slotIndex,requireidxmult,itemID,checkIndex,mult
1,requireidxmult,20524,0,5
A Slot must contain a certain item with a stack count that is a multiple of the number of items in another stack. Use this to create recipes that scale based on item counts of supplied ingredients. The multiple cannot be less than one.

Ex: Slot 1 must container Amber (mID=20524) with a stack size 5 times greater than the stack count of whatever is in Slot 0.

requireidmult slotIndex,requireidmult,itemID,itemCount
0,requireidmult,40051,2
The items in the stack must be a multiple (cleanly divisible by) the provided count. Use this to create scaled recipes.

Ex: Slot 0 must be a healing potion (mID=40051) with a count of at least 2, 4, 6, etc.

itemtype slotIndex,itemtype,type
0,itemtype,2
The item's mType property must match the specified value.

Ex: The item in Slot 0 must be a weapon (mType=2).

quality slotIndex,itemtype,quality
0,quality,2
The item's mQualityLevel property must match the specified value.

Ex: The item in Slot 0 must be Uncommon (green) (mQualityLevel=2).

cmp slotIndex,cmp,propertyName,comparator,amount
0,cmp,level,<=,19
Compare an item property to a certain value. They associate to the ItemDef properties of similar name.
Properties: { level | quality | type | weapontype | armortype | equiptype }
Comparators: { = | != | < | <= | > | >= }

Ex: The item in Slot 0 must have an item level less than or equal to 19.

Actions

The provided items are sorted by the server. You must take this into consideration when specifying item indexes.

Sort order (lowest to highest):
mType, then mID

These values are ItemDef properties. See those files for info.

The first parameter is the action name.
Remaining parameters are specific to the action.

All parameters must be separated by commas. Don't include spaces. All actions separated by a pipe ( | )

List of actions and arguments:

Action Full Parameter String
Real Usage Example
Notes, and description of example.
giveid giveid,itemID,itemCount
Giveid,20943,1
Gives an item. The count cannot be less than 1.

Ex: Creates 1 polished stone (mID=20943).

giveidxmult giveidxmult,itemID,slotIndex,mult
Giveidxmult,40047,0,1
Gives a variable number of items in proportion to the stack count of a source slot. Use this to create recipes with output counts that scale to input counts. Multiplier cannot be less than 1.

Ex: Give a stack of healing potions (mid=40047). Since the multiplier is 1, the resulting amount will be a 1:1 ratio of the stack count in Slot 0.

giveidxdiv giveidxdiv,itemID,slotIndex,div
Giveidxdiv,40072,0,2
Gives a variable number of items in proportion to the stack count of a source slot. Use this to create recipes with output counts that scale to input counts. Divisor cannot be less than 1. Should be used with the "requireidxmult" condition.

Ex: Give a stack of healing potions (mid=40072). If the player provided a stack of 6 reagents in slot 0, it will create 3 healing potions.