x2_inc_craft

Central include for crafting feat and crafting skill system.

NOTE: This file includes x2_inc_itemprop and x2_inc_switches.

Constants

NameValueBrief Description
X2_CI_2DA_SCROLLSdes_crft_scrollName of the scroll 2da.
X2_CI_BREWPOTION_COSTMODIFIER50GP Brew Potion XP cost modifier.
X2_CI_BREWPOTION_FEAT_ID944Brew Potion feat simulation.
X2_CI_BREWPOTION_MAXLEVEL3Max level for potions.
X2_CI_BREWPOTION_NEWITEM_RESREFx2_it_pcpotionResRef for new potion item.
X2_CI_CRAFTINGSKILL_CTOKENBASE13220Base custom token for item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTINGSKILL_DC_CTOKENBASE14220Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTINGSKILL_GP_CTOKENBASE14320Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_CRAFTING_AR_2DAdes_crft_armor2da for the craft skills.
X2_CI_CRAFTING_ITEMS_PER_ROW5How 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_2DAdes_crft_mat2da for the craft skills.
X2_CI_CRAFTING_SP_2DAdes_crft_spells2da for matching spells to properties.
X2_CI_CRAFTING_WP_2DAdes_crft_weapon2da for the craft skills.
X2_CI_CRAFTMODE_ASSEMBLE3
X2_CI_CRAFTMODE_BASE_ITEM2
X2_CI_CRAFTMODE_CONTAINER1No longer used, but left in for the community to reactivate.
X2_CI_CRAFTMODE_INVALID0
X2_CI_CRAFTSKILL_CONVx2_p_craftskills
X2_CI_CRAFTWAND_COSTMODIFIER750Craft Wand cost modifier.
X2_CI_CRAFTWAND_FEAT_ID946Craft Wand feat simulation.
X2_CI_CRAFTWAND_MAXLEVEL4Max level for wands.
X2_CI_CRAFTWAND_NEWITEM_RESREFx2_it_pcwandResRef for new wand item.
X2_CI_MAGICTYPE_ARCANE1
X2_CI_MAGICTYPE_DIVINE2
X2_CI_MAGICTYPE_INVALID0
X2_CI_MODIFYARMOR_GP_CTOKENBASE14420Base custom token for DC item modification conversations (do not change unless you want to change the conversation too).
X2_CI_MODMODE_ARMOR1
X2_CI_MODMODE_INVALID0
X2_CI_MODMODE_WEAPON2
X2_CI_SCRIBESCROLL_COSTMODIFIER25Scribe Scroll cost modifier.
X2_CI_SCRIBESCROLL_FEAT_ID945Scribe Scroll feat simulation.
X2_CI_SCRIBESCROLL_NEWITEM_RESREFx2_it_pcscrollResRef for new scroll item.

Structures

NameVariablesBrief Description
craft_receipe_structint nMode
object oMajor
object oMinor
craft_structint nRow
string sResRef
int nDC
int nCost
string sLabel

Functions

NameBrief Description
CICraftCheckBrewPotionChecks if the current spell was used to brew a potion and performs the brewing process.
CICraftCheckCraftWandInternal function. Returns TRUE if the player used the last spell to craft a wand.
CICraftCheckScribeScrollChecks if the current spell was used to scribe a scroll and performs the scribe process.
CICraftCraftWandInternal function. Create a new player made wand object with properties matching nSpellID and return it.
CICraftScribeScrollCreate and return a magic scroll for a specified spell.
CIDoCraftItemFromConversationInternal function. Craft an item.

This is only to be called from the crafting conversation spawned by x2_s2_crafting!!!
CIGetArmorModificationCostInternal function. Returns the DC to modify oOlditem to look like oNewItem.
CIGetArmorModificationDCInternal function. Returns the cost in gold piece that it would cost to modify oOlditem to look like oNewItem.
CIGetCraftGPCostInternal function. Wrapper for the crafting cost calculation, returns GP required.
CIGetCraftItemStructFrom2DARetrieves craft information for a specified item.
CIGetCraftingModeFromTargetInternal function. Returns craft_receipe_struct data.
CIGetCraftingReceipeRowInternal function. Retrieve the row in des_crft_bmat too look up recipe.
CIGetCurrentModBackupInternal function. Returns the value of the flag "X2_O_CRAFT_MODIFY_BACKUP".
CIGetCurrentModItemInternal function. Returns the value of the flag "X2_O_CRAFT_MODIFY_ITEM".
CIGetCurrentModModeInternal function. Returns the value of the flag "X2_L_CRAFT_MODIFY_MODE".
CIGetCurrentModPartInternal function. Returns the value of the flag "X2_TAILOR_CURRENT_PART".
CIGetInModWeaponOrArmorConvInternal function. Returns the value of the flag "X2_L_CRAFT_MODIFY_CONVERSATION".
CIGetIsCraftFeatBaseItemReturns TRUE if the object is a craft base item.
CIGetIsSpellRestrictedFromCraftFeatDetermines if a spell is restricted for being used for crafting.
CIGetItemPartModificationCostInternal function. Return the cost.
CIGetItemPartModificationDCInternal function. Returns the DC for modifying a certain armor part on oOldItem.
CIGetSpellInnateLevelInternal function. Returns the innate level of a spell.

If bDefaultZeroToOne is given level 0 spell will be returned as level 1 spells.
CIGetSpellWasUsedForItemCreationChecks if the caster intends to craft an item and returns TRUE if the spell is used up for crafting purposes.
CIGetWeaponModificationCostInternal function. DC to modify oOlditem to look like oNewItem.
CISetCurrentModBackupInternal function. Sets the value of the flag "X2_O_CRAFT_MODIFY_BACKUP".
CISetCurrentModItemInternal function. Sets the value of the flag "X2_O_CRAFT_MODIFY_ITEM".
CISetCurrentModModeInternal function. Deletes or sets the value of the flag "X2_L_CRAFT_MODIFY_MODE".
CISetCurrentModPartInternal function. Store the part currently modified.

Sets up the custom token for the conversation.

Zooms the camera to that part.
CISetDefaultModItemCameraInternal function. Sets the camera facing.
CISetupCraftingConversationInternal function. Used to set all variable required for the crafting conversation.

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

Sets the value of two custom tokens.
CIUseCraftItemSkillDoes a craft check for a given crafting skill to craft an item.
CI_GetClassMagicTypeInternal function. Return the type of magic as one of the following constants.
CraftBrewPotionCreate and return a magical potion for a specified spell.
GetMaterialComponentTagInternal function. Gets the tag of the material component required for crafting.


  author: Mistress, contributor: motu99