by Flaming_Sword
Feat Use
Crafting Non-Magical Items
Crafting Magic Items
- Change Name
- Change Appearance
- Craft Magic Arms and Armour: Adding a special ability
- Ring/Wondrous Item Crafting
- Staff Crafting
Crafting Cost Information
Arbitrary (non-PnP) Crafting
For Builders
Crafting Facilities
Switches
2DAs
Scripting - Adding New Items/Special Abilities
This is a guide to the new crafting system, implementing PnP crafting. Feedback on errors/missing information/style/possible improvements is appreciated.
On the class radial of one of the base classes there should be a read recipe feat with a purple icon. This should open a subradial with 2 subfeats. The first is the original recipe based crafting system feat, used exactly like before. The second should be named "Craft Item" and is the subfeat used for the new system. It is recommended that you craft items in a distraction-free environment. Otherwise you risk disrupting the crafting conversation or ruining the magic item you are attempting to craft.
If there is a problem that prematurely aborts the conversation (eg. TMI) using the feat again should reset all the variables, as well as display a recovery message. Use the feat one more time to start again.
To craft non-magical items, target yourself with the subfeat. Note that you will make skill checks with either the craft weapon or craft armour skills to craft your items. You must wait as a list of base items is created, after which "*Done*" will appear above the character's head and in the log. Choose "Continue" and you should see a list of weapons and shields, as well as armour, sorted alphabetically.
If you have chosen either a longbow or a shortbow, you will then see a list of Mighty values to add to the bow, representing the crafting of a composite bow. You may choose zero if you do not want to craft a composite bow.
If you have chosen to craft armour, a list of armour types (base AC 0-8) will be displayed, allowing you to choose the type of armour to craft.
You will then see a list of options, allowing you to choose to make a normal item, a masterwork item, or an item made of an applicable material (darkwood for wooden items, adamantine or mithral for metallic items, etc.). Staffs, rings and wondrous items can only use the "normal" option. Armour with base AC 0 (robes) can be crafted as wondrous items if the normal option is chosen, and enchanted like armour if the masterwork option is chosen. Cloaks will have their colours randomised. Note that some materials cannot be implemented in NWN (cold steel, alchemical silver, adamantine for weapons).
Afterwards you will be presented with a description of the desired item, along with a cost in gp. You will be able to choose "Confirm" if you have the required gp.
You will then make a skill check based on the item you have selected (and another one if the item is masterwork). If you succeed, the item you have chosen to craft will appear in your inventory. The crafting cost in gp will be deducted regardless of whether you succeed or not.
To craft magical arms and armour, you will need either a masterwork item, or an existing magical item. For other items, you will need the blank item created through non-magical crafting (see above). You must also have the required feat to craft the particular item.
Target the item to be crafted using the subfeat. You must wait as a list is created. As with non-magical crafting, "*Done*" will appear when the list is finished.
At this time, rod crafting is unavailabe, because rods as written in the SRD have been impossible to do without extra scripting.
If you choose "Change Name" you will have about 30 seconds in which to use chat to state the exact name of your item. A visual effect will appear to indicate success.
If you choose "Change Appearance" you will be given a series of numbers separated by dashes (appearance code). This code represents the appearance of your item. This is given for your information in case you make a mistake and wish to change you item's appearance to what it was when you started (it also allows you write down the appearance of an item that you really like so you can reproduce it later). To change the appearance, choose "Set new appearance code". A listener will spawn, allowing you to shout a new appearance code (in the same format) for your item (similar to changing names). Substituting an asterisk will leave a value unchanged.
ModelType:
- 0 - simple appearance, eg. rings, amulets
- Format: single number - icon
- 1 - simple appearance + colours, helmet/cloak
- Format: x-x-x-x-x-x-x (7 values, 1 model, 6 colour)
- model
- leather1
- leather2
- cloth1
- cloth2
- metal1
- metal2
- Format: x-x-x-x-x-x-x (7 values, 1 model, 6 colour)
- 2 - weapons/boots
- Format: x-x-x-x-x-x (6 values, 3 colour, 3 model)
- bottom colour
- middle colour
- top colour
- bottom model
- middle model
- top model
- Format: x-x-x-x-x-x (6 values, 3 colour, 3 model)
- 3 - armour (25 values, 19 model, 6 colour)
- Format: x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
- right foot
- left foot
- right shin
- left shin
- left thigh
- right thigh
- pelvis
- torso
- belt
- neck
- right forearm
- left forearm
- right bicep
- left bicep
- right shoulder
- left shoulder
- right hand
- left hand
- robe
- leather1
- leather2
- cloth1
- cloth2
- metal1
- metal2
- Format: x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
At this time (NWN patch 1.68), attempting to change the model of a cloak will instead destroy it (CopyItemAndModify() doesn't work for cloak models yet)
Admittedly, this system is powerful, yet hard to use. However, in the future, appearance changes through conversation (providing a front-end for the underlying code) may be implemented.
One way to get the exact appearance you want is to first make the item in the toolset and save it. Then use a program (eg. Leto's advanced editor, nwnexplorer, etc.) to open the saved blueprint in the temp directory used by the toolset. For most items (except weapons and boots) model/colour numbers will be shown in the order given above. Weapons and boots are shown in a similar order (bottom, middle, top) as digits, with the last digit being the colour and first (one or more) being the model.
As much as I would like to implement it, there is currently no way to change the description of the item. It will likely work in the same way as changing the name if I ever get it to work.
Craft Magic Arms and Armour: Adding a special ability
If the item you are crafting is a weapon, armour or shield, you will be given the option of adding enhancement or special abilities. Enhancement or special abilities added will replace similar types, and downgrading is not possible.
If you have chosen to add Bane or Dread to a weapon, you must wait as a list of available races is created. You will then be able to choose which race is affected by the bane property. The Bane/Dread properties also depend on the current level of enhancment, so it is recommended that it be added after any changes to the enhancement.
If you have chosen a property to add to your item, A description of the property will appear, along with the crafting cost in gp, xp and time (if applicable). If you have the gp and xp required (you are not allowed to spend enough xp to lose a level) you will be able to choose the "Confirm" option.
If the time delay scale is set to instantaneous, your item will be upgraded and the costs deducted, as well as any required spell uses decreased. Otherwise, there will be a delay, with floating text messages indicating the number of rounds left. You must not do anything strenuous such as fighting, casting spells or anything else that disrupts concentration. Otherwise, you will have to begin the crafting process again. At the end of the delay, your item will be upgraded and the costs deducted, as well as required spell uses decreased.
Unlike magic weapons/armour/shields, you may only craft specific items. A list of items will appear if you are crafting with a blank item (created through non-magical crafting, see above), otherwise you will only see the name and appearance changing options. In all other respects it is the same as crafting weapons/armour/shields.
Staff crafting works like wand crafting, where you cast a spell on the base item (obtainable through non-magical crafting, see above). However, unlike wand crafting, you may add multiple spells to the staff by casting more spells on it (up to 8), provided you can meet the gp/xp cost. Since real epic staffs are not possible (unless level 10+ spell slots are added to the game), metamagic can only be applied to staffs if the caster possesses the Craft Epic Staff feat (an artificial limitation).
| Item | DC |
| Armour/Weapons/Shields | 10 + Base AC |
| Crossbows | 15 |
| Bows | 12 |
| Composite Bows | 15 + 2 x Mighty value |
| Simple melee weapons | 12 |
| Martial melee weapons | 15 |
| Exotic melee weapons | 18 |
| Masterwork | 20 (separate roll) |
Costs in gp (market price) unless noted.
Non-Magical
| Type | Light Armour | Medium Armour | Heavy Armour | Shields | Weapons | Ammunition (99 units) |
| Masterwork | 150 | 150 | 150 | 150 | 300 | 594 |
| Adamantine | 5,000 | 10,000 | 15,000 | N/A | N/A | N/A |
| Darkwood | N/A | N/A | N/A | 10/lb of weight | N/A | |
| Dragonhide | Double total cost (base + masterwork) | N/A | N/A | |||
| Mithral | 1,000 | 4,000 | 9,000 | 1,000 | 500/lb of weight | N/A |
Magical
Market Price = (Non-Magical Price) + (Enhancement Cost) + (Additional Cost)
Non-Magical Price is price from previous section.
Enhancement Cost = (Base Enhancement Cost) x (Effective Enhancement)2
Additional Cost from properties adds linearly.
Base Enhancement Cost is 1,000gp for armour/shields, 2,000gp for weapons
Effective Enhancement = Enhancement + Enhancement values on properties (eg. +5 for vorpal weapons)
For epic items, the enhancement cost is x10 what it is for non-epic items, eg. non-epic, +5 vorpal sword is 2000x(10)2 (+5, +5 for vorpal) = 200,000gp, epic, +10 sword is 2000x(10)2x10 (for being epic) = 2,000,000gp
Crafting cost is 1/2 market price in gp, 1/25 market price in xp if non-epic, 10,000 + 1/100 market price if epic. Upgrading items costs the difference in cost of the old and the new item according to the rules presented here.
Time cost is 1 game hour/1,000gp market price by default.
If a particular switch is set (see switches below), Most of the information above relating to magic item crafting may be ignored. Instead of choosing special abilites or making specific items, you instead choose particular itemproperties.
You will be presented with a list of itemproperty types to choose from. If applicable, you will then be able to choose the subtype, costtablevalue and param1value. Cost will be the difference in cost between the old and the new item according to NWN, with gp/xp/time costs calculated according to the rules in the section above.
You can provide facilities to player for crafting, either through a npc or placeable. To create a facility, find the item named "PRC_CRAFT_TOKEN" and put it in the inventory of the npc or placeable, taking care to make sure the object is plot, the item cannot be pickpocketed, the placeable is locked, etc.
Players within 10m of the object will be able to craft without the normal restrictions, for market price in gp and zero xp.
These are all "int" type switches
| Switch | Description | Default |
| PRC_DISABLE_CRAFT | Disables the crafting system altogether | FALSE |
| PRC_DISABLE_CRAFT_EPIC | Disables epic crafting | FALSE |
| PRC_AREA_DISABLE_CRAFTING | Set in area, disables crafting in that area. | FALSE |
| PRC_AREA_DISABLE_CRAFTING_INVERT | Inverts the behavior of previous switch. Will disable crafting on all areas BUT ones with the PRC_AREA_DISABLE_CRAFTING switch set. | FALSE |
| PRC_CRAFT_TIMER_MULTIPLIER | Scales the time cost for crafting by this value/100 | 100 |
| PRC_CRAFT_STAFF_CASTER_LEVEL | Crafted staffs have the casterlevel of the creator. | FALSE |
| X2_CI_CRAFTSTAFF_COSTMODIFIER | Cost modifier of spells crafted into staffs | 750 |
| PRC_CRAFTING_ARBITRARY | Disables PnP crafting and instead allows all NWN itemproperties (subject to cost) | FALSE |
| PRC_CRAFTING_COST_SCALE | Scales the gp cost for crafting by this value/100 | 100 |
| PRC_CRAFTING_MUNDANE_COST_SCALE | Scales the gp cost for non-magical crafting by this value/100 | 100 |
| PRC_CRAFTING_TIME_SCALE | Sets crafting time per 1000gp in market price:
|
4 |
To disable a specific item/special ability in PnP crafting, set a switch with this name:
PRC_CRAFT_DISABLE_<name of crafting 2da file>_<line number of property> where the 2da files are named craft_* (lower case) or itempropdef in the case of arbitrary crafting
eg. PRC_CRAFT_DISABLE_itempropdef_15
disables all castspell properties in arbitrary crafting mode
When adding lines to 2das used, modify SetDefaultFileEnds() within prc_inc_switch.nss to allow the scripts to read the required number of lines. Code will be in the form:
SetPRCSwitch("PRC_FILE_END_<file name>", <number>);
The file name will be in alphabetical order and in lower case.
craft_*.2da
Used to store items/special abilities and their prerequisites
| Column Name | Description | Format |
| Name | Name | TLK entry |
| Label | Just a label | String |
| PropertyType | Crafting type, "M" for magic, "P" for psionic (not implemented yet), blank for any | Character |
| Level | Level (caster, manifester, etc.) prerequisite | Integer |
| PrereqMisc | Underscore delimited string with 5 values:
Format: Use a single asterisk (*) for blank, or four asterisks (****) for all blank
|
String (Underscore delimited, contains Integers) |
| Skill | Skill prerequisite, line in skills.2da | Integer |
| SkillRanks | Number of ranks for skill prerequiste | Integer |
| Spells | Underscore delimited string with 5 values:
Format: Use a single asterisk (*) for blank, or four asterisks (****) for all blank
|
String (Underscore delimited, contains Integers) |
| Enhancement | Enhancement value for cost calculations | Integer |
| AdditionalCost | Additional cost for cost calculations | Integer |
| ReplaceLast | Property will disable this number of the preceding lines, for weapon/armour/shield crafting | Integer |
| BaseItem | Base item filter for wondrous item crafting, line in baseitems.2da, ignored for craft_ring.2da | Integer |
| IPN | Underscore delimited string with 4 values, Nth itemproperty to add (up to 6):
Format: Use a single asterisk (*) for blank, or four asterisks (****) for all blank
|
String (Underscore delimited, contains Integers) |
| Epic | Epic prerequisite, whether the creator needs the epic crafting feat | Integer |
| Special | Determines whether the property needs special handling by the scripts | Integer |
prc_craft_get_it.2da
Used for non-magical crafting, lines must match baseitems.2da
| Column Name | Description | Format |
| Name | Name of base item | TLK entry |
| label | A label | String |
| Blueprint | Resref of blank/generic item to create when crafting | String |
| Type | Identifies the type of base item for the crafting scripts:
|
Integer |
Scripting - Adding New Items/Special Abilities
To add properties, add lines to the relevant crafting 2das, then add code to the functions below (in prc_craft_inc.nss), using existing code as a guide. You must be proficient in 2da editing and NWScript.
Get2DALineFromItemprop()
Weapon/armour/shield crafting, uses an itemproperty to find what special abilities have been added to an item. Hardcoded to avoid having to search through the 2das for every itemproperty on an item.
DisallowType()
Weapon/armour/shield crafting, disallows special abilities that are similar to existing properties (for items being upgraded that were not created using this system).
PrereqSpecialHandling()
Extra rules for handling prerequisites.
CheckCraftingSpells()
Section handles unusual spell prerequisites.
GetItemVars()
A portion of this function disables some special abilities for ranged weapons, listed here.
if(bArmsArmour)
{
int nBase = GetBaseItemType(oItem);
int bRangedType = StringToInt(Get2DACache("baseitems", "RangedWeapon", nBase));
if(bRangedType && (bRangedType != nBase))
{ //disallowed because ranged weapons can't have onhit
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 22, 0);
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 24, 0);
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 26, 0);
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 34, 0);
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 40, 0);
array_set_int(oPC, PRC_CRAFT_ITEMPROP_ARRAY, 42, 0);
}
}