# lib_itm function library

Dependencies: alter_effect, lib_2da, lib_anon, lib_array, lib_fn, lib_ini, lib_sfo, lib_struct, lib_sugar, lib_tools, lib_ui

## Description

Functions specifically aimed at editing .itm files.

## Public functions

itm_bespoke_restriction(strip_other_restrictions:i=1, display_strref:i, race:s, scriptname:s)=() patch

(NOT A STRUCT FUNCTION.) Attaches a 319 opcode to an item to make it usable only by a certain race or by a creature with a certain scriptname. Specify 'race' (an entry from race.ids, e.g. TIEFLING) or 'scriptname' (e.g. 'keldorn'). If you specify a scriptname, you should also specify display_strref, the string to display in the 'usable' field (probably a specific creature name).

The function strips any previous race/scriptname 319s, and by default removes any other unusability flags from the item. (Set strip_other_restrictions=0 to skip this.)

itm_copy(tv:i, allow_missing:i, debug:i=1, itm:s, source_path:s, source_location:s, source_locbase:s, path:s, location:s, locbase:s, edits:s)=() action

General copier for itm files. No special features.

itm_edit(tv:i, allow_missing:i, debug:i=1, edit_strrefs_in_place:i, itm:s, path:s, location:s, locbase:s, edits:s)=() action

General editer for itm files. No special features.

itm_make(debug:i=1, itm:s, version:s, path:s, location:s, locbase:s, edits:s)=() action

General maker for itm files. No special features.