X2 inc craft

From NWN Lexicon



Contents

[edit] x2_inc_craft

Central include for crafting feat and crafting skill system.

NOTE: This file includes x2_inc_switches .

[edit] Constants

Name Value Brief Description
X2_CI_2DA_SCROLLS des_crft_scroll Name of the scroll 2da.
X2_CI_BREWPOTION_COSTMODIFIER 50 GP Brew Potion XP cost modifier.
X2_CI_BREWPOTION_FEAT_ID 944 Brew Potion feat simulation.
X2_CI_BREWPOTION_MAXLEVEL 3 Max level for potions.
X2_CI_BREWPOTION_NEWITEM_RESREF x2_it_pcpotion ResRef for new potion item.
X2_CI_CRAFTINGSKILL_CTOKENBASE 13220 Base custom token for item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTINGSKILL_DC_CTOKENBASE 14220 Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTINGSKILL_GP_CTOKENBASE 14320 Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTING_AR_2DA des_crft_armor 2da for the craft skills.
X2_CI_CRAFTING_ITEMS_PER_ROW 5 How many items per 2da row in X2_IP_CRAFTING_2DA. Do not change > 4 until you want to create more conversation condition scripts as well.
X2_CI_CRAFTING_MAT_2DA des_crft_mat 2da for the craft skills.
X2_CI_CRAFTING_SP_2DA des_crft_spells 2da for matching spells to properties.
X2_CI_CRAFTING_WP_2DA des_crft_weapon 2da for the craft skills.
X2_CI_CRAFTMODE_ASSEMBLE 3
X2_CI_CRAFTMODE_BASE_ITEM 2
X2_CI_CRAFTMODE_CONTAINER 1 No longer used, but left in for the community to reactivate.
X2_CI_CRAFTMODE_INVALID 0
X2_CI_CRAFTSKILL_CONV x2_p_craftskills
X2_CI_CRAFTWAND_COSTMODIFIER 750 Craft Wand cost modifier.
X2_CI_CRAFTWAND_FEAT_ID 946 Craft Wand feat simulation.
X2_CI_CRAFTWAND_MAXLEVEL 4 Max level for wands.
X2_CI_CRAFTWAND_NEWITEM_RESREF x2_it_pcwand ResRef for new wand item.
X2_CI_MAGICTYPE_ARCANE 1
X2_CI_MAGICTYPE_DIVINE 2
X2_CI_MAGICTYPE_INVALID 0
X2_CI_MODIFYARMOR_GP_CTOKENBASE 14420 Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_MODMODE_ARMOR 1
X2_CI_MODMODE_INVALID 0
X2_CI_MODMODE_WEAPON 2
X2_CI_SCRIBESCROLL_COSTMODIFIER 25 Scribe Scroll cost modifier.
X2_CI_SCRIBESCROLL_FEAT_ID 945 Scribe Scroll feat simulation.
X2_CI_SCRIBESCROLL_NEWITEM_RESREF x2_it_pcscroll ResRef for new scroll item.


[edit] Structures

Name Variables Brief Description
craft_receipe_struct int nMode
object oMajor
object oMinor
craft_struct int nRow
string sResRef
int nDC
int nCost
string sLabel


[edit] Functions

Name Brief Description

CICraftCheckBrewPotion

Checks if the current spell was used to brew a potion and performs the brewing process.
CICraftCheckCraftWand Internal function. Returns TRUE if the player used the last spell to craft a wand.

CICraftCheckScribeScroll

Checks if the current spell was used to scribe a scroll and performs the scribe process.
CICraftCraftWand Internal function. Create a new player made wand object with properties matching nSpellID and return it.

CICraftScribeScroll

Create and return a magic scroll for a specified spell.
CIDoCraftItemFromConversation Internal function. Craft an item.

This is only to be called from the crafting conversation spawned by x2_s2_crafting!!!
CIGetArmorModificationCost Internal function. Returns the DC to modify oOlditem to look like oNewItem.
CIGetArmorModificationDC Internal function. Returns the cost in gold piece that it would cost to modify oOlditem to look like oNewItem.
CIGetCraftGPCost Internal function. Wrapper for the crafting cost calculation, returns GP required.

CIGetCraftItemStructFrom2DA

Retrieves craft information for a specified item.
CIGetCraftingModeFromTarget Internal function. Returns craft_receipe_struct data.
CIGetCraftingReceipeRow Internal function. Retrieve the row in des_crft_bmat too look up recipe.
CIGetCurrentModBackup Internal function. Returns the value of the flag "X2_O_CRAFT_MODIFY_BACKUP".
CIGetCurrentModItem Internal function. Returns the value of the flag "X2_O_CRAFT_MODIFY_ITEM".
CIGetCurrentModMode Internal function. Returns the value of the flag "X2_L_CRAFT_MODIFY_MODE".
CIGetCurrentModPart Internal function. Returns the value of the flag "X2_TAILOR_CURRENT_PART".
CIGetInModWeaponOrArmorConv Internal function. Returns the value of the flag "X2_L_CRAFT_MODIFY_CONVERSATION".

CIGetIsCraftFeatBaseItem

Returns TRUE if the object is a craft base item.

CIGetIsSpellRestrictedFromCraftFeat

Determines if a spell is restricted for being used for crafting.
CIGetItemPartModificationCost Internal function. Return the cost.
CIGetItemPartModificationDC Internal function. Returns the DC for modifying a certain armor part on oOldItem.
CIGetSpellInnateLevel Internal function. Returns the innate level of a spell.

If bDefaultZeroToOne is given level 0 spell will be returned as level 1 spells.

CIGetSpellWasUsedForItemCreation

Checks if the caster intends to craft an item and returns TRUE if the spell is used up for crafting purposes.
CIGetWeaponModificationCost Internal function. DC to modify oOlditem to look like oNewItem.
CISetCurrentModBackup Internal function. Sets the value of the flag "X2_O_CRAFT_MODIFY_BACKUP".
CISetCurrentModItem Internal function. Sets the value of the flag "X2_O_CRAFT_MODIFY_ITEM".
CISetCurrentModMode Internal function. Deletes or sets the value of the flag "X2_L_CRAFT_MODIFY_MODE".
CISetCurrentModPart Internal function. Store the part currently modified.

Sets up the custom token for the conversation.

Zooms the camera to that part.
CISetDefaultModItemCamera Internal function. Sets the camera facing.
CISetupCraftingConversation Internal function. Used to set all variable required for the crafting conversation.

Used materials, number of choices, 2da row, skill and mode.
CIUpdateModItemCostDC Internal function. Sets the value of the flags "X2_TAILOR_CURRENT_COST" and "X2_TAILOR_CURRENT_DC".

Sets the value of two custom tokens.

CIUseCraftItemSkill

Does a craft check for a given crafting skill to craft an item.
CI_GetClassMagicType Internal function. Return the type of magic as one of the following constants.

CraftBrewPotion

Create and return a magical potion for a specified spell.

GetMaterialComponentTag

Internal function. Gets the tag of the material component required for crafting.



  author: Mistress, contributor: motu99

Personal tools
Categories