@bgforge/mls-server 3.0.1 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2276,7 +2276,7 @@
2276
2276
  "category": "patch",
2277
2277
  "documentation": {
2278
2278
  "kind": "markdown",
2279
- "value": "```weidu-tp2-tooltip\nCOMPILE_BAF_TO_BCS\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BAF script, is compiled to a BCS. In general you should use the COMPILE TP2 Action instead, unless you are using other patch commands to modify the file under consideration."
2279
+ "value": "```weidu-tp2-tooltip\nCOMPILE_BAF_TO_BCS\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BAF script, is compiled to a BCS. In general you should use the COMPILE TP2 Action instead, unless you are using other patch commands to modify the file under consideration.\n\n**Deprecated**"
2280
2280
  },
2281
2281
  "tags": [
2282
2282
  1
@@ -2289,7 +2289,7 @@
2289
2289
  "category": "patch",
2290
2290
  "documentation": {
2291
2291
  "kind": "markdown",
2292
- "value": "```weidu-tp2-tooltip\nCOMPILE_D_TO_DLG\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid D file that defines a single DLG file (via an obvious BEGIN action) is compiled to a DLG. Typically this is only used after a DECOMPILE_DLG_TO_D."
2292
+ "value": "```weidu-tp2-tooltip\nCOMPILE_D_TO_DLG\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid D file that defines a single DLG file (via an obvious BEGIN action) is compiled to a DLG. Typically this is only used after a DECOMPILE_DLG_TO_D.\n\n**Deprecated**"
2293
2293
  },
2294
2294
  "tags": [
2295
2295
  1
@@ -2372,7 +2372,7 @@
2372
2372
  "category": "patch",
2373
2373
  "documentation": {
2374
2374
  "kind": "markdown",
2375
- "value": "```weidu-tp2-tooltip\nDECOMPILE_BCS_TO_BAF\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BCS script, is decompiled to a BAF."
2375
+ "value": "```weidu-tp2-tooltip\nDECOMPILE_BCS_TO_BAF\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BCS script, is decompiled to a BAF.\n\n**Deprecated**"
2376
2376
  },
2377
2377
  "tags": [
2378
2378
  1
@@ -2385,7 +2385,7 @@
2385
2385
  "category": "patch",
2386
2386
  "documentation": {
2387
2387
  "kind": "markdown",
2388
- "value": "```weidu-tp2-tooltip\nDECOMPILE_DLG_TO_D\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid DLG file, is decompile to a textual D file (with string refs and no comments). Once you have a D file you can use other patch commands to change the actions and triggers around. You should use D actions (like REPLACE_ACTION_TEXT) instead whenever possible."
2388
+ "value": "```weidu-tp2-tooltip\nDECOMPILE_DLG_TO_D\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid DLG file, is decompile to a textual D file (with string refs and no comments). Once you have a D file you can use other patch commands to change the actions and triggers around. You should use D actions (like REPLACE_ACTION_TEXT) instead whenever possible.\n\n**Deprecated**"
2389
2389
  },
2390
2390
  "tags": [
2391
2391
  1
@@ -5812,7 +5812,7 @@
5812
5812
  "category": "actionFunctions",
5813
5813
  "documentation": {
5814
5814
  "kind": "markdown",
5815
- "value": "```weidu-tp2-tooltip\nHANDLE_AUDIO\n```\nInstall Ogg--Vorbis compressed audio files in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games, including BG:EE. If the game is not BG:EE, the audio will be decompressed and the resulting .wav files will be `MOVE`d to the override. If the game is BG:EE, the .ogg files are copied into the override and renamed into .wav files. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nIf the audio files need to be decompressed, this function will use oggdec.exe on Windows, which is by default expected to be found in `audio_path`. The most recent version of oggdec can be downloaded [http://downloads.xiph.org/releases/vorbis/vorbis-tools-win32-bin.7z here] (direct link). On OS X, SoX will be used, which is by default also expected to be found in `audio_path`. SoX compiled for OS X can be downloaded [http://sourceforge.net/projects/sox/files/sox/14.4.1/sox-14.4.1-macosx.zip/download here]. On GNU/Linux, oggdec will be used, but it is expected to be found on the system path and the user should install it him/herself. If you provide installation instructions for GNU/Linux, just include something to the effect of \"install oggdec, which is usually part of the package vorbis-tools\".\n\nIf the decompression utility cannot be found, the user is warned that the audio files were not installed.\n\n- INT_VAR `music` if this variable is not `0` and the game is BG:EE, the audio files are given the extension `.acm` instead of `.wav`. This variable has no effect if the game is not BG:EE. By default its value is `0`.\n- INT_VAR `quiet` if this variable is `1`, the function will suppress output from oggdec and sox. By default this is `0`.\n- STR_VAR `audio_path` to the path your `.ogg` files are stored in. By default this variable is `~%MOD_FOLDER%/audio~`.\n- STR_VAR `oggdec_path` to the path oggdec is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `sox_path` to the path SoX is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `output_path` to the path the audio should be installed into. By default this variable is `override`.\n"
5815
+ "value": "```weidu-tp2-tooltip\naction function HANDLE_AUDIO\n```\nInstall Ogg--Vorbis compressed audio files in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games, including BG:EE. If the game is not BG:EE, the audio will be decompressed and the resulting .wav files will be `MOVE`d to the override. If the game is BG:EE, the .ogg files are copied into the override and renamed into .wav files. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nIf the audio files need to be decompressed, this function will use oggdec.exe on Windows, which is by default expected to be found in `audio_path`. The most recent version of oggdec can be downloaded [http://downloads.xiph.org/releases/vorbis/vorbis-tools-win32-bin.7z here] (direct link). On OS X, SoX will be used, which is by default also expected to be found in `audio_path`. SoX compiled for OS X can be downloaded [http://sourceforge.net/projects/sox/files/sox/14.4.1/sox-14.4.1-macosx.zip/download here]. On GNU/Linux, oggdec will be used, but it is expected to be found on the system path and the user should install it him/herself. If you provide installation instructions for GNU/Linux, just include something to the effect of \"install oggdec, which is usually part of the package vorbis-tools\".\n\nIf the decompression utility cannot be found, the user is warned that the audio files were not installed.\n\n- INT_VAR `music` if this variable is not `0` and the game is BG:EE, the audio files are given the extension `.acm` instead of `.wav`. This variable has no effect if the game is not BG:EE. By default its value is `0`.\n- INT_VAR `quiet` if this variable is `1`, the function will suppress output from oggdec and sox. By default this is `0`.\n- STR_VAR `audio_path` to the path your `.ogg` files are stored in. By default this variable is `~%MOD_FOLDER%/audio~`.\n- STR_VAR `oggdec_path` to the path oggdec is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `sox_path` to the path SoX is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `output_path` to the path the audio should be installed into. By default this variable is `override`.\n"
5816
5816
  }
5817
5817
  },
5818
5818
  {
@@ -5822,7 +5822,7 @@
5822
5822
  "category": "actionFunctions",
5823
5823
  "documentation": {
5824
5824
  "kind": "markdown",
5825
- "value": "```weidu-tp2-tooltip\nHANDLE_CHARSETS\n```\nRuntime-convert `TRA` files into `UTF-8` in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X and GNU/Linux. If the game is BG:EE or BG2:EE, `TRA` files are encoded into `UTF-8` so the text can be installed without causing problems. `HANDLE_CHARSETS` needs to be used before any text is installed and is compatible with `AUTO_TRA` and all other methods of loading `TRA` files.\n\nConversion is handled by the program `iconv`. The program is available as part of the base system on OS X and GNU/Linux but a Windows version needs to be included in your mod. A Windows version can be downloaded [http://gnuwin32.sourceforge.net/packages/libiconv.htm here].\n\nIn order to function, `HANDLE_CHARSETS` needs to know a few things. First, you need to specify where you keep your `TRA` files. You do this with the variable `tra_path`. Second, `HANDLE_CHARSETS` needs to know where the Windows version of `iconv` is located. You do this with the variable `iconv_path`. Third, `HANDLE_CHARSETS` needs to know which character set the `TRA` files are in. Note that they can only be converted into `UTF-8` and cannot already be in `UTF-8`. You provide this information with `charset_table` or tell `HANDLE_CHARSETS` to try to infer this by itself with `infer_charsets`. Lastly, `HANDLE_CHARSETS` needs to know which `TRA` files to convert and whether any of them should be reloaded. You can do this with `noconvert_array`, `convert_array` and `reload_array`.\n\nUnless `convert_array` is specified, `HANDLE_CHARSETS` will recursively convert all `TRA` files in `tra_path` except those listed in `noconvert_array`. If `convert_array` is specified, only those `TRA` files listed in the array will be converted. `convert_array` may contain references to `TRA` files in subdirectories of `tra_path`.\n\n- INT_VAR `infer_charsets` to whether `HANDLE_CHARSETS` should try to infer which character set the `TRA` files are encoded in. It uses the contents of the `%language%` variable (''vide infra''). If the contents of the variable can be recognised, `HANDLE_CHARSETS` will use the character set used by the localised version of BG2 for this language. If the contents of the variable cannot be recognised, or if the `TRA` files use a different character set than the expected one, `HANDLE_CHARSETS` will fail. Refer to the compatibility matrix below for additional information. `infer_charsets` overrides `charset_table`. Defaults to `0`.\n- INT_VAR `from_utf8` to whether the function should assume the source `TRA` files are in UTF-8 or not. The default value is `0`, that is, the function assumes the `TRA` files use language-dependent charater sets and should be converted into UTF-8 when the mod is installed on EE-type games; the function produces no results on the original editions of the games. If set to `1`, the source `TRA` files are assumed to be in UTF-8 and are to be converted into language-dependent character sets when the mod is installed on original editions of the games; the function produces no results when installed on EE-type games.\n- INT_VAR `verbose` to whether the function should print debug information. Defaults to `0`.\n- STR_VAR `language` to the name of the language directory you wish to convert. The default value of this variable is `\\%LANGUAGE\\%`, in other words, the directory corresponding to the language the user selected at the start of the installation. You should never need to alter the value of this variable.\n- STR_VAR `default_language` to the name of the directory used by the default language of your mod, if your mod has one. The default language is typically one for which the translation is always complete and up to date and which you use to guard against incomplete translations. `HANDLE_CHARSETS` will convert the `TRA` files of the default language in addition to those of the user-selected language. Should these two languages be the same, the `TRA` files will only be converted once. Additionally, any `TRA` files listed in the `reload_array` (''vide infra'') will be reloaded for the default language before they are reloaded for the user-selected language. The default value of this variable is `~~` (the empty string).\n- STR_VAR `tra_path` to the path where your mod's language directories are located. `%tra_path%/%language%` should be a valid directory containing `TRA` files.\n- STR_VAR `out_path` to the path to which the converted files should be directed. The default value of this variable is `%tra_path%`, that is, the converted files reversibly overwrite the originals and the conversion is transparent to the rest of your mod. Note that if `%tra_path%` and `%out_path%` are the same directory, the conversion will naturally happen only once regardless of how many times `HANDLE_CHARSETS` are invoked, but if the directories are different, the conversion will happen for every invocation (notably, if `HANDLE_CHARSETS` is invoked among the `ALWAYS` actions).\n- STR_VAR `iconv_path` to the path where iconv.exe is located. Defaults to `%tra_path%/iconv`.\n- STR_VAR `charset_table` to the name of an associative array where the keys are the names of your language directories and the corresponding values are the character sets used by the respective language. The keys must be entirely in lowercase. `charset_table` is not used if you also specify `infer_charsets`.\n- STR_VAR `noconvert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should not be converted into `UTF-8`. All `TRA` files in the language directory and its subdirectories except the ones listed in `noconvert_array` will be converted. The .tra file extension is optional. This variable should not be provided if you also provide `convert_array`.\n- STR_VAR `convert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should be converted into `UTF-8`. Only those `TRA` files in the language directory or its subdirectories which are listed in `convert_array` will be converted. The .tra file extension is optional. If this variable is provided, `noconvert_array` will not be used.\n- STR_VAR `reload_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files which should be reloaded after they have been converted. The .tra file extension is optional. You should use this variable for reloading those `TRA` files loaded by `LANGUAGE` which should also be converted.\n- STR_VAR `exclude_directories` to the name of an array indexed by monotonically increasing integers starting from `0`. The values should be the names of directories whose contents should not be converted. The directories should be subdirectories within `%tra_path%/%language%` or its subdirectories. Only the directory name itself should be specified, not its path.\n- STR_VAR `file_regexp` to a regexp expression with the file names that must be converted. Defaults to `~.+\\.tra~`.\n"
5825
+ "value": "```weidu-tp2-tooltip\naction function HANDLE_CHARSETS\n```\nRuntime-convert `TRA` files into `UTF-8` in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X and GNU/Linux. If the game is BG:EE or BG2:EE, `TRA` files are encoded into `UTF-8` so the text can be installed without causing problems. `HANDLE_CHARSETS` needs to be used before any text is installed and is compatible with `AUTO_TRA` and all other methods of loading `TRA` files.\n\nConversion is handled by the program `iconv`. The program is available as part of the base system on OS X and GNU/Linux but a Windows version needs to be included in your mod. A Windows version can be downloaded [http://gnuwin32.sourceforge.net/packages/libiconv.htm here].\n\nIn order to function, `HANDLE_CHARSETS` needs to know a few things. First, you need to specify where you keep your `TRA` files. You do this with the variable `tra_path`. Second, `HANDLE_CHARSETS` needs to know where the Windows version of `iconv` is located. You do this with the variable `iconv_path`. Third, `HANDLE_CHARSETS` needs to know which character set the `TRA` files are in. Note that they can only be converted into `UTF-8` and cannot already be in `UTF-8`. You provide this information with `charset_table` or tell `HANDLE_CHARSETS` to try to infer this by itself with `infer_charsets`. Lastly, `HANDLE_CHARSETS` needs to know which `TRA` files to convert and whether any of them should be reloaded. You can do this with `noconvert_array`, `convert_array` and `reload_array`.\n\nUnless `convert_array` is specified, `HANDLE_CHARSETS` will recursively convert all `TRA` files in `tra_path` except those listed in `noconvert_array`. If `convert_array` is specified, only those `TRA` files listed in the array will be converted. `convert_array` may contain references to `TRA` files in subdirectories of `tra_path`.\n\n- INT_VAR `infer_charsets` to whether `HANDLE_CHARSETS` should try to infer which character set the `TRA` files are encoded in. It uses the contents of the `%language%` variable (''vide infra''). If the contents of the variable can be recognised, `HANDLE_CHARSETS` will use the character set used by the localised version of BG2 for this language. If the contents of the variable cannot be recognised, or if the `TRA` files use a different character set than the expected one, `HANDLE_CHARSETS` will fail. Refer to the compatibility matrix below for additional information. `infer_charsets` overrides `charset_table`. Defaults to `0`.\n- INT_VAR `from_utf8` to whether the function should assume the source `TRA` files are in UTF-8 or not. The default value is `0`, that is, the function assumes the `TRA` files use language-dependent charater sets and should be converted into UTF-8 when the mod is installed on EE-type games; the function produces no results on the original editions of the games. If set to `1`, the source `TRA` files are assumed to be in UTF-8 and are to be converted into language-dependent character sets when the mod is installed on original editions of the games; the function produces no results when installed on EE-type games.\n- INT_VAR `verbose` to whether the function should print debug information. Defaults to `0`.\n- STR_VAR `language` to the name of the language directory you wish to convert. The default value of this variable is `\\%LANGUAGE\\%`, in other words, the directory corresponding to the language the user selected at the start of the installation. You should never need to alter the value of this variable.\n- STR_VAR `default_language` to the name of the directory used by the default language of your mod, if your mod has one. The default language is typically one for which the translation is always complete and up to date and which you use to guard against incomplete translations. `HANDLE_CHARSETS` will convert the `TRA` files of the default language in addition to those of the user-selected language. Should these two languages be the same, the `TRA` files will only be converted once. Additionally, any `TRA` files listed in the `reload_array` (''vide infra'') will be reloaded for the default language before they are reloaded for the user-selected language. The default value of this variable is `~~` (the empty string).\n- STR_VAR `tra_path` to the path where your mod's language directories are located. `%tra_path%/%language%` should be a valid directory containing `TRA` files.\n- STR_VAR `out_path` to the path to which the converted files should be directed. The default value of this variable is `%tra_path%`, that is, the converted files reversibly overwrite the originals and the conversion is transparent to the rest of your mod. Note that if `%tra_path%` and `%out_path%` are the same directory, the conversion will naturally happen only once regardless of how many times `HANDLE_CHARSETS` are invoked, but if the directories are different, the conversion will happen for every invocation (notably, if `HANDLE_CHARSETS` is invoked among the `ALWAYS` actions).\n- STR_VAR `iconv_path` to the path where iconv.exe is located. Defaults to `%tra_path%/iconv`.\n- STR_VAR `charset_table` to the name of an associative array where the keys are the names of your language directories and the corresponding values are the character sets used by the respective language. The keys must be entirely in lowercase. `charset_table` is not used if you also specify `infer_charsets`.\n- STR_VAR `noconvert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should not be converted into `UTF-8`. All `TRA` files in the language directory and its subdirectories except the ones listed in `noconvert_array` will be converted. The .tra file extension is optional. This variable should not be provided if you also provide `convert_array`.\n- STR_VAR `convert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should be converted into `UTF-8`. Only those `TRA` files in the language directory or its subdirectories which are listed in `convert_array` will be converted. The .tra file extension is optional. If this variable is provided, `noconvert_array` will not be used.\n- STR_VAR `reload_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files which should be reloaded after they have been converted. The .tra file extension is optional. You should use this variable for reloading those `TRA` files loaded by `LANGUAGE` which should also be converted.\n- STR_VAR `exclude_directories` to the name of an array indexed by monotonically increasing integers starting from `0`. The values should be the names of directories whose contents should not be converted. The directories should be subdirectories within `%tra_path%/%language%` or its subdirectories. Only the directory name itself should be specified, not its path.\n- STR_VAR `file_regexp` to a regexp expression with the file names that must be converted. Defaults to `~.+\\.tra~`.\n"
5826
5826
  }
5827
5827
  },
5828
5828
  {
@@ -5832,7 +5832,7 @@
5832
5832
  "category": "actionFunctions",
5833
5833
  "documentation": {
5834
5834
  "kind": "markdown",
5835
- "value": "```weidu-tp2-tooltip\nHANDLE_TILESETS\n```\nInstall TISpack-compressed tilesets in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games that support the `TIS V1` file format. The program tisunpack, part of `TISpack`, is used to decompress the provided .tiz files and the resulting .tis files are placed in the override. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nThis function expects to find tisunpack for one or more of Windows, OS X or GNU/Linux in a common directory under the subdirectories `win32`, `osx`, and `unix`, respectively. For example, in `mymod/tiz/win32`, `mymod/tiz/osx` and `mymod/tiz/unix`, the common directory is `mymod/tiz` and `mymod/tiz/win32/tisunpack.exe` should be a valid file. For GNU/Linux, this function also supports tisunpack being located on the system path (something the user would take care of). If you choose to leave tisunpack to the user, you should mention this requirement in any installation instructions you provide.\n\nIf tisunpack for the user's platform could not be found, the installation fails.\n\n- STR_VAR `tiz_path` to the path your .tiz files are stored in. By default this variable is `~%MOD_FOLDER%/tiz~`.\n- STR_VAR `tisunpack_path` to the common directory where the subdirectories `win32`, `osx` and `unix` are located. By default this variable is `~%tiz_path%~`.\n- STR_VAR `output_path` to the path the tilesets should be installed into. By default this variable is `override`.\n"
5835
+ "value": "```weidu-tp2-tooltip\naction function HANDLE_TILESETS\n```\nInstall TISpack-compressed tilesets in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games that support the `TIS V1` file format. The program tisunpack, part of `TISpack`, is used to decompress the provided .tiz files and the resulting .tis files are placed in the override. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nThis function expects to find tisunpack for one or more of Windows, OS X or GNU/Linux in a common directory under the subdirectories `win32`, `osx`, and `unix`, respectively. For example, in `mymod/tiz/win32`, `mymod/tiz/osx` and `mymod/tiz/unix`, the common directory is `mymod/tiz` and `mymod/tiz/win32/tisunpack.exe` should be a valid file. For GNU/Linux, this function also supports tisunpack being located on the system path (something the user would take care of). If you choose to leave tisunpack to the user, you should mention this requirement in any installation instructions you provide.\n\nIf tisunpack for the user's platform could not be found, the installation fails.\n\n- STR_VAR `tiz_path` to the path your .tiz files are stored in. By default this variable is `~%MOD_FOLDER%/tiz~`.\n- STR_VAR `tisunpack_path` to the common directory where the subdirectories `win32`, `osx` and `unix` are located. By default this variable is `~%tiz_path%~`.\n- STR_VAR `output_path` to the path the tilesets should be installed into. By default this variable is `override`.\n"
5836
5836
  }
5837
5837
  },
5838
5838
  {
@@ -5842,7 +5842,7 @@
5842
5842
  "category": "actionFunctions",
5843
5843
  "documentation": {
5844
5844
  "kind": "markdown",
5845
- "value": "```weidu-tp2-tooltip\nINSTALL_PVRZ\n```\nInstall a PVRZ file and updates the PVRZ index. This is an ACTION function.\n This function copies the specified PVRZ file into the target folder and updates the PVRZ index. This function should be used in conjunction with UPDATE_PVRZ_INDICES.\n - INT_VAR `original_base_index` to the current base index. This value is returned by the function UPDATE_PVRZ_INDICES as `original_base_index`.\n - INT_VAR `new_base_index` to the new base index. This value is returned by the function UPDATE_PVRZ_INDICES as `new_base_index`.\n - STR_VAR `source_file` to the source file to copy. The filename must match the regular expression ~MOS[0-9]+\\.PVRZ~ (e.g., MOS0000.PVRZ, mos1592.pvrz or Mos12345.PVRZ). Case is ignored.\n - STR_VAR `target_folder` to the target folder to copy the source file into. The default value is \"override\".\n - RET `success` is set to non-zero if the function returned successfully and is set to zero on error.\n This function can additionally return all the variables automatically set by COPY."
5845
+ "value": "```weidu-tp2-tooltip\naction function INSTALL_PVRZ\n```\nInstall a PVRZ file and updates the PVRZ index. This is an ACTION function.\n This function copies the specified PVRZ file into the target folder and updates the PVRZ index. This function should be used in conjunction with UPDATE_PVRZ_INDICES.\n - INT_VAR `original_base_index` to the current base index. This value is returned by the function UPDATE_PVRZ_INDICES as `original_base_index`.\n - INT_VAR `new_base_index` to the new base index. This value is returned by the function UPDATE_PVRZ_INDICES as `new_base_index`.\n - STR_VAR `source_file` to the source file to copy. The filename must match the regular expression ~MOS[0-9]+\\.PVRZ~ (e.g., MOS0000.PVRZ, mos1592.pvrz or Mos12345.PVRZ). Case is ignored.\n - STR_VAR `target_folder` to the target folder to copy the source file into. The default value is \"override\".\n - RET `success` is set to non-zero if the function returned successfully and is set to zero on error.\n This function can additionally return all the variables automatically set by COPY."
5846
5846
  }
5847
5847
  },
5848
5848
  {
@@ -5852,7 +5852,7 @@
5852
5852
  "category": "actionFunctions",
5853
5853
  "documentation": {
5854
5854
  "kind": "markdown",
5855
- "value": "```weidu-tp2-tooltip\nsc#addWmpAre\n```\nAdds an area to the worldmap. All variables are zero or blank by default unless otherwise indicated. This is an ACTION function.\n\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `toNewArea` to the area references that lead to the new area;\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `fromNewArea` to the area references that lead away from the new area;\n- STR_VAR `areName` to the resource reference of the area to add (like \\\"ar0700\\\");\n- STR_VAR `strName` to the descriptive name of the area (like \\\"Waukeen's Promenade\\\");\n- STR_VAR `strDesc` to the area description that will show up when hovering the cursor over the area on the worldmap;\n- STR_VAR `worldmap` to the name of the .wmp file you want patched (default is \\\"worldmap\\\");\n- INT_VAR `mapIcon` to the area's map icon index (from mapicons.bam);\n- INT_VAR `xCoord` to the area's X (east-west) coordinate;\n- INT_VAR `yCoord` to the area's Y (north-south) coordinate;\n- INT_VAR `tTime` to the area's travel time in hours * 4 (so 2 = 8 hours);\n- INT_VAR `inclSv` to 1 if you want to patch saved game worldmaps as well as the master worldmap. '''NB:''' changes to saved games are uninstallable;\n- INT_VAR `visible` to 1 if you want the ''visible'' flag to be set;\n- INT_VAR `visibleAdjacent` to 1 if you want the ''visible from adjacent'' flag to be set;\n- INT_VAR `reachable` to 1 if you want the ''reachable'' flag to be set;\n- INT_VAR `visited` to 1 if you want the ''visited'' flag to be set;\n- RET `areNum` returns the worldmap entry number for the new area;\n"
5855
+ "value": "```weidu-tp2-tooltip\naction function sc#addWmpAre\n```\nAdds an area to the worldmap. All variables are zero or blank by default unless otherwise indicated. This is an ACTION function.\n\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `toNewArea` to the area references that lead to the new area;\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `fromNewArea` to the area references that lead away from the new area;\n- STR_VAR `areName` to the resource reference of the area to add (like \\\"ar0700\\\");\n- STR_VAR `strName` to the descriptive name of the area (like \\\"Waukeen's Promenade\\\");\n- STR_VAR `strDesc` to the area description that will show up when hovering the cursor over the area on the worldmap;\n- STR_VAR `worldmap` to the name of the .wmp file you want patched (default is \\\"worldmap\\\");\n- INT_VAR `mapIcon` to the area's map icon index (from mapicons.bam);\n- INT_VAR `xCoord` to the area's X (east-west) coordinate;\n- INT_VAR `yCoord` to the area's Y (north-south) coordinate;\n- INT_VAR `tTime` to the area's travel time in hours * 4 (so 2 = 8 hours);\n- INT_VAR `inclSv` to 1 if you want to patch saved game worldmaps as well as the master worldmap. '''NB:''' changes to saved games are uninstallable;\n- INT_VAR `visible` to 1 if you want the ''visible'' flag to be set;\n- INT_VAR `visibleAdjacent` to 1 if you want the ''visible from adjacent'' flag to be set;\n- INT_VAR `reachable` to 1 if you want the ''reachable'' flag to be set;\n- INT_VAR `visited` to 1 if you want the ''visited'' flag to be set;\n- RET `areNum` returns the worldmap entry number for the new area;\n"
5856
5856
  }
5857
5857
  },
5858
5858
  {
@@ -5862,7 +5862,7 @@
5862
5862
  "category": "patchFunctions",
5863
5863
  "documentation": {
5864
5864
  "kind": "markdown",
5865
- "value": "```weidu-tp2-tooltip\nADD_AREA_ITEM\n```\nAdds an item to a container of an area. This is a PATCH macro and function.\n - SPRINT `item_to_add` to the item you want to add\n - SET `container_to_add_to` to the number of the container the item should be added to. The count starts at 1.\n - SPRINT `flags` to flags the item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
5865
+ "value": "```weidu-tp2-tooltip\npatch function ADD_AREA_ITEM\n```\nAdds an item to a container of an area. This is a PATCH macro and function.\n - SPRINT `item_to_add` to the item you want to add\n - SET `container_to_add_to` to the number of the container the item should be added to. The count starts at 1.\n - SPRINT `flags` to flags the item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
5866
5866
  }
5867
5867
  },
5868
5868
  {
@@ -5872,7 +5872,7 @@
5872
5872
  "category": "patchFunctions",
5873
5873
  "documentation": {
5874
5874
  "kind": "markdown",
5875
- "value": "```weidu-tp2-tooltip\nADD_AREA_REGION_TRIGGER\n```\nAdds an area region to the current are file. This is a PATCH macro and function. Unlike other macros you do not need to set every variable. You are only required to set those values that you need to write.\n - SPRINT `ab_RT_Name` -- Name to assign to new region\n - SET `ab_RT_Type` -- Type of trigger -- 0=proximity; 1=info; 2=travel\n - SET `ab_RT_BbLX` -- Bounding Box - low x value - LEFT\n - SET `ab_RT_BbLY` -- Bounding Box - low y value - TOP\n - SET `ab_RT_BbHX` -- Bounding Box - High x value - RIGHT\n - SET `ab_RT_BbHY` -- Bounding Box - High y value - BOTTOM\n - SET `ab_RT_VxPr` -- Number of Vertex Pairs for current region\n - SET `ab_RT_CuId` -- Cursor Index - points to a graphic in cursors.bam\n - SPRINT `ab_RT_Dest` -- Destination Area\n - SPRINT `ab_RT_EntN` -- Entrance Name\n - SET `ab_RT_Fbit` -- Flag bits set in bit format which are read right to left - 0=off; 1=on\n - SET `ab_RT_Itxt` -- Info text\n - SET `ab_RT_TDtD` -- Trap Detection Difficulty\n - SET `ab_RT_TRmD` -- Trap Removal Difficulty\n - SET `ab_RT_TSet` -- Trap is set - 0=no; 1=yes\n - SET `ab_RT_TDet` -- Trap is detected - 0=no; 1=yes\n - SET `ab_RT_LPoX` -- Launch Point X\n - SET `ab_RT_LPoY` -- Launch Point Y\n - SPRINT `ab_RT_KeyI` -- Key Item\n - SET `ab_RT_Rbcs` -- Region Script file\n - SET `ab_RT_ALPX` -- Alternate Launch Point X\n - SET `ab_RT_ALPY` -- Alternate Launch Point Y\n - SET `ab_RT_Dial` -- Dialog file (used only in PST)\n The vertex points are separated by their XY values You may have as many pairs as you need. Just copy this set and increment the #. Example\":\" For the X values\":\" 'ab_RT_Vx_X_0', 'ab_RT_Vx_X_1', 'ab_RT_Vx_X_2'\n For the Y values\":\" 'ab_RT_Vx_Y_0', 'ab_RT_Vx_Y_1', 'ab_RT_Vx_Y_2'\n - SET `ab_RT_Vx_X_0` -- Point #0 X value\n - SET `ab_RT_Vx_Y_0` -- Point #0 Y value\n NOTE: The original code released in WeiDU v211 has been overhauled and re-released in v212. Therefore, the user defined variable names have been changed. If you used the 211 version you will need to update your mod to use the variables in this version. Sorry for the inconvenience..."
5875
+ "value": "```weidu-tp2-tooltip\npatch function ADD_AREA_REGION_TRIGGER\n```\nAdds an area region to the current are file. This is a PATCH macro and function. Unlike other macros you do not need to set every variable. You are only required to set those values that you need to write.\n - SPRINT `ab_RT_Name` -- Name to assign to new region\n - SET `ab_RT_Type` -- Type of trigger -- 0=proximity; 1=info; 2=travel\n - SET `ab_RT_BbLX` -- Bounding Box - low x value - LEFT\n - SET `ab_RT_BbLY` -- Bounding Box - low y value - TOP\n - SET `ab_RT_BbHX` -- Bounding Box - High x value - RIGHT\n - SET `ab_RT_BbHY` -- Bounding Box - High y value - BOTTOM\n - SET `ab_RT_VxPr` -- Number of Vertex Pairs for current region\n - SET `ab_RT_CuId` -- Cursor Index - points to a graphic in cursors.bam\n - SPRINT `ab_RT_Dest` -- Destination Area\n - SPRINT `ab_RT_EntN` -- Entrance Name\n - SET `ab_RT_Fbit` -- Flag bits set in bit format which are read right to left - 0=off; 1=on\n - SET `ab_RT_Itxt` -- Info text\n - SET `ab_RT_TDtD` -- Trap Detection Difficulty\n - SET `ab_RT_TRmD` -- Trap Removal Difficulty\n - SET `ab_RT_TSet` -- Trap is set - 0=no; 1=yes\n - SET `ab_RT_TDet` -- Trap is detected - 0=no; 1=yes\n - SET `ab_RT_LPoX` -- Launch Point X\n - SET `ab_RT_LPoY` -- Launch Point Y\n - SPRINT `ab_RT_KeyI` -- Key Item\n - SET `ab_RT_Rbcs` -- Region Script file\n - SET `ab_RT_ALPX` -- Alternate Launch Point X\n - SET `ab_RT_ALPY` -- Alternate Launch Point Y\n - SET `ab_RT_Dial` -- Dialog file (used only in PST)\n The vertex points are separated by their XY values You may have as many pairs as you need. Just copy this set and increment the #. Example\":\" For the X values\":\" 'ab_RT_Vx_X_0', 'ab_RT_Vx_X_1', 'ab_RT_Vx_X_2'\n For the Y values\":\" 'ab_RT_Vx_Y_0', 'ab_RT_Vx_Y_1', 'ab_RT_Vx_Y_2'\n - SET `ab_RT_Vx_X_0` -- Point #0 X value\n - SET `ab_RT_Vx_Y_0` -- Point #0 Y value\n NOTE: The original code released in WeiDU v211 has been overhauled and re-released in v212. Therefore, the user defined variable names have been changed. If you used the 211 version you will need to update your mod to use the variables in this version. Sorry for the inconvenience..."
5876
5876
  }
5877
5877
  },
5878
5878
  {
@@ -5882,7 +5882,7 @@
5882
5882
  "category": "patchFunctions",
5883
5883
  "documentation": {
5884
5884
  "kind": "markdown",
5885
- "value": "```weidu-tp2-tooltip\nADD_CRE_EFFECT\n```\nAdds an effect to a creature. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode.\n - SET `timing` to timing type.\n - SET `target` to target type.\n - SET `parameter1` to first parameter.\n - SET `parameter2` to second parameter.\n - SET `parameter3` to third parameter.\n - SET `parameter4` to forth parameter.\n - SET `power` to power.\n - SET `resist_dispel` to magic resistance/dispel type.\n - SET `duration` to duration.\n - SET `probability1` to probability 1 (default 100).\n - SET `probability2` to probability 2.\n - SPRINT `resource` to resource (8 chars max).\n - SPRINT `resource2` to second resource (8 chars max).\n - SPRINT `vvcresource` to VVC resource (8 chars max).\n - SPRINT `effsource` to effect source.\n - SPRINT `effvar` to effect variable.\n - SET `dicenumber` to number of dices to be thrown.\n - SET `dicesize` to size of dices to be thrown.\n - SET `savingthrow` to type of savingthrow to be allowed against the effect.\n - SET `savebonus` to saving throw bonus.\n - SET `school` to magical school.\n - SET `special` to the special parameter (only valid for functions; not macros).\n - SET `lowestafflvl` to lowest affected level.\n - SET `highestafflvl` to highest affected level.\n - SET `casterx` to caster X position.\n - SET `castery` to caster Y position.\n - SET `targetx` to target X position.\n - SET `targety` to target Y position.\n - SET `restype` to source resource type.\n - SET `sourceslot` to source resource slot.\n - SET `casterlvl` to caster level.\n - SET `sectype` to secondary type.\n - SET `insert_point` to the index at which the new effect is to be inserted. 0 is first and negative values or values equal to or exceeding the existing number of effects are last."
5885
+ "value": "```weidu-tp2-tooltip\npatch function ADD_CRE_EFFECT\n```\nAdds an effect to a creature. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode.\n - SET `timing` to timing type.\n - SET `target` to target type.\n - SET `parameter1` to first parameter.\n - SET `parameter2` to second parameter.\n - SET `parameter3` to third parameter.\n - SET `parameter4` to forth parameter.\n - SET `power` to power.\n - SET `resist_dispel` to magic resistance/dispel type.\n - SET `duration` to duration.\n - SET `probability1` to probability 1 (default 100).\n - SET `probability2` to probability 2.\n - SPRINT `resource` to resource (8 chars max).\n - SPRINT `resource2` to second resource (8 chars max).\n - SPRINT `vvcresource` to VVC resource (8 chars max).\n - SPRINT `effsource` to effect source.\n - SPRINT `effvar` to effect variable.\n - SET `dicenumber` to number of dices to be thrown.\n - SET `dicesize` to size of dices to be thrown.\n - SET `savingthrow` to type of savingthrow to be allowed against the effect.\n - SET `savebonus` to saving throw bonus.\n - SET `school` to magical school.\n - SET `special` to the special parameter (only valid for functions; not macros).\n - SET `lowestafflvl` to lowest affected level.\n - SET `highestafflvl` to highest affected level.\n - SET `casterx` to caster X position.\n - SET `castery` to caster Y position.\n - SET `targetx` to target X position.\n - SET `targety` to target Y position.\n - SET `restype` to source resource type.\n - SET `sourceslot` to source resource slot.\n - SET `casterlvl` to caster level.\n - SET `sectype` to secondary type.\n - SET `insert_point` to the index at which the new effect is to be inserted. 0 is first and negative values or values equal to or exceeding the existing number of effects are last."
5886
5886
  }
5887
5887
  },
5888
5888
  {
@@ -5892,7 +5892,7 @@
5892
5892
  "category": "patchFunctions",
5893
5893
  "documentation": {
5894
5894
  "kind": "markdown",
5895
- "value": "```weidu-tp2-tooltip\nADD_CRE_ITEM_FLAGS\n```\nAdds flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be added to\n - SPRINT `flags to flags` you need to add (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
5895
+ "value": "```weidu-tp2-tooltip\npatch function ADD_CRE_ITEM_FLAGS\n```\nAdds flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be added to\n - SPRINT `flags to flags` you need to add (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
5896
5896
  }
5897
5897
  },
5898
5898
  {
@@ -5902,7 +5902,7 @@
5902
5902
  "category": "patchFunctions",
5903
5903
  "documentation": {
5904
5904
  "kind": "markdown",
5905
- "value": "```weidu-tp2-tooltip\nADD_CRE_SCRIPT\n```\nAssigns a script to a creature in the first available slot. This is a PATCH function. By default, the function will try all 5 script slots from SCRIPT_OVERRIDE to SCRIPT_DEFAULT.\n The function will fail with an error if the file being patched does not have a signature (first 3 bytes) that case-sensitively equals CRE, if either `offset_start` or `offset_end` are negative, if `offset_end` is less than `offset_start` or if `offset_end` is greater than the size of the file being patched.\n - INT_VAR `offset_start` to the offset from which the search for an empty slot should start. (default SCRIPT_OVERRIDE)\n - INT_VAR `offset_end` to the offset at which the search should end. (default SCRIPT_DEFAULT)\n - STR_VAR `script` to the resource reference of the script to be assigned.\n - RET `success` a return value indicating whether the script was successfully assigned. 1 signifies success and 0 signifies that no empty slot was found. A harmless warning will be printed if the function was unsuccessful."
5905
+ "value": "```weidu-tp2-tooltip\npatch function ADD_CRE_SCRIPT\n```\nAssigns a script to a creature in the first available slot. This is a PATCH function. By default, the function will try all 5 script slots from SCRIPT_OVERRIDE to SCRIPT_DEFAULT.\n The function will fail with an error if the file being patched does not have a signature (first 3 bytes) that case-sensitively equals CRE, if either `offset_start` or `offset_end` are negative, if `offset_end` is less than `offset_start` or if `offset_end` is greater than the size of the file being patched.\n - INT_VAR `offset_start` to the offset from which the search for an empty slot should start. (default SCRIPT_OVERRIDE)\n - INT_VAR `offset_end` to the offset at which the search should end. (default SCRIPT_DEFAULT)\n - STR_VAR `script` to the resource reference of the script to be assigned.\n - RET `success` a return value indicating whether the script was successfully assigned. 1 signifies success and 0 signifies that no empty slot was found. A harmless warning will be printed if the function was unsuccessful."
5906
5906
  }
5907
5907
  },
5908
5908
  {
@@ -5912,7 +5912,7 @@
5912
5912
  "category": "patchFunctions",
5913
5913
  "documentation": {
5914
5914
  "kind": "markdown",
5915
- "value": "```weidu-tp2-tooltip\nADD_ITEM_EFFECT\n```\nAdds an extended effect to an item. All variables except `probability1`, type and `insert_point` are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `type` to the type of header to which the effect should be added or 99 for all types. Defaults to 3 (magic).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
5915
+ "value": "```weidu-tp2-tooltip\npatch function ADD_ITEM_EFFECT\n```\nAdds an extended effect to an item. All variables except `probability1`, type and `insert_point` are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `type` to the type of header to which the effect should be added or 99 for all types. Defaults to 3 (magic).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
5916
5916
  }
5917
5917
  },
5918
5918
  {
@@ -5922,7 +5922,7 @@
5922
5922
  "category": "patchFunctions",
5923
5923
  "documentation": {
5924
5924
  "kind": "markdown",
5925
- "value": "```weidu-tp2-tooltip\nADD_ITEM_EQEFFECT\n```\nAdds an equipping effect to an item. All variables except 'probability1' are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
5925
+ "value": "```weidu-tp2-tooltip\npatch function ADD_ITEM_EQEFFECT\n```\nAdds an equipping effect to an item. All variables except 'probability1' are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
5926
5926
  }
5927
5927
  },
5928
5928
  {
@@ -5932,7 +5932,7 @@
5932
5932
  "category": "patchFunctions",
5933
5933
  "documentation": {
5934
5934
  "kind": "markdown",
5935
- "value": "```weidu-tp2-tooltip\nADD_SPELL_CFEFFECT\n```\nAdds a casting-feature effect to a spell. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
5935
+ "value": "```weidu-tp2-tooltip\npatch function ADD_SPELL_CFEFFECT\n```\nAdds a casting-feature effect to a spell. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
5936
5936
  }
5937
5937
  },
5938
5938
  {
@@ -5942,7 +5942,7 @@
5942
5942
  "category": "patchFunctions",
5943
5943
  "documentation": {
5944
5944
  "kind": "markdown",
5945
- "value": "```weidu-tp2-tooltip\nADD_SPELL_EFFECT\n```\nAdds an extended effect to a spell. All variables except `probability1` and `insert_point` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
5945
+ "value": "```weidu-tp2-tooltip\npatch function ADD_SPELL_EFFECT\n```\nAdds an extended effect to a spell. All variables except `probability1` and `insert_point` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
5946
5946
  }
5947
5947
  },
5948
5948
  {
@@ -5952,7 +5952,7 @@
5952
5952
  "category": "patchFunctions",
5953
5953
  "documentation": {
5954
5954
  "kind": "markdown",
5955
- "value": "```weidu-tp2-tooltip\nADD_STORE_ITEM_EX\n```\nAdds an item to the current STO file. This is a PATCH function.\n - INT_VAR `charge1` to the number of charges of the 1st ability or quantity for stackables. (Default: `0`)\n - INT_VAR `charge2` to the number of charges of the 2nd ability. (Default: `0`)\n - INT_VAR `charge3` to the number of charges of the 3rd ability. (Default: `0`)\n - INT_VAR `stack` to the number of item instances the store carries in the stack. (Default: `1`)\n - INT_VAR `unlimited` to non-zero if the store should carry an inexhaustible stack of the new item. (Default: `0`)\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing sale entry of matching item resref when found. (Default: `0`)\n - INT_VAR `expiration` to the item's expiration time, when it will be replaced with the drained item. (Default: `0`)\n - STR_VAR `item_name` to the resource name (resref) of the item to add.\n - STR_VAR `position` to the desired position of the item in the list of sale entries. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new item directly behind the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new item directly before the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new item after all existing items.\n - `FIRST`: Will place the new item before all existing items.\n - `AT value`: Will place the new item at the position given by the number `value`.\n Use negative values to place the new item relative to the last item position\n in reverse order.\n - STR_VAR `flags` to numeric values or the following constants: `none`, `identified`, `unstealable`, `stolen`. Constants can be combined by using ampersand (`&`) or space as separators (e.g. `identified&unstealable`). (Default: `none`)\n - STR_VAR `sale_trigger` Availability trigger (`STO V1.1` only). The following syntax is supported (Default: `#-1`):\n - `Trigger string`: Example: `GlobalGT(\"MyCondition\",\"GLOBAL\",0)`\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - RET `index` returns the index of the added item or the last matching index when overwriting items. Returns `-1` if the item could not be added or updated.\n - RET `offset` returns the offset of the added item or the last matching offset when overwriting items. Returns `-1` if the item could not be added or updated."
5955
+ "value": "```weidu-tp2-tooltip\npatch function ADD_STORE_ITEM_EX\n```\nAdds an item to the current STO file. This is a PATCH function.\n - INT_VAR `charge1` to the number of charges of the 1st ability or quantity for stackables. (Default: `0`)\n - INT_VAR `charge2` to the number of charges of the 2nd ability. (Default: `0`)\n - INT_VAR `charge3` to the number of charges of the 3rd ability. (Default: `0`)\n - INT_VAR `stack` to the number of item instances the store carries in the stack. (Default: `1`)\n - INT_VAR `unlimited` to non-zero if the store should carry an inexhaustible stack of the new item. (Default: `0`)\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing sale entry of matching item resref when found. (Default: `0`)\n - INT_VAR `expiration` to the item's expiration time, when it will be replaced with the drained item. (Default: `0`)\n - STR_VAR `item_name` to the resource name (resref) of the item to add.\n - STR_VAR `position` to the desired position of the item in the list of sale entries. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new item directly behind the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new item directly before the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new item after all existing items.\n - `FIRST`: Will place the new item before all existing items.\n - `AT value`: Will place the new item at the position given by the number `value`.\n Use negative values to place the new item relative to the last item position\n in reverse order.\n - STR_VAR `flags` to numeric values or the following constants: `none`, `identified`, `unstealable`, `stolen`. Constants can be combined by using ampersand (`&`) or space as separators (e.g. `identified&unstealable`). (Default: `none`)\n - STR_VAR `sale_trigger` Availability trigger (`STO V1.1` only). The following syntax is supported (Default: `#-1`):\n - `Trigger string`: Example: `GlobalGT(\"MyCondition\",\"GLOBAL\",0)`\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - RET `index` returns the index of the added item or the last matching index when overwriting items. Returns `-1` if the item could not be added or updated.\n - RET `offset` returns the offset of the added item or the last matching offset when overwriting items. Returns `-1` if the item could not be added or updated."
5956
5956
  }
5957
5957
  },
5958
5958
  {
@@ -5962,7 +5962,7 @@
5962
5962
  "category": "patchFunctions",
5963
5963
  "documentation": {
5964
5964
  "kind": "markdown",
5965
- "value": "```weidu-tp2-tooltip\nADD_STORE_DRINK\n```\nAdds a drink to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the price of the drink.\n - INT_VAR `rate` to the rate (%) of displaying a rumor.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing drink of matching `drink_name` when found. (Default: `0`)\n - STR_VAR `drink_name` to the name of the drink. The following syntax is supported:\n - `Literal string`: Example: Elminster's Choice Beer\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - STR_VAR `position` to the desired position in the list of drinks. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER name`: Will place the new drink directly behind the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added after the entry of the first matching name.\n - `BEFORE name`: Will place the new drink directly before the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added before the entry of the first matching name.\n - `LAST`: Will place the new drink after all existing drinks.\n - `FIRST`: Will place the new drink before all existing drinks.\n - `AT value`: Will place the new drink at the position given by the number \"value\".\n Use negative values to place the new drink relative to the last drink position\n in reverse order.\n - RET `index` returns the index of the added drink or the last matching index when overwriting drinks. Returns `-1` if the drink could not be added or updated.\n - RET `offset` returns the offset of the added drink or the last matching offset when overwriting drinks. Returns `-1` if the drink could not be added or updated."
5965
+ "value": "```weidu-tp2-tooltip\npatch function ADD_STORE_DRINK\n```\nAdds a drink to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the price of the drink.\n - INT_VAR `rate` to the rate (%) of displaying a rumor.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing drink of matching `drink_name` when found. (Default: `0`)\n - STR_VAR `drink_name` to the name of the drink. The following syntax is supported:\n - `Literal string`: Example: Elminster's Choice Beer\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - STR_VAR `position` to the desired position in the list of drinks. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER name`: Will place the new drink directly behind the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added after the entry of the first matching name.\n - `BEFORE name`: Will place the new drink directly before the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added before the entry of the first matching name.\n - `LAST`: Will place the new drink after all existing drinks.\n - `FIRST`: Will place the new drink before all existing drinks.\n - `AT value`: Will place the new drink at the position given by the number \"value\".\n Use negative values to place the new drink relative to the last drink position\n in reverse order.\n - RET `index` returns the index of the added drink or the last matching index when overwriting drinks. Returns `-1` if the drink could not be added or updated.\n - RET `offset` returns the offset of the added drink or the last matching offset when overwriting drinks. Returns `-1` if the drink could not be added or updated."
5966
5966
  }
5967
5967
  },
5968
5968
  {
@@ -5972,7 +5972,7 @@
5972
5972
  "category": "patchFunctions",
5973
5973
  "documentation": {
5974
5974
  "kind": "markdown",
5975
- "value": "```weidu-tp2-tooltip\nADD_STORE_CURE\n```\nAdds a cure to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the spell price.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing cure entry of matching spell resref when found. (Default: `0`)\n - STR_VAR `spell_name` to the resource name (resref) of the spell to add.\n - STR_VAR `position` to the desired position in the list of cures. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new spell directly behind the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new spell directly before the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new spell after all existing cures.\n - `FIRST`: Will place the new spell before all existing cures.\n - `AT value`: Will place the new spell at the position given by the number `value`.\n Use negative values to place the new spell relative to the last spell position\n in reverse order.\n - RET `index` returns the index of the added cure or the last matching index when overwriting cure entries. Returns `-1` if the spell could not be added or updated.\n - RET `offset` returns the offset of the added cure or the last matching offset when overwriting cures. Returns `-1` if the spell could not be added or updated."
5975
+ "value": "```weidu-tp2-tooltip\npatch function ADD_STORE_CURE\n```\nAdds a cure to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the spell price.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing cure entry of matching spell resref when found. (Default: `0`)\n - STR_VAR `spell_name` to the resource name (resref) of the spell to add.\n - STR_VAR `position` to the desired position in the list of cures. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new spell directly behind the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new spell directly before the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new spell after all existing cures.\n - `FIRST`: Will place the new spell before all existing cures.\n - `AT value`: Will place the new spell at the position given by the number `value`.\n Use negative values to place the new spell relative to the last spell position\n in reverse order.\n - RET `index` returns the index of the added cure or the last matching index when overwriting cure entries. Returns `-1` if the spell could not be added or updated.\n - RET `offset` returns the offset of the added cure or the last matching offset when overwriting cures. Returns `-1` if the spell could not be added or updated."
5976
5976
  }
5977
5977
  },
5978
5978
  {
@@ -5982,7 +5982,7 @@
5982
5982
  "category": "patchFunctions",
5983
5983
  "documentation": {
5984
5984
  "kind": "markdown",
5985
- "value": "```weidu-tp2-tooltip\nADD_WORLDMAP_LINKS\n```\nAdd links from one worldmap area to another. This is a PATCH function.\n This function add links from one specified area to another. Links can be added from all four directional nodes (north, east, south, west) or from a specific node. If a link already exists, its metadata (distance scale, random encounters, etc.) will be overwritten. Links connecting the areas in the opposite direction will not be added. If either of the areas do not exist in the worldmap, a warning is printed and no links are added.\n - INT_VAR `distance_scale` to the distance scale between the two areas. `distance_scale` * 4 equals the travel time between the areas (in hours).\n - INT_VAR `default_entry` to the default entry location. Legal values for this variable are 1 (northern side), 2 (eastern), 4 (southern) and 8 (western). The default value is 1.\n - INT_VAR `encounter_probability` to the probability of a random encounter occurring.\n - STR_VAR `from_area` to the area from which the links should originate.\n - STR_VAR `from_node` to the directional node from which the links should originate. Legal values for this variable are “north”, “n”, “east”, “e”, “south”, “s”, “west” and “w”. Values are not case sensitive. Links are added to all four nodes by default.\n - STR_VAR `to_area` to the area to which the links should lead.\n - STR_VAR `entry` to the entry point in `to_area`.\n - STR_VAR `random_area1` to the first random-encounter area.\n - STR_VAR `random_area2` to the second random-encounter area.\n - STR_VAR `random_area3` to the third random-encounter area.\n - STR_VAR `random_area4` to the fourth random-encounter area.\n - STR_VAR `random_area5` to the fifth random-encounter area."
5985
+ "value": "```weidu-tp2-tooltip\npatch function ADD_WORLDMAP_LINKS\n```\nAdd links from one worldmap area to another. This is a PATCH function.\n This function add links from one specified area to another. Links can be added from all four directional nodes (north, east, south, west) or from a specific node. If a link already exists, its metadata (distance scale, random encounters, etc.) will be overwritten. Links connecting the areas in the opposite direction will not be added. If either of the areas do not exist in the worldmap, a warning is printed and no links are added.\n - INT_VAR `distance_scale` to the distance scale between the two areas. `distance_scale` * 4 equals the travel time between the areas (in hours).\n - INT_VAR `default_entry` to the default entry location. Legal values for this variable are 1 (northern side), 2 (eastern), 4 (southern) and 8 (western). The default value is 1.\n - INT_VAR `encounter_probability` to the probability of a random encounter occurring.\n - STR_VAR `from_area` to the area from which the links should originate.\n - STR_VAR `from_node` to the directional node from which the links should originate. Legal values for this variable are “north”, “n”, “east”, “e”, “south”, “s”, “west” and “w”. Values are not case sensitive. Links are added to all four nodes by default.\n - STR_VAR `to_area` to the area to which the links should lead.\n - STR_VAR `entry` to the entry point in `to_area`.\n - STR_VAR `random_area1` to the first random-encounter area.\n - STR_VAR `random_area2` to the second random-encounter area.\n - STR_VAR `random_area3` to the third random-encounter area.\n - STR_VAR `random_area4` to the fourth random-encounter area.\n - STR_VAR `random_area5` to the fifth random-encounter area."
5986
5986
  }
5987
5987
  },
5988
5988
  {
@@ -5992,7 +5992,7 @@
5992
5992
  "category": "patchFunctions",
5993
5993
  "documentation": {
5994
5994
  "kind": "markdown",
5995
- "value": "```weidu-tp2-tooltip\nALTER_AREA_ACTOR\n```\nPatch area actors. This is a PATCH function. All integer variables, except `expiry`, default to the value -1 and a negative value results in no change to the corresponding field. The variable `expiry` instead has a default value of -2. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `actor_name` default to the string \"same\", which results in no change to the corresponding field. The variable `actor_name` is required.\n - INT_VAR `x_coord` to the new x coordinate. Unless dest_x is defined, x_coord is used as the x-value of the destination, as well.\n - INT_VAR `y_coord` to the new y coordinate. Unless dest_y is defined, y_coord is used as the y-value of the destination, as well.\n - INT_VAR `dest_x` to the new x destination.\n - INT_VAR `dest_y` to the new y destination.\n - INT_VAR `spawned` to the new spawned value.\n - INT_VAR `animation` to the new animation value.\n - INT_VAR `orient` to the new facing direction.\n - INT_VAR `expiry` to the new expiration time.\n - INT_VAR `wander` to the new wander-distance value.\n - INT_VAR `follow` to the new follow-distance value.\n - INT_VAR `times_talked` to the new number of times the actor has been talked to.\n - INT_VAR `flag_cre_unattached` to the new value of the flag known as CRE attached (bit 0).\n - INT_VAR `flag_seen_party` to the new value of the flag known as has seen party (bit 1).\n - INT_VAR `flag_invulnerable` to the new value of the flag known as invulnerable (bit 2).\n - INT_VAR `flag_override_script_name` to the new value of the flag known as override script name (bit 3).\n - INT_VAR `flag_time_0` through `flag_time_23` to the new values of the actor's appearance schedule.\n - STR_VAR `actor_name` to the name of the actor to be patched. This variable is required.\n - STR_VAR `dlg_file` to the resref of the new dialogue file.\n - STR_VAR `script_override` to the resref of the new override script.\n - STR_VAR `script_general` to the resref of the new general script.\n - STR_VAR `script_class` to the resref of the new class script.\n - STR_VAR `script_race` to the resref of the new race script.\n - STR_VAR `script_default` to the resref of the new default script.\n - STR_VAR `script_specifics` to the resref of the new specifics script.\n - STR_VAR `cre_file` to the resref of the new creature file."
5995
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_AREA_ACTOR\n```\nPatch area actors. This is a PATCH function. All integer variables, except `expiry`, default to the value -1 and a negative value results in no change to the corresponding field. The variable `expiry` instead has a default value of -2. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `actor_name` default to the string \"same\", which results in no change to the corresponding field. The variable `actor_name` is required.\n - INT_VAR `x_coord` to the new x coordinate. Unless dest_x is defined, x_coord is used as the x-value of the destination, as well.\n - INT_VAR `y_coord` to the new y coordinate. Unless dest_y is defined, y_coord is used as the y-value of the destination, as well.\n - INT_VAR `dest_x` to the new x destination.\n - INT_VAR `dest_y` to the new y destination.\n - INT_VAR `spawned` to the new spawned value.\n - INT_VAR `animation` to the new animation value.\n - INT_VAR `orient` to the new facing direction.\n - INT_VAR `expiry` to the new expiration time.\n - INT_VAR `wander` to the new wander-distance value.\n - INT_VAR `follow` to the new follow-distance value.\n - INT_VAR `times_talked` to the new number of times the actor has been talked to.\n - INT_VAR `flag_cre_unattached` to the new value of the flag known as CRE attached (bit 0).\n - INT_VAR `flag_seen_party` to the new value of the flag known as has seen party (bit 1).\n - INT_VAR `flag_invulnerable` to the new value of the flag known as invulnerable (bit 2).\n - INT_VAR `flag_override_script_name` to the new value of the flag known as override script name (bit 3).\n - INT_VAR `flag_time_0` through `flag_time_23` to the new values of the actor's appearance schedule.\n - STR_VAR `actor_name` to the name of the actor to be patched. This variable is required.\n - STR_VAR `dlg_file` to the resref of the new dialogue file.\n - STR_VAR `script_override` to the resref of the new override script.\n - STR_VAR `script_general` to the resref of the new general script.\n - STR_VAR `script_class` to the resref of the new class script.\n - STR_VAR `script_race` to the resref of the new race script.\n - STR_VAR `script_default` to the resref of the new default script.\n - STR_VAR `script_specifics` to the resref of the new specifics script.\n - STR_VAR `cre_file` to the resref of the new creature file."
5996
5996
  }
5997
5997
  },
5998
5998
  {
@@ -6002,7 +6002,7 @@
6002
6002
  "category": "patchFunctions",
6003
6003
  "documentation": {
6004
6004
  "kind": "markdown",
6005
- "value": "```weidu-tp2-tooltip\nALTER_AREA_CONTAINER\n```\nPatch area containers, but not their contents. This is a PATCH function. All integer variables default to -1 and negative values result in no change to the corresponding field. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except container_name default to the string \"same\", which results in no change to the corresponding field. The variable container_name is required.\n - INT_VAR `coord_x` to the new x coordinate.\n - INT_VAR `coord_y` to the new y coordinate.\n - INT_VAR `container_type` to the new type of the container.\n - INT_VAR `trapped` to whether the container should be trapped.\n - INT_VAR `detected` to whether the container trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `range` to the new trigger-range value.\n - INT_VAR `lockpick_strref` to the new strref of the lockpick string.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `flag_locked` to the new value of the flag known as locked (bit 0).\n - INT_VAR `flag_mlocked` to the new value of the flag known as magical lock (bit 2).\n - INT_VAR `flag_resets` to the new value of the flag known as trap resets (bit 3).\n - INT_VAR `flag_disabled` to the new value of the flag known as disabled (bit 5).\n - STR_VAR `container_name` to the name of the container to be patched. This variable is required.\n - STR_VAR `container_script` to the resref of the new container script.\n - STR_VAR `container_key` to the resref of the new container key."
6005
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_AREA_CONTAINER\n```\nPatch area containers, but not their contents. This is a PATCH function. All integer variables default to -1 and negative values result in no change to the corresponding field. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except container_name default to the string \"same\", which results in no change to the corresponding field. The variable container_name is required.\n - INT_VAR `coord_x` to the new x coordinate.\n - INT_VAR `coord_y` to the new y coordinate.\n - INT_VAR `container_type` to the new type of the container.\n - INT_VAR `trapped` to whether the container should be trapped.\n - INT_VAR `detected` to whether the container trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `range` to the new trigger-range value.\n - INT_VAR `lockpick_strref` to the new strref of the lockpick string.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `flag_locked` to the new value of the flag known as locked (bit 0).\n - INT_VAR `flag_mlocked` to the new value of the flag known as magical lock (bit 2).\n - INT_VAR `flag_resets` to the new value of the flag known as trap resets (bit 3).\n - INT_VAR `flag_disabled` to the new value of the flag known as disabled (bit 5).\n - STR_VAR `container_name` to the name of the container to be patched. This variable is required.\n - STR_VAR `container_script` to the resref of the new container script.\n - STR_VAR `container_key` to the resref of the new container key."
6006
6006
  }
6007
6007
  },
6008
6008
  {
@@ -6012,7 +6012,7 @@
6012
6012
  "category": "patchFunctions",
6013
6013
  "documentation": {
6014
6014
  "kind": "markdown",
6015
- "value": "```weidu-tp2-tooltip\nALTER_AREA_DOOR\n```\nPatch area doors. This is a PATCH function. All integer variables, except `string_unlock` and `string_speaker`, default to -1 and negative values result in no change to the corresponding field. The variables `string_unlock` and `string_speaker` instead default to 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `door_name` default to the string \"same\", which results in no change to the corresponding field. The variable `door_name` is required.\n - INT_VAR `bounding_open_left` to the new value of the left edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_top` to the new value of the top edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_right` to the new value of the right edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_bottom` to the new value of the bottom edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_left` to the new value of the left edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_top` to the new value of the top edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_right` to the new value of the right edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_bottom` to the new value of the bottom edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `door_hp` to the new hit-point value.\n - INT_VAR `door_ac` to the new armor-class value.\n - INT_VAR `cursor` to the new cursor index.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `trapped` to whether the door should be trapped.\n - INT_VAR `detected` to whether the door trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `door_detect` to the new difficulty of door detection.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `open_x` to the new x coordinate of the opening point.\n - INT_VAR `open_y` to the new y coordinate of the opening point.\n - INT_VAR `close_x` to the new x coordinate of the closing point.\n - INT_VAR `close_y` to the new y coordinate of the closing point.\n - INT_VAR `string_unlock` to the new string reference of the unlock message.\n - INT_VAR `string_speaker` to the new string reference of the dialogue-speaker name.\n - INT_VAR `flag_open` to the new value of the flag known as door open (bit 0).\n - INT_VAR `flag_locked` to the new value of the flag known as door locked (bit 1).\n - INT_VAR `flag_resets` to the new value of the flag known as reset trap (bit 2).\n - INT_VAR `flag_detectable` to the new value of the flag known as trap detectable (bit 3).\n - INT_VAR `flag_forced` to the new value of the flag known as broken (bit 4).\n - INT_VAR `flag_no_close` to the new value of the flag known as can't close (bit 5).\n - INT_VAR `flag_located` to the new value of the flag known as linked (bit 6).\n - INT_VAR `flag_secret` to the new value of the flag known as door hidden (bit 7).\n - INT_VAR `flag_detected` to the new value of the flag known as door found (bit 8).\n - INT_VAR `flag_no_look` to the new value of the flag known as don't block line of sight.\n - INT_VAR `flag_uses_key` to the new value of the flag known as remove key (bit 10).\n - INT_VAR `flag_sliding` to the new value of the flag known as ignore obstacles when closing (bit 11).\n - STR_VAR `door_name` to the name of the door to be patched. This variable is required.\n - STR_VAR `door_open_sound` to the resource reference of the opening sound.\n - STR_VAR `door_close_sound` to the resource reference of the closing sound.\n - STR_VAR `door_key` to the resref of the new door key.\n - STR_VAR `door_script` to the resref of the new door script.\n - STR_VAR `travel_trigger` to the new travel-trigger name. This field is 24 bytes in length.\n - STR_VAR `dialogue` to the new resource reference of the dialogue file."
6015
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_AREA_DOOR\n```\nPatch area doors. This is a PATCH function. All integer variables, except `string_unlock` and `string_speaker`, default to -1 and negative values result in no change to the corresponding field. The variables `string_unlock` and `string_speaker` instead default to 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `door_name` default to the string \"same\", which results in no change to the corresponding field. The variable `door_name` is required.\n - INT_VAR `bounding_open_left` to the new value of the left edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_top` to the new value of the top edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_right` to the new value of the right edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_bottom` to the new value of the bottom edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_left` to the new value of the left edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_top` to the new value of the top edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_right` to the new value of the right edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_bottom` to the new value of the bottom edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `door_hp` to the new hit-point value.\n - INT_VAR `door_ac` to the new armor-class value.\n - INT_VAR `cursor` to the new cursor index.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `trapped` to whether the door should be trapped.\n - INT_VAR `detected` to whether the door trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `door_detect` to the new difficulty of door detection.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `open_x` to the new x coordinate of the opening point.\n - INT_VAR `open_y` to the new y coordinate of the opening point.\n - INT_VAR `close_x` to the new x coordinate of the closing point.\n - INT_VAR `close_y` to the new y coordinate of the closing point.\n - INT_VAR `string_unlock` to the new string reference of the unlock message.\n - INT_VAR `string_speaker` to the new string reference of the dialogue-speaker name.\n - INT_VAR `flag_open` to the new value of the flag known as door open (bit 0).\n - INT_VAR `flag_locked` to the new value of the flag known as door locked (bit 1).\n - INT_VAR `flag_resets` to the new value of the flag known as reset trap (bit 2).\n - INT_VAR `flag_detectable` to the new value of the flag known as trap detectable (bit 3).\n - INT_VAR `flag_forced` to the new value of the flag known as broken (bit 4).\n - INT_VAR `flag_no_close` to the new value of the flag known as can't close (bit 5).\n - INT_VAR `flag_located` to the new value of the flag known as linked (bit 6).\n - INT_VAR `flag_secret` to the new value of the flag known as door hidden (bit 7).\n - INT_VAR `flag_detected` to the new value of the flag known as door found (bit 8).\n - INT_VAR `flag_no_look` to the new value of the flag known as don't block line of sight.\n - INT_VAR `flag_uses_key` to the new value of the flag known as remove key (bit 10).\n - INT_VAR `flag_sliding` to the new value of the flag known as ignore obstacles when closing (bit 11).\n - STR_VAR `door_name` to the name of the door to be patched. This variable is required.\n - STR_VAR `door_open_sound` to the resource reference of the opening sound.\n - STR_VAR `door_close_sound` to the resource reference of the closing sound.\n - STR_VAR `door_key` to the resref of the new door key.\n - STR_VAR `door_script` to the resref of the new door script.\n - STR_VAR `travel_trigger` to the new travel-trigger name. This field is 24 bytes in length.\n - STR_VAR `dialogue` to the new resource reference of the dialogue file."
6016
6016
  }
6017
6017
  },
6018
6018
  {
@@ -6022,7 +6022,7 @@
6022
6022
  "category": "patchFunctions",
6023
6023
  "documentation": {
6024
6024
  "kind": "markdown",
6025
- "value": "```weidu-tp2-tooltip\nALTER_AREA_ENTRANCE\n```\nPatch coordinates and orientation of area party entrance points. This is a PATCH function. For all integer variables, a negative value results in no change to that field and the default value is -1. The variable `entrance_name` is required.\n - INT_VAR `x_coord` to the new X coordinate.\n - INT_VAR `y_coord` to the new Y coordinate.\n - INT_VAR `orient` to the new orientation.\n - STR_VAR `entrance_name` to the name of the entrance point to be altered. This variable is required."
6025
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_AREA_ENTRANCE\n```\nPatch coordinates and orientation of area party entrance points. This is a PATCH function. For all integer variables, a negative value results in no change to that field and the default value is -1. The variable `entrance_name` is required.\n - INT_VAR `x_coord` to the new X coordinate.\n - INT_VAR `y_coord` to the new Y coordinate.\n - INT_VAR `orient` to the new orientation.\n - STR_VAR `entrance_name` to the name of the entrance point to be altered. This variable is required."
6026
6026
  }
6027
6027
  },
6028
6028
  {
@@ -6032,7 +6032,7 @@
6032
6032
  "category": "patchFunctions",
6033
6033
  "documentation": {
6034
6034
  "kind": "markdown",
6035
- "value": "```weidu-tp2-tooltip\nALTER_AREA_REGION\n```\nPatch ''area regions'', also known as area triggers. This is a PATCH function. For all integer variables except `info_point`, a negative value results in no change and the default value is -1. The variable `info_point` results in no change if it has the default value 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. For all string variables except `region_name`, the default value is the string \"same\", which results in no change to that field. The variable `region_name` is required.\n- INT_VAR `type` to the new type of the region.\n- INT_VAR `cursor` to the new cursor index to be used.\n- INT_VAR `trap_detect` to the new difficulty of trap detection.\n- INT_VAR `trap_remove` to the new difficulty of trap removal.\n- INT_VAR `trapped` to whether the region should be trapped.\n- INT_VAR `detected` to whether the trap should be detected.\n- INT_VAR `flag_locked` to the new value of the flag known as `locked` or `invisible trap` (bit 0).\n- INT_VAR `flag_resets` to the new value of the flag known as `trap resets` (bit 1).\n- INT_VAR `flag_party_required` to the new value of the flag known as `party is required` (bit 2).\n- INT_VAR `flag_trap_detectable` to the new value of the flag known as `trap is detectable` (bit 3).\n- INT_VAR `flag_trap_enemies` to the new value of the flag known as `trap can be set off by enemies` (bit 4).\n- INT_VAR `flag_tutorial` to the new value of the flag known as `tutorial trigger` (bit 5).\n- INT_VAR `flag_trap_npcs` to the new value of the flag known as `trap can be set off by NPCs` (bit 6).\n- INT_VAR `flag_silent` to the new value of the flag known as `silent trigger` (bit 7).\n- INT_VAR `flag_deactivated` to the new value of the flag known as `deactivated` (bit 8).\n- INT_VAR `flag_impassable_npc` to the new value of the flag known as `cannot be passed by NPCs` (bit 9).\n- INT_VAR `flag_activation_point` to the new value of the flag known as `use activation point` (bit 10).\n- INT_VAR `flag_connect_to_door` to the new value of the flag known as `connected to door` (bit 11).\n- INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `info_point` to the new string reference of the info point.\n- INT_VAR `launch_x` to the new x coordinate of the launch point.\n- INT_VAR `launch_y` to the new y coordinate of the launch point.\n- INT_VAR `activate_x` to the new x coordinate of the activation point.\n- INT_VAR `activate_y` to the new y coordinate of the activation point.\n- STR_VAR `region_name` to the name of the region to be patched. This variable is required.\n- STR_VAR `destination_area` to the resref of the new destination area.\n- STR_VAR `entrance_name` to the new entrance name of the destination area.\n- STR_VAR `region_key` to the resref of the key item.\n- STR_VAR `region_script` to the resref of the region script.\n"
6035
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_AREA_REGION\n```\nPatch ''area regions'', also known as area triggers. This is a PATCH function. For all integer variables except `info_point`, a negative value results in no change and the default value is -1. The variable `info_point` results in no change if it has the default value 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. For all string variables except `region_name`, the default value is the string \"same\", which results in no change to that field. The variable `region_name` is required.\n- INT_VAR `type` to the new type of the region.\n- INT_VAR `cursor` to the new cursor index to be used.\n- INT_VAR `trap_detect` to the new difficulty of trap detection.\n- INT_VAR `trap_remove` to the new difficulty of trap removal.\n- INT_VAR `trapped` to whether the region should be trapped.\n- INT_VAR `detected` to whether the trap should be detected.\n- INT_VAR `flag_locked` to the new value of the flag known as `locked` or `invisible trap` (bit 0).\n- INT_VAR `flag_resets` to the new value of the flag known as `trap resets` (bit 1).\n- INT_VAR `flag_party_required` to the new value of the flag known as `party is required` (bit 2).\n- INT_VAR `flag_trap_detectable` to the new value of the flag known as `trap is detectable` (bit 3).\n- INT_VAR `flag_trap_enemies` to the new value of the flag known as `trap can be set off by enemies` (bit 4).\n- INT_VAR `flag_tutorial` to the new value of the flag known as `tutorial trigger` (bit 5).\n- INT_VAR `flag_trap_npcs` to the new value of the flag known as `trap can be set off by NPCs` (bit 6).\n- INT_VAR `flag_silent` to the new value of the flag known as `silent trigger` (bit 7).\n- INT_VAR `flag_deactivated` to the new value of the flag known as `deactivated` (bit 8).\n- INT_VAR `flag_impassable_npc` to the new value of the flag known as `cannot be passed by NPCs` (bit 9).\n- INT_VAR `flag_activation_point` to the new value of the flag known as `use activation point` (bit 10).\n- INT_VAR `flag_connect_to_door` to the new value of the flag known as `connected to door` (bit 11).\n- INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `info_point` to the new string reference of the info point.\n- INT_VAR `launch_x` to the new x coordinate of the launch point.\n- INT_VAR `launch_y` to the new y coordinate of the launch point.\n- INT_VAR `activate_x` to the new x coordinate of the activation point.\n- INT_VAR `activate_y` to the new y coordinate of the activation point.\n- STR_VAR `region_name` to the name of the region to be patched. This variable is required.\n- STR_VAR `destination_area` to the resref of the new destination area.\n- STR_VAR `entrance_name` to the new entrance name of the destination area.\n- STR_VAR `region_key` to the resref of the key item.\n- STR_VAR `region_script` to the resref of the region script.\n"
6036
6036
  }
6037
6037
  },
6038
6038
  {
@@ -6042,7 +6042,7 @@
6042
6042
  "category": "patchFunctions",
6043
6043
  "documentation": {
6044
6044
  "kind": "markdown",
6045
- "value": "```weidu-tp2-tooltip\nALTER_ITEM_EFFECT\n```\nPatch global (equipping) effects and/or effects on extended headers. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals`, `check_headers` and `header` default to 0. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n Note that both `check_globals` and `check_headers` are 0 by default, so you need to change one or both of these to 1 to perform any patching at all. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global (on-equip) effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
6045
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_ITEM_EFFECT\n```\nPatch global (equipping) effects and/or effects on extended headers. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals`, `check_headers` and `header` default to 0. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n Note that both `check_globals` and `check_headers` are 0 by default, so you need to change one or both of these to 1 to perform any patching at all. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global (on-equip) effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
6046
6046
  }
6047
6047
  },
6048
6048
  {
@@ -6052,7 +6052,7 @@
6052
6052
  "category": "patchFunctions",
6053
6053
  "documentation": {
6054
6054
  "kind": "markdown",
6055
- "value": "```weidu-tp2-tooltip\nALTER_ITEM_HEADER\n```\nPatch ability headers on items. This is a PATCH function. All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. The string variable `icon` defaults to the string \\\"same\\\", which results in no change to the corresponding field.\n\n`header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the icon resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n\n- INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n- INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n- INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n- INT_VAR `new_header_type` to the value the matched header should be changed into.\n- INT_VAR `identify` to the new identification requirement.\n- INT_VAR `location` to the new new ability location.\n- INT_VAR `target` to the new target.\n- INT_VAR `target_count` to the new target count.\n- INT_VAR `range` to the new range.\n- INT_VAR `launcher` to the new required launcher.\n- INT_VAR `speed` to the new speed factor.\n- INT_VAR `thac0_bonus` to the new THAC0 bonus.\n- INT_VAR `dicesize` to the new dice size.\n- INT_VAR `primary_type` to the new primary type (school).\n- INT_VAR `dicenumber` to the new number of dice.\n- INT_VAR `secondary_type` to the new secondary type.\n- INT_VAR `damage_bonus` to the new damage bonus.\n- INT_VAR `damage_type` to the new damage type.\n- INT_VAR `charges` to the new number of charges.\n- INT_VAR `drained` to the new charge-depletion behaviour.\n- INT_VAR `projectile` to the new projectile.\n- INT_VAR `animation_overhand` to the new overhand animation percentage.\n- INT_VAR `animation_backhand` to the new backhand animation percentage.\n- INT_VAR `animation_thrust` to the new thrust animation percentage.\n- INT_VAR `arrow` to the new arrow qualifier.\n- INT_VAR `bolt` to the new bolt qualifier.\n- INT_VAR `bullet` to the new bullet qualifier.\n- INT_VAR `flag_strength` to the new value of the flag known as `add strength bonus` (bit 0).\n- INT_VAR `flag_break` to the new value of the flag known as `breakable` (bit 1).\n- INT_VAR `flag_strength_damage` to the new value of the flag known as `add strength bonus to damage only` (bit 2). This flag is not available in all games.\n- INT_VAR `flag_strength_thac0` to the new value of the flag known as `add strength bonus to THAC0 only` (bit 3). This flag is not available in all games.\n- INT_VAR `flag_hostile` to the new value of the flag known as `hostile` (bit 10).\n- INT_VAR `flag_recharge` to the new value of the flag known as `recharges` (bit 11).\n- INT_VAR `flag_bypass` to the new value of the flag known as `bypass armor` (bit 16). This flag is not available in all games.\n- INT_VAR `flag_keenedge` to the new value of the flag known as `keen edge` (bit 17). This flag is not available in all games.\n- INT_VAR `flag_backstab` to the new value of the flag known as `toggle backstab` (bit 25). This flag is not available in all games.\n- INT_VAR `flag_noinvisible` to the new value of the flag known as `cannot target invisible` (bit 26). This flag is not available in all games.\n- STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0.\n"
6055
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_ITEM_HEADER\n```\nPatch ability headers on items. This is a PATCH function. All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. The string variable `icon` defaults to the string \\\"same\\\", which results in no change to the corresponding field.\n\n`header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the icon resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n\n- INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n- INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n- INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n- INT_VAR `new_header_type` to the value the matched header should be changed into.\n- INT_VAR `identify` to the new identification requirement.\n- INT_VAR `location` to the new new ability location.\n- INT_VAR `target` to the new target.\n- INT_VAR `target_count` to the new target count.\n- INT_VAR `range` to the new range.\n- INT_VAR `launcher` to the new required launcher.\n- INT_VAR `speed` to the new speed factor.\n- INT_VAR `thac0_bonus` to the new THAC0 bonus.\n- INT_VAR `dicesize` to the new dice size.\n- INT_VAR `primary_type` to the new primary type (school).\n- INT_VAR `dicenumber` to the new number of dice.\n- INT_VAR `secondary_type` to the new secondary type.\n- INT_VAR `damage_bonus` to the new damage bonus.\n- INT_VAR `damage_type` to the new damage type.\n- INT_VAR `charges` to the new number of charges.\n- INT_VAR `drained` to the new charge-depletion behaviour.\n- INT_VAR `projectile` to the new projectile.\n- INT_VAR `animation_overhand` to the new overhand animation percentage.\n- INT_VAR `animation_backhand` to the new backhand animation percentage.\n- INT_VAR `animation_thrust` to the new thrust animation percentage.\n- INT_VAR `arrow` to the new arrow qualifier.\n- INT_VAR `bolt` to the new bolt qualifier.\n- INT_VAR `bullet` to the new bullet qualifier.\n- INT_VAR `flag_strength` to the new value of the flag known as `add strength bonus` (bit 0).\n- INT_VAR `flag_break` to the new value of the flag known as `breakable` (bit 1).\n- INT_VAR `flag_strength_damage` to the new value of the flag known as `add strength bonus to damage only` (bit 2). This flag is not available in all games.\n- INT_VAR `flag_strength_thac0` to the new value of the flag known as `add strength bonus to THAC0 only` (bit 3). This flag is not available in all games.\n- INT_VAR `flag_hostile` to the new value of the flag known as `hostile` (bit 10).\n- INT_VAR `flag_recharge` to the new value of the flag known as `recharges` (bit 11).\n- INT_VAR `flag_bypass` to the new value of the flag known as `bypass armor` (bit 16). This flag is not available in all games.\n- INT_VAR `flag_keenedge` to the new value of the flag known as `keen edge` (bit 17). This flag is not available in all games.\n- INT_VAR `flag_backstab` to the new value of the flag known as `toggle backstab` (bit 25). This flag is not available in all games.\n- INT_VAR `flag_noinvisible` to the new value of the flag known as `cannot target invisible` (bit 26). This flag is not available in all games.\n- STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0.\n"
6056
6056
  }
6057
6057
  },
6058
6058
  {
@@ -6062,7 +6062,7 @@
6062
6062
  "category": "patchFunctions",
6063
6063
  "documentation": {
6064
6064
  "kind": "markdown",
6065
- "value": "```weidu-tp2-tooltip\nALTER_SPELL_EFFECT\n```\nPatch effects on spells. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals` and `header` default to 0. The integer variable `check_headers` defaults to 1. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n The function will by default only check effects on headers. You can change this by changing the values of the variables `check_globals` and `check_headers`. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 1)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
6065
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_SPELL_EFFECT\n```\nPatch effects on spells. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals` and `header` default to 0. The integer variable `check_headers` defaults to 1. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n The function will by default only check effects on headers. You can change this by changing the values of the variables `check_globals` and `check_headers`. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 1)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
6066
6066
  }
6067
6067
  },
6068
6068
  {
@@ -6072,7 +6072,7 @@
6072
6072
  "category": "patchFunctions",
6073
6073
  "documentation": {
6074
6074
  "kind": "markdown",
6075
- "value": "```weidu-tp2-tooltip\nALTER_SPELL_HEADER\n```\nPatch ability headers on spells. This is a PATCH function.All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. The string variable `icon` defaults to the string \"same\", which results in no change to the corresponding field.\n `header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the `icon` resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n - INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n - INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n - INT_VAR `new_header_type` to the value the matched header should be changed into.\n - INT_VAR `location` to the new new ability location.\n - INT_VAR `target` to the new target.\n - INT_VAR `target_count` to the new target count.\n - INT_VAR `range` to the new range.\n - INT_VAR `min_level` to the new required minimum level.\n - INT_VAR `speed` to the new speed factor.\n - INT_VAR `thac0_bonus` to the new THAC0 bonus.\n - INT_VAR `dicesize` to the new dice size.\n - INT_VAR `dicenumber` to the new number of dice.\n - INT_VAR `damage_bonus` to the new damage bonus.\n - INT_VAR `damage_type` to the new damage type.\n - INT_VAR `charges` to the new number of charges.\n - INT_VAR `projectile` to the new projectile.\n - STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0."
6075
+ "value": "```weidu-tp2-tooltip\npatch function ALTER_SPELL_HEADER\n```\nPatch ability headers on spells. This is a PATCH function.All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. The string variable `icon` defaults to the string \"same\", which results in no change to the corresponding field.\n `header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the `icon` resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n - INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n - INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n - INT_VAR `new_header_type` to the value the matched header should be changed into.\n - INT_VAR `location` to the new new ability location.\n - INT_VAR `target` to the new target.\n - INT_VAR `target_count` to the new target count.\n - INT_VAR `range` to the new range.\n - INT_VAR `min_level` to the new required minimum level.\n - INT_VAR `speed` to the new speed factor.\n - INT_VAR `thac0_bonus` to the new THAC0 bonus.\n - INT_VAR `dicesize` to the new dice size.\n - INT_VAR `dicenumber` to the new number of dice.\n - INT_VAR `damage_bonus` to the new damage bonus.\n - INT_VAR `damage_type` to the new damage type.\n - INT_VAR `charges` to the new number of charges.\n - INT_VAR `projectile` to the new projectile.\n - STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0."
6076
6076
  }
6077
6077
  },
6078
6078
  {
@@ -6082,7 +6082,7 @@
6082
6082
  "category": "patchFunctions",
6083
6083
  "documentation": {
6084
6084
  "kind": "markdown",
6085
- "value": "```weidu-tp2-tooltip\nDELETE_AREA_ITEM\n```\nDeletes all matching items from an area. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6085
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_AREA_ITEM\n```\nDeletes all matching items from an area. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6086
6086
  }
6087
6087
  },
6088
6088
  {
@@ -6092,7 +6092,7 @@
6092
6092
  "category": "patchFunctions",
6093
6093
  "documentation": {
6094
6094
  "kind": "markdown",
6095
- "value": "```weidu-tp2-tooltip\nDELETE_CRE_EFFECT\n```\nDeletes all effects with specified opcode from a creature. (Warning\":\" doesn't check EFF version) This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6095
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_CRE_EFFECT\n```\nDeletes all effects with specified opcode from a creature. (Warning\":\" doesn't check EFF version) This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6096
6096
  }
6097
6097
  },
6098
6098
  {
@@ -6102,7 +6102,7 @@
6102
6102
  "category": "patchFunctions",
6103
6103
  "documentation": {
6104
6104
  "kind": "markdown",
6105
- "value": "```weidu-tp2-tooltip\nDELETE_CRE_ITEM\n```\nDeletes all matching items from a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6105
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_CRE_ITEM\n```\nDeletes all matching items from a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6106
6106
  }
6107
6107
  },
6108
6108
  {
@@ -6112,7 +6112,7 @@
6112
6112
  "category": "patchFunctions",
6113
6113
  "documentation": {
6114
6114
  "kind": "markdown",
6115
- "value": "```weidu-tp2-tooltip\nDELETE_ITEM_EFFECT\n```\nDeletes all extended effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6115
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_ITEM_EFFECT\n```\nDeletes all extended effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6116
6116
  }
6117
6117
  },
6118
6118
  {
@@ -6122,7 +6122,7 @@
6122
6122
  "category": "patchFunctions",
6123
6123
  "documentation": {
6124
6124
  "kind": "markdown",
6125
- "value": "```weidu-tp2-tooltip\nDELETE_ITEM_EQEFFECT\n```\nDeletes all equipping effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6125
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_ITEM_EQEFFECT\n```\nDeletes all equipping effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6126
6126
  }
6127
6127
  },
6128
6128
  {
@@ -6132,7 +6132,7 @@
6132
6132
  "category": "patchFunctions",
6133
6133
  "documentation": {
6134
6134
  "kind": "markdown",
6135
- "value": "```weidu-tp2-tooltip\nDELETE_ITEM_HEADER\n```\nDelete ability headers, also known as extended headers, from items. This is a PATCH function. All integer variables default to 0.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)"
6135
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_ITEM_HEADER\n```\nDelete ability headers, also known as extended headers, from items. This is a PATCH function. All integer variables default to 0.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)"
6136
6136
  }
6137
6137
  },
6138
6138
  {
@@ -6142,7 +6142,7 @@
6142
6142
  "category": "patchFunctions",
6143
6143
  "documentation": {
6144
6144
  "kind": "markdown",
6145
- "value": "```weidu-tp2-tooltip\nDELETE_SPELL_EFFECT\n```\nDeletes all extended effects with specified opcode from a spell. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6145
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_SPELL_EFFECT\n```\nDeletes all extended effects with specified opcode from a spell. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
6146
6146
  }
6147
6147
  },
6148
6148
  {
@@ -6152,7 +6152,7 @@
6152
6152
  "category": "patchFunctions",
6153
6153
  "documentation": {
6154
6154
  "kind": "markdown",
6155
- "value": "```weidu-tp2-tooltip\nDELETE_SPELL_HEADER\n```\nDelete ability headers, also known as extended headers, from spells. This is a PATCH function. The integer variable `header_type` defaults to 0. The integer variable `min_level` defaults to -1 and if this variable is 0 or greater, only headers with a matching minimum level will be deleted.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)\n - INT_VAR `min_level` to the minimum level to be matched. If this variable is negative, it will not be used for matching. (default -1)"
6155
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_SPELL_HEADER\n```\nDelete ability headers, also known as extended headers, from spells. This is a PATCH function. The integer variable `header_type` defaults to 0. The integer variable `min_level` defaults to -1 and if this variable is 0 or greater, only headers with a matching minimum level will be deleted.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)\n - INT_VAR `min_level` to the minimum level to be matched. If this variable is negative, it will not be used for matching. (default -1)"
6156
6156
  }
6157
6157
  },
6158
6158
  {
@@ -6162,7 +6162,7 @@
6162
6162
  "category": "patchFunctions",
6163
6163
  "documentation": {
6164
6164
  "kind": "markdown",
6165
- "value": "```weidu-tp2-tooltip\nDELETE_STORE_ITEM\n```\nDeletes all matching items from a store. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6165
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_STORE_ITEM\n```\nDeletes all matching items from a store. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
6166
6166
  }
6167
6167
  },
6168
6168
  {
@@ -6172,7 +6172,7 @@
6172
6172
  "category": "patchFunctions",
6173
6173
  "documentation": {
6174
6174
  "kind": "markdown",
6175
- "value": "```weidu-tp2-tooltip\nDELETE_WORLDMAP_LINKS\n```\nDelete all links from one worldmap area to another. This is a PATCH function.\n This function will delete links from one specified area to another. Links can be deleted from all four directional nodes (north, east, south, west) or from a specific node. Links connecting the areas in the opposite direction will not be deleted.\n - STR_VAR `from_area` to the area from which the links that are to be deleted originate.\n - STR_VAR `from_node` to the directional node from which the links that are to be deleted originate. Legal values for this variable are \"north\", \"n\", \"east\", \"e\", \"south\", \"s\", \"west\", \"w\". Values are not case sensitive. Links are deleted from all four nodes by default.\n - STR_VAR `to_area` to the area to which the links that are to be deleted lead."
6175
+ "value": "```weidu-tp2-tooltip\npatch function DELETE_WORLDMAP_LINKS\n```\nDelete all links from one worldmap area to another. This is a PATCH function.\n This function will delete links from one specified area to another. Links can be deleted from all four directional nodes (north, east, south, west) or from a specific node. Links connecting the areas in the opposite direction will not be deleted.\n - STR_VAR `from_area` to the area from which the links that are to be deleted originate.\n - STR_VAR `from_node` to the directional node from which the links that are to be deleted originate. Legal values for this variable are \"north\", \"n\", \"east\", \"e\", \"south\", \"s\", \"west\", \"w\". Values are not case sensitive. Links are deleted from all four nodes by default.\n - STR_VAR `to_area` to the area to which the links that are to be deleted lead."
6176
6176
  }
6177
6177
  },
6178
6178
  {
@@ -6182,7 +6182,7 @@
6182
6182
  "category": "patchFunctions",
6183
6183
  "documentation": {
6184
6184
  "kind": "markdown",
6185
- "value": "```weidu-tp2-tooltip\nFJ_CRE_EFF_V2\n```\nConverts creatures using version 1 effects to version 2. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
6185
+ "value": "```weidu-tp2-tooltip\npatch function FJ_CRE_EFF_V2\n```\nConverts creatures using version 1 effects to version 2. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
6186
6186
  }
6187
6187
  },
6188
6188
  {
@@ -6192,7 +6192,7 @@
6192
6192
  "category": "patchFunctions",
6193
6193
  "documentation": {
6194
6194
  "kind": "markdown",
6195
- "value": "```weidu-tp2-tooltip\nFJ_CRE_REINDEX\n```\nReorders creatures with nonstandard offset orders. Called by FJ_CRE_VALIDITY automatically if relevant.\n This is a PATCH function.\n - INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n - INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1."
6195
+ "value": "```weidu-tp2-tooltip\npatch function FJ_CRE_REINDEX\n```\nReorders creatures with nonstandard offset orders. Called by FJ_CRE_VALIDITY automatically if relevant.\n This is a PATCH function.\n - INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n - INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1."
6196
6196
  }
6197
6197
  },
6198
6198
  {
@@ -6202,7 +6202,7 @@
6202
6202
  "category": "patchFunctions",
6203
6203
  "documentation": {
6204
6204
  "kind": "markdown",
6205
- "value": "```weidu-tp2-tooltip\nFJ_CRE_VALIDITY\n```\nChecks whether a CRE file is well-formed or not, fixes some common bugs, and reports whether the CRE file is still broken or not. In particular\\\":\\\"\n\n- reports invalidity if it is charbase.cre, shorter than the minimum size, the signature mismatches, or a sub-structure has members and its offset is in the header.\n- if a empty sub-structure's offset is in the header, point them to the end of the header.\n- if the cre is valid, force it to use proper order (known spells, spell memorization info, memorized spells, effects, items, item slot).\n- forces the CRE file to use EFF V2 effects internally (or EFF V1 if on BG1).\n\nThis is a PATCH function.\n\n- INT_VAR `do_message` to 1 if you want explicit an explicit message regarding the cre invalidity. Defaults to 0.\n- INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n- INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1.\n- RET `valid` returns 1 if the CRE is well-formed, 0 otherwise.\n"
6205
+ "value": "```weidu-tp2-tooltip\npatch function FJ_CRE_VALIDITY\n```\nChecks whether a CRE file is well-formed or not, fixes some common bugs, and reports whether the CRE file is still broken or not. In particular\\\":\\\"\n\n- reports invalidity if it is charbase.cre, shorter than the minimum size, the signature mismatches, or a sub-structure has members and its offset is in the header.\n- if a empty sub-structure's offset is in the header, point them to the end of the header.\n- if the cre is valid, force it to use proper order (known spells, spell memorization info, memorized spells, effects, items, item slot).\n- forces the CRE file to use EFF V2 effects internally (or EFF V1 if on BG1).\n\nThis is a PATCH function.\n\n- INT_VAR `do_message` to 1 if you want explicit an explicit message regarding the cre invalidity. Defaults to 0.\n- INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n- INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1.\n- RET `valid` returns 1 if the CRE is well-formed, 0 otherwise.\n"
6206
6206
  }
6207
6207
  },
6208
6208
  {
@@ -6212,7 +6212,7 @@
6212
6212
  "category": "patchFunctions",
6213
6213
  "documentation": {
6214
6214
  "kind": "markdown",
6215
- "value": "```weidu-tp2-tooltip\nFL#FJ_CRE_REINDEX\n```\nThis function is a wrapper around `FJ_CRE_REINDEX` and allows you to use the conventional function interface together with `MODDER fun_args`."
6215
+ "value": "```weidu-tp2-tooltip\npatch function FL#FJ_CRE_REINDEX\n```\nThis function is a wrapper around `FJ_CRE_REINDEX` and allows you to use the conventional function interface together with `MODDER fun_args`."
6216
6216
  }
6217
6217
  },
6218
6218
  {
@@ -6222,7 +6222,7 @@
6222
6222
  "category": "patchFunctions",
6223
6223
  "documentation": {
6224
6224
  "kind": "markdown",
6225
- "value": "```weidu-tp2-tooltip\nFL#FJ_CRE_VALIDITY\n```\nThis function is a wrapper around `FJ_CRE_VALIDITY` and allows you to use the conventional function interface together with `MODDER fun_args`."
6225
+ "value": "```weidu-tp2-tooltip\npatch function FL#FJ_CRE_VALIDITY\n```\nThis function is a wrapper around `FJ_CRE_VALIDITY` and allows you to use the conventional function interface together with `MODDER fun_args`."
6226
6226
  }
6227
6227
  },
6228
6228
  {
@@ -6232,7 +6232,7 @@
6232
6232
  "category": "patchFunctions",
6233
6233
  "documentation": {
6234
6234
  "kind": "markdown",
6235
- "value": "```weidu-tp2-tooltip\nITEM_EFFECT_TO_SPELL\n```\nCopies all extended effects from the current item to the first extended header of a spell. This is a PATCH macro and function.\n - SET `type` to the header type to copy the effect from (use 99 to specify 'all types').\n - SET `header` to number of extended header the effect should be copied from (use 99 to specify 'every header').\n - SET `insert_point` to the index into the spell file at which the effects should be inserted. A value of 0 will have the effects inserted as the first effects of the spell. Effects are inserted as the last effects by default.\n - SPRINT `new_itm_spl` to a spell you want to copy effects to."
6235
+ "value": "```weidu-tp2-tooltip\npatch function ITEM_EFFECT_TO_SPELL\n```\nCopies all extended effects from the current item to the first extended header of a spell. This is a PATCH macro and function.\n - SET `type` to the header type to copy the effect from (use 99 to specify 'all types').\n - SET `header` to number of extended header the effect should be copied from (use 99 to specify 'every header').\n - SET `insert_point` to the index into the spell file at which the effects should be inserted. A value of 0 will have the effects inserted as the first effects of the spell. Effects are inserted as the last effects by default.\n - SPRINT `new_itm_spl` to a spell you want to copy effects to."
6236
6236
  }
6237
6237
  },
6238
6238
  {
@@ -6242,7 +6242,7 @@
6242
6242
  "category": "patchFunctions",
6243
6243
  "documentation": {
6244
6244
  "kind": "markdown",
6245
- "value": "```weidu-tp2-tooltip\nREMOVE_CRE_ITEM_FLAGS\n```\nRemoves flags from all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be removed from\n - SPRINT `flags` to flags you need to remove (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
6245
+ "value": "```weidu-tp2-tooltip\npatch function REMOVE_CRE_ITEM_FLAGS\n```\nRemoves flags from all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be removed from\n - SPRINT `flags` to flags you need to remove (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
6246
6246
  }
6247
6247
  },
6248
6248
  {
@@ -6252,7 +6252,7 @@
6252
6252
  "category": "patchFunctions",
6253
6253
  "documentation": {
6254
6254
  "kind": "markdown",
6255
- "value": "```weidu-tp2-tooltip\nREPLACE_AREA_ITEM\n```\nReplaces all matching items in an area with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SPRINT `flags` to flags the new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
6255
+ "value": "```weidu-tp2-tooltip\npatch function REPLACE_AREA_ITEM\n```\nReplaces all matching items in an area with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SPRINT `flags` to flags the new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
6256
6256
  }
6257
6257
  },
6258
6258
  {
@@ -6262,7 +6262,7 @@
6262
6262
  "category": "patchFunctions",
6263
6263
  "documentation": {
6264
6264
  "kind": "markdown",
6265
- "value": "```weidu-tp2-tooltip\nREPLACE_STORE_ITEM\n```\nReplaces all matching items in a store with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SET `number_in_stock` to number of new items in stock (default 0)\n - SPRINT `flags` to flags new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
6265
+ "value": "```weidu-tp2-tooltip\npatch function REPLACE_STORE_ITEM\n```\nReplaces all matching items in a store with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SET `number_in_stock` to number of new items in stock (default 0)\n - SPRINT `flags` to flags new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
6266
6266
  }
6267
6267
  },
6268
6268
  {
@@ -6272,7 +6272,7 @@
6272
6272
  "category": "patchFunctions",
6273
6273
  "documentation": {
6274
6274
  "kind": "markdown",
6275
- "value": "```weidu-tp2-tooltip\nSET_CRE_ITEM_FLAGS\n```\nSet flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item which flags should be set\n - SPRINT `flags` to flags you need to set (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
6275
+ "value": "```weidu-tp2-tooltip\npatch function SET_CRE_ITEM_FLAGS\n```\nSet flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item which flags should be set\n - SPRINT `flags` to flags you need to set (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
6276
6276
  }
6277
6277
  },
6278
6278
  {
@@ -6282,7 +6282,7 @@
6282
6282
  "category": "patchFunctions",
6283
6283
  "documentation": {
6284
6284
  "kind": "markdown",
6285
- "value": "```weidu-tp2-tooltip\nT-CRE_EFF_V1\n```\nConverts creatures using version 2 effects to version 1. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
6285
+ "value": "```weidu-tp2-tooltip\npatch function T-CRE_EFF_V1\n```\nConverts creatures using version 2 effects to version 1. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
6286
6286
  }
6287
6287
  },
6288
6288
  {
@@ -6292,7 +6292,7 @@
6292
6292
  "category": "patchFunctions",
6293
6293
  "documentation": {
6294
6294
  "kind": "markdown",
6295
- "value": "```weidu-tp2-tooltip\nUPDATE_PVRZ_INDICES\n```\nUpdate the PVRZ references in a BAM V2 or MOS V2 resource. This is a PATCH function.\n This function will update the PVRZ references in a BAM V2 or MOS V2 resource with the next contiguous block of free PVRZ indices. This function is intended to be used in combination with the action function INSTALL_PVRZ.\n - INT_VAR `target_base_index` is an optional parameter. When specified, the function attempts to use a block of free PVRZ indices starting at the specified value. The default value is 1000.\n - RET `original_base_index` returns the lowest PVRZ index used by the source BAM or MOS. Returns -1 on error.\n - RET `new_base_index` returns the lowest PVRZ index used by the target BAM or MOS. Returns -1 on error.\n - RET `index_range` returns the range of reserved PVRZ indices, i.e., the difference between the smallest and biggest PVRZ index, inclusive. Returns 0 on error."
6295
+ "value": "```weidu-tp2-tooltip\npatch function UPDATE_PVRZ_INDICES\n```\nUpdate the PVRZ references in a BAM V2 or MOS V2 resource. This is a PATCH function.\n This function will update the PVRZ references in a BAM V2 or MOS V2 resource with the next contiguous block of free PVRZ indices. This function is intended to be used in combination with the action function INSTALL_PVRZ.\n - INT_VAR `target_base_index` is an optional parameter. When specified, the function attempts to use a block of free PVRZ indices starting at the specified value. The default value is 1000.\n - RET `original_base_index` returns the lowest PVRZ index used by the source BAM or MOS. Returns -1 on error.\n - RET `new_base_index` returns the lowest PVRZ index used by the target BAM or MOS. Returns -1 on error.\n - RET `index_range` returns the range of reserved PVRZ indices, i.e., the difference between the smallest and biggest PVRZ index, inclusive. Returns 0 on error."
6296
6296
  }
6297
6297
  },
6298
6298
  {
@@ -6302,7 +6302,7 @@
6302
6302
  "category": "patchFunctions",
6303
6303
  "documentation": {
6304
6304
  "kind": "markdown",
6305
- "value": "```weidu-tp2-tooltip\nfj_are_structure\n```\nAdds a structure to an area file. All variables are zero or blank by default unless otherwise indicated. Fields designated by an asterisk are typically required; all others are optional. This is a PATCH function.\nUniversal structure variables\\\":\\\"\n\n- STR_VAR `fj_structure_type` to the type of area structure to be added (actor, region, spawn, entrance, container, itm, ambient, variable, door, animation, explored bitmask, songlist, rest interrupt table, note or projectile)^*^;\n- INT_VAR `fj_delete_mode` to the index of the structure to be deleted (if deleting rather than adding a new structure);\n- INT_VAR `fj_debug` to 1 to enable feedback;\n- RET `fj_return_offset` returns the position of the structure in the area file;\n\n Actor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the actor's name^*^;\n- INT_VAR `fj_loc_x` to the starting X (horizontal) coordinate^*^;\n- INT_VAR `fj_loc_y` to the starting Y (vertical) coordinate^*^;\n- INT_VAR `fj_dest_x` to the destination X coordinate (by default the same as `fj_loc_x`);\n- INT_VAR `fj_dest_y` to the destination Y coordinate (by default the same as `fj_loc_y`);\n- INT_VAR `fj_loading` to whether the .cre file is loaded (0=attached, 1=loaded, default 1);\n- INT_VAR `fj_spawned` to whether the creature has been spawned (0=no, 1=yes, default 0);\n- INT_VAR `fj_animation` to the actor's animation number (from animate.ids, though the engine uses the animation set on the .cre file);\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east, default 0);\n- INT_VAR `fj_expiry` to the actor removal timer in absolute ticks (default -1 to avoid removal);\n- INT_VAR `fj_wander_dist_actor` to the actor's random walk distance limit;\n- INT_VAR `fj_mvmt_dist_actor` to the actor's movement distance limit;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_num_talked` to the NumTimesTalkedTo (in .sav files);\n- STR_VAR `fj_dlg_resref` to the actor's dialogue file (normally obtained from .cre files);\n- STR_VAR `fj_bcs_override` to the actor's override script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_general` to the actor's general script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_class` to the actor's class script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_race` to the actor's race script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_default` to the actor's default script (normally obtained from .cre files);\n- STR_VAR `fj_cre_resref` to the actor's resource reference (creature filename)^*^;\n- STR_VAR `fj_cre_embedded` to path/to/file.cre if embedding a new creature (defaults to `fj_cre_resref` if not set);\n\nRegion structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the region's name^*^;\n- INT_VAR `fj_type` to the region type (0=trap, 1=info, 2=travel)^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_cursor_idx` to the region's mouse cursor index (from cursors.bam)^*^;\n- STR_VAR `fj_destination_area` to the destination area resource reference (for travel regions);\n- STR_VAR `fj_destination_name` to the entrance name in the destination area (for travel regions);\n- INT_VAR `fj_flags` to the bitwise region flags;\n- INT_VAR `fj_info_point_strref` to the information text string reference (for info points, default -1);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the region is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the region's key;\n- STR_VAR `fj_reg_script` to the region script;\n- INT_VAR `fj_alt_x` to the activation point X coordinate;\n- INT_VAR `fj_alt_y` to the activation point Y coordinate;\n- STR_VAR `fj_sound` to the sound resource reference (ONLY for PST);\n- INT_VAR `fj_talk_loc_x` to the talk location point X coordinate (ONLY for PST);\n- INT_VAR `fj_talk_loc_y` to the talk location point Y coordinate (ONLY for PST);\n- INT_VAR `fj_speaker_strref` to the speaker's name string reference (default -1; ONLY for PST);\n- STR_VAR `fj_dialog` to the region's dialogue file (ONLY for PST);\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n\nSpawn structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the spawn point's name^*^;\n- INT_VAR `fj_loc_x` to the spawning X coordinate^*^;\n- INT_VAR `fj_loc_y` to the spawning Y coordinate^*^;\n- STR_VAR `fj_cre_resref0` to the resource reference of each creature spawned (0-9)^*^;\n- INT_VAR `fj_spawn_num` to the count of spawn creatures^*^;\n- INT_VAR `fj_difficulty` to the base number of creatures to spawn (encounter difficulty)^*^;\n- INT_VAR `fj_delay` to the number of seconds between spawning (default 10);\n- INT_VAR `fj_method` to the spawn method;\n- INT_VAR `fj_duration` to the creature duration (default 1000);\n- INT_VAR `fj_wander_dist_spawn` to the creature's random walk distance limit (default 1000);\n- INT_VAR `fj_mvmt_dist_spawn` to the creature's movement distance limit (default 1000);\n- INT_VAR `fj_max_num` to the maximum number of creatures to spawn^*^;\n- INT_VAR `fj_enable` to the spawn point status (0=inactive, 1=active, default 1);\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_day_prob` to the spawn point daytime probability (default 100);\n- INT_VAR `fj_night_prob` to the spawn point nighttime probability (default 100);\n\nEntrance structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the entrance's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east)^*^;\n\nContainer structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the container's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_type` to the container type (1=bag, 2=chest, 3=drawer, 4=pile, 5=table, 6=shelf, 7=altar, 8=nonvisible, 9=spellbook, 10=body, 11=barrel, 12=crate)^*^;\n- INT_VAR `fj_lock_diff` to the lock difficulty (default 100);\n- INT_VAR `fj_flags` to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove_diff` to the trap removal difficulty percentage (default 100);\n- INT_VAR `fj_trap_active` to whether the container is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the trap's bounding box;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the trap's bounding box;\n- STR_VAR `fj_trap_script` to the trap's script;\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n- STR_VAR `fj_key_resref` to the filename of the container's key;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n\nItem structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the item's resource reference (filename)^*^;\n- INT_VAR `fj_con_itm_idx` to the index of the container to which the item is added^*^;\n- INT_VAR `fj_itm_expiry` to the item expiration time (default 0);\n- INT_VAR `fj_charge0` to the charges of the 1st ability (item quantity for stackables, default 0);\n- INT_VAR `fj_charge1` to the charges of the 2nd ability (default 0);\n- INT_VAR `fj_charge2` to the charges of the 3rd ability (default 0);\n- INT_VAR `fj_flags` to the bitwise item flags (bit0=identified, bit1=unstealable, bit2=stolen, bit3=undroppable, default 0);\n\nAmbient structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the ambient's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_radius` to the sound radius (default 500);\n- INT_VAR `fj_loc_z` to the Z coordinate (height);\n- INT_VAR `fj_pitch_variance` to the pitch variance;\n- INT_VAR `fj_volume_variance` to the volume variance;\n- INT_VAR `fj_volume` to the volume percentage (default 80);\n- STR_VAR `fj_wav_resref0` to the resource reference of each sound (0-9)^*^;\n- INT_VAR `fj_sound_num` to the number of sounds^*^;\n- INT_VAR `fj_delay` to the base interval in seconds between sounds from this ambient list;\n- INT_VAR `fj_variation` to the base deviation from the base interval;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_flags` to the bitwise ambient flags^*^;\n\nVariable structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the variable's name^*^;\n- INT_VAR `fj_variable_value` to the variable's value^*^;\n\nDoor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the door's name^*^;\n- STR_VAR `fj_door_wed_id` to the door ID linked to the .wed file^*^;\n- INT_VAR `fj_flags` to the bitwise door flags^*^;\n- INT_VAR `fj_open_box_left` to the leftmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_top` to the topmost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_right` to the rightmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_bottom` to the bottommost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_closed_box_left` to the leftmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_top` to the topmost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_right` to the rightmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_bottom` to the bottommost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_door_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the open door^*^;\n- INT_VAR `fj_door_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the closed door^*^;\n- INT_VAR `fj_cell_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the open door^*^;\n- INT_VAR `fj_cell_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the closed door^*^;\n- STR_VAR `fj_door_open_wav` to the door open sound;\n- STR_VAR `fj_door_close_wav` to the door closed sound;\n- INT_VAR `fj_cursor_idx` to the door's mouse cursor index (from cursors.bam)^*^;\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the door is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the door's key;\n- STR_VAR `fj_door_script` to the door script;\n- INT_VAR `fj_detect_diff` to the detection difficulty (for secret doors);\n- INT_VAR `fj_locked_diff` to the lock difficulty;\n- INT_VAR `fj_open_loc_x` to the X coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_open_loc_y` to the Y coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_closed_loc_x` to the X coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_closed_loc_y` to the Y coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n- STR_VAR `fj_travel_trigger` to the travel region name^*^;\n- INT_VAR `fj_dlg_strref` to the dialogue string reference (default -1);\n- STR_VAR `fj_dlg_resref` to the door's dialogue file;\n\nAnimation structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the animation name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- STR_VAR `fj_bam_resref` to the animation resource reference (filename)^*^;\n- INT_VAR `fj_bam_seq` to the BAM sequence number;\n- INT_VAR `fj_bam_frame` to the BAM frame number;\n- INT_VAR `fj_flags` to the bitwise animation flags^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_transparent` to the BAM transparency;\n- INT_VAR `fj_init_frame` to the starting frame;\n- INT_VAR `fj_loop_chance` to the chance of looping;\n- INT_VAR `fj_skip_cycles` to start delay in frames;\n- STR_VAR `fj_bmp_resref` to the palette bitmap;\n\nBitmask structure variables\\\":\\\"\n\n- STR_VAR `fj_bitmask` to path/to/binary.file ^*^;\n\nSonglist structure variables\\\":\\\"\n\n- INT_VAR `fj_song_day` to the day SONGLIST.2DA entry;\n- INT_VAR `fj_song_night` to the night SONGLIST.2DA entry;\n- INT_VAR `fj_song_victory` to the victory SONGLIST.2DA entry;\n- INT_VAR `fj_song_battle` to the battle SONGLIST.2DA entry;\n- INT_VAR `fj_song_defeat` to the defeat SONGLIST.2DA entry;\n- STR_VAR `fj_song_day0` to the day song WAV resref;\n- STR_VAR `fj_song_day1` to the night song WAV resref;\n- INT_VAR `fj_song_day_vol` to the day songs volume (default 100);\n- STR_VAR `fj_song_night0` to the night song WAV resref;\n- STR_VAR `fj_song_night1` to the second night song WAV resref;\n- INT_VAR `fj_song_night_vol` to the night songs volume (default 100);\n\nRest interrupt structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the name of the rest interrupts (for editor use only);\n- INT_VAR `fj_cre_strref0...fj_cre_strref9` to string displayed upon party ambush (default -1);\n- STR_VAR `fj_cre_resref0...fj_cre_resref9` to creature resref;\n- STR_VAR `fj_spawn_num` to the number of spawned attackers;\n- STR_VAR `fj_difficulty` to the difficulty of the encounter;\n- STR_VAR `fj_duration` to the creature's duration (default 1000);\n- STR_VAR `fj_wander_distance` to the creature's random walk distance limit (default 1000);\n- STR_VAR `fj_mvmt_distance` to the creature's movement distance limit (default 1000);\n- STR_VAR `fj_max_num` to maximum number of spawned creatures;\n- STR_VAR `fj_enable` to whether rest interrupts are enabled (0=no, 1=yes);\n- STR_VAR `fj_day_prob` to probability of daytime ambush;\n- STR_VAR `fj_night_prob` to probability of nightime ambush;\n\nMap note structure variables\\\":\\\"\n\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_note_strref` to the note string reference (default -1, BGII only)^*^;\n- STR_VAR `fj_note_text` to the note text (PST only)^*^;\n- INT_VAR `fj_strref_loc` to the strref location (0=external, 1=dialog.tlk, default 1);\n- INT_VAR `fj_color` to the map marker color (0-7);\n- INT_VAR `fj_note_id` to the note ID;\n\nProjectile trap structure variables (not available on PST)\\\":\\\"\n\n- STR_VAR `fj_name` to the projectile filename^*^;\n- INT_VAR `fj_eff_off` to the effect block offset;\n- INT_VAR `fj_eff_size` to the effect block size;\n- INT_VAR `fj_missile_num` to the missile.ids reference (projectl.ids - 1);\n- INT_VAR `fj_frequency` to the explosion length (in frames);\n- INT_VAR `fj_duration` to the number of explosions;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_target` to the target ID;\n- STR_VAR `fj_embedded_eff0` to path/to/v2.eff or eff resref containing to projectile's effects^*^;\n"
6305
+ "value": "```weidu-tp2-tooltip\npatch function fj_are_structure\n```\nAdds a structure to an area file. All variables are zero or blank by default unless otherwise indicated. Fields designated by an asterisk are typically required; all others are optional. This is a PATCH function.\nUniversal structure variables\\\":\\\"\n\n- STR_VAR `fj_structure_type` to the type of area structure to be added (actor, region, spawn, entrance, container, itm, ambient, variable, door, animation, explored bitmask, songlist, rest interrupt table, note or projectile)^*^;\n- INT_VAR `fj_delete_mode` to the index of the structure to be deleted (if deleting rather than adding a new structure);\n- INT_VAR `fj_debug` to 1 to enable feedback;\n- RET `fj_return_offset` returns the position of the structure in the area file;\n\n Actor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the actor's name^*^;\n- INT_VAR `fj_loc_x` to the starting X (horizontal) coordinate^*^;\n- INT_VAR `fj_loc_y` to the starting Y (vertical) coordinate^*^;\n- INT_VAR `fj_dest_x` to the destination X coordinate (by default the same as `fj_loc_x`);\n- INT_VAR `fj_dest_y` to the destination Y coordinate (by default the same as `fj_loc_y`);\n- INT_VAR `fj_loading` to whether the .cre file is loaded (0=attached, 1=loaded, default 1);\n- INT_VAR `fj_spawned` to whether the creature has been spawned (0=no, 1=yes, default 0);\n- INT_VAR `fj_animation` to the actor's animation number (from animate.ids, though the engine uses the animation set on the .cre file);\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east, default 0);\n- INT_VAR `fj_expiry` to the actor removal timer in absolute ticks (default -1 to avoid removal);\n- INT_VAR `fj_wander_dist_actor` to the actor's random walk distance limit;\n- INT_VAR `fj_mvmt_dist_actor` to the actor's movement distance limit;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_num_talked` to the NumTimesTalkedTo (in .sav files);\n- STR_VAR `fj_dlg_resref` to the actor's dialogue file (normally obtained from .cre files);\n- STR_VAR `fj_bcs_override` to the actor's override script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_general` to the actor's general script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_class` to the actor's class script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_race` to the actor's race script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_default` to the actor's default script (normally obtained from .cre files);\n- STR_VAR `fj_cre_resref` to the actor's resource reference (creature filename)^*^;\n- STR_VAR `fj_cre_embedded` to path/to/file.cre if embedding a new creature (defaults to `fj_cre_resref` if not set);\n\nRegion structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the region's name^*^;\n- INT_VAR `fj_type` to the region type (0=trap, 1=info, 2=travel)^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_cursor_idx` to the region's mouse cursor index (from cursors.bam)^*^;\n- STR_VAR `fj_destination_area` to the destination area resource reference (for travel regions);\n- STR_VAR `fj_destination_name` to the entrance name in the destination area (for travel regions);\n- INT_VAR `fj_flags` to the bitwise region flags;\n- INT_VAR `fj_info_point_strref` to the information text string reference (for info points, default -1);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the region is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the region's key;\n- STR_VAR `fj_reg_script` to the region script;\n- INT_VAR `fj_alt_x` to the activation point X coordinate;\n- INT_VAR `fj_alt_y` to the activation point Y coordinate;\n- STR_VAR `fj_sound` to the sound resource reference (ONLY for PST);\n- INT_VAR `fj_talk_loc_x` to the talk location point X coordinate (ONLY for PST);\n- INT_VAR `fj_talk_loc_y` to the talk location point Y coordinate (ONLY for PST);\n- INT_VAR `fj_speaker_strref` to the speaker's name string reference (default -1; ONLY for PST);\n- STR_VAR `fj_dialog` to the region's dialogue file (ONLY for PST);\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n\nSpawn structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the spawn point's name^*^;\n- INT_VAR `fj_loc_x` to the spawning X coordinate^*^;\n- INT_VAR `fj_loc_y` to the spawning Y coordinate^*^;\n- STR_VAR `fj_cre_resref0` to the resource reference of each creature spawned (0-9)^*^;\n- INT_VAR `fj_spawn_num` to the count of spawn creatures^*^;\n- INT_VAR `fj_difficulty` to the base number of creatures to spawn (encounter difficulty)^*^;\n- INT_VAR `fj_delay` to the number of seconds between spawning (default 10);\n- INT_VAR `fj_method` to the spawn method;\n- INT_VAR `fj_duration` to the creature duration (default 1000);\n- INT_VAR `fj_wander_dist_spawn` to the creature's random walk distance limit (default 1000);\n- INT_VAR `fj_mvmt_dist_spawn` to the creature's movement distance limit (default 1000);\n- INT_VAR `fj_max_num` to the maximum number of creatures to spawn^*^;\n- INT_VAR `fj_enable` to the spawn point status (0=inactive, 1=active, default 1);\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_day_prob` to the spawn point daytime probability (default 100);\n- INT_VAR `fj_night_prob` to the spawn point nighttime probability (default 100);\n\nEntrance structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the entrance's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east)^*^;\n\nContainer structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the container's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_type` to the container type (1=bag, 2=chest, 3=drawer, 4=pile, 5=table, 6=shelf, 7=altar, 8=nonvisible, 9=spellbook, 10=body, 11=barrel, 12=crate)^*^;\n- INT_VAR `fj_lock_diff` to the lock difficulty (default 100);\n- INT_VAR `fj_flags` to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove_diff` to the trap removal difficulty percentage (default 100);\n- INT_VAR `fj_trap_active` to whether the container is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the trap's bounding box;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the trap's bounding box;\n- STR_VAR `fj_trap_script` to the trap's script;\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n- STR_VAR `fj_key_resref` to the filename of the container's key;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n\nItem structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the item's resource reference (filename)^*^;\n- INT_VAR `fj_con_itm_idx` to the index of the container to which the item is added^*^;\n- INT_VAR `fj_itm_expiry` to the item expiration time (default 0);\n- INT_VAR `fj_charge0` to the charges of the 1st ability (item quantity for stackables, default 0);\n- INT_VAR `fj_charge1` to the charges of the 2nd ability (default 0);\n- INT_VAR `fj_charge2` to the charges of the 3rd ability (default 0);\n- INT_VAR `fj_flags` to the bitwise item flags (bit0=identified, bit1=unstealable, bit2=stolen, bit3=undroppable, default 0);\n\nAmbient structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the ambient's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_radius` to the sound radius (default 500);\n- INT_VAR `fj_loc_z` to the Z coordinate (height);\n- INT_VAR `fj_pitch_variance` to the pitch variance;\n- INT_VAR `fj_volume_variance` to the volume variance;\n- INT_VAR `fj_volume` to the volume percentage (default 80);\n- STR_VAR `fj_wav_resref0` to the resource reference of each sound (0-9)^*^;\n- INT_VAR `fj_sound_num` to the number of sounds^*^;\n- INT_VAR `fj_delay` to the base interval in seconds between sounds from this ambient list;\n- INT_VAR `fj_variation` to the base deviation from the base interval;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_flags` to the bitwise ambient flags^*^;\n\nVariable structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the variable's name^*^;\n- INT_VAR `fj_variable_value` to the variable's value^*^;\n\nDoor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the door's name^*^;\n- STR_VAR `fj_door_wed_id` to the door ID linked to the .wed file^*^;\n- INT_VAR `fj_flags` to the bitwise door flags^*^;\n- INT_VAR `fj_open_box_left` to the leftmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_top` to the topmost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_right` to the rightmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_bottom` to the bottommost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_closed_box_left` to the leftmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_top` to the topmost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_right` to the rightmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_bottom` to the bottommost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_door_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the open door^*^;\n- INT_VAR `fj_door_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the closed door^*^;\n- INT_VAR `fj_cell_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the open door^*^;\n- INT_VAR `fj_cell_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the closed door^*^;\n- STR_VAR `fj_door_open_wav` to the door open sound;\n- STR_VAR `fj_door_close_wav` to the door closed sound;\n- INT_VAR `fj_cursor_idx` to the door's mouse cursor index (from cursors.bam)^*^;\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the door is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the door's key;\n- STR_VAR `fj_door_script` to the door script;\n- INT_VAR `fj_detect_diff` to the detection difficulty (for secret doors);\n- INT_VAR `fj_locked_diff` to the lock difficulty;\n- INT_VAR `fj_open_loc_x` to the X coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_open_loc_y` to the Y coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_closed_loc_x` to the X coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_closed_loc_y` to the Y coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n- STR_VAR `fj_travel_trigger` to the travel region name^*^;\n- INT_VAR `fj_dlg_strref` to the dialogue string reference (default -1);\n- STR_VAR `fj_dlg_resref` to the door's dialogue file;\n\nAnimation structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the animation name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- STR_VAR `fj_bam_resref` to the animation resource reference (filename)^*^;\n- INT_VAR `fj_bam_seq` to the BAM sequence number;\n- INT_VAR `fj_bam_frame` to the BAM frame number;\n- INT_VAR `fj_flags` to the bitwise animation flags^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_transparent` to the BAM transparency;\n- INT_VAR `fj_init_frame` to the starting frame;\n- INT_VAR `fj_loop_chance` to the chance of looping;\n- INT_VAR `fj_skip_cycles` to start delay in frames;\n- STR_VAR `fj_bmp_resref` to the palette bitmap;\n\nBitmask structure variables\\\":\\\"\n\n- STR_VAR `fj_bitmask` to path/to/binary.file ^*^;\n\nSonglist structure variables\\\":\\\"\n\n- INT_VAR `fj_song_day` to the day SONGLIST.2DA entry;\n- INT_VAR `fj_song_night` to the night SONGLIST.2DA entry;\n- INT_VAR `fj_song_victory` to the victory SONGLIST.2DA entry;\n- INT_VAR `fj_song_battle` to the battle SONGLIST.2DA entry;\n- INT_VAR `fj_song_defeat` to the defeat SONGLIST.2DA entry;\n- STR_VAR `fj_song_day0` to the day song WAV resref;\n- STR_VAR `fj_song_day1` to the night song WAV resref;\n- INT_VAR `fj_song_day_vol` to the day songs volume (default 100);\n- STR_VAR `fj_song_night0` to the night song WAV resref;\n- STR_VAR `fj_song_night1` to the second night song WAV resref;\n- INT_VAR `fj_song_night_vol` to the night songs volume (default 100);\n\nRest interrupt structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the name of the rest interrupts (for editor use only);\n- INT_VAR `fj_cre_strref0...fj_cre_strref9` to string displayed upon party ambush (default -1);\n- STR_VAR `fj_cre_resref0...fj_cre_resref9` to creature resref;\n- STR_VAR `fj_spawn_num` to the number of spawned attackers;\n- STR_VAR `fj_difficulty` to the difficulty of the encounter;\n- STR_VAR `fj_duration` to the creature's duration (default 1000);\n- STR_VAR `fj_wander_distance` to the creature's random walk distance limit (default 1000);\n- STR_VAR `fj_mvmt_distance` to the creature's movement distance limit (default 1000);\n- STR_VAR `fj_max_num` to maximum number of spawned creatures;\n- STR_VAR `fj_enable` to whether rest interrupts are enabled (0=no, 1=yes);\n- STR_VAR `fj_day_prob` to probability of daytime ambush;\n- STR_VAR `fj_night_prob` to probability of nightime ambush;\n\nMap note structure variables\\\":\\\"\n\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_note_strref` to the note string reference (default -1, BGII only)^*^;\n- STR_VAR `fj_note_text` to the note text (PST only)^*^;\n- INT_VAR `fj_strref_loc` to the strref location (0=external, 1=dialog.tlk, default 1);\n- INT_VAR `fj_color` to the map marker color (0-7);\n- INT_VAR `fj_note_id` to the note ID;\n\nProjectile trap structure variables (not available on PST)\\\":\\\"\n\n- STR_VAR `fj_name` to the projectile filename^*^;\n- INT_VAR `fj_eff_off` to the effect block offset;\n- INT_VAR `fj_eff_size` to the effect block size;\n- INT_VAR `fj_missile_num` to the missile.ids reference (projectl.ids - 1);\n- INT_VAR `fj_frequency` to the explosion length (in frames);\n- INT_VAR `fj_duration` to the number of explosions;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_target` to the target ID;\n- STR_VAR `fj_embedded_eff0` to path/to/v2.eff or eff resref containing to projectile's effects^*^;\n"
6306
6306
  }
6307
6307
  },
6308
6308
  {
@@ -6312,7 +6312,7 @@
6312
6312
  "category": "dimorphicFunctions",
6313
6313
  "documentation": {
6314
6314
  "kind": "markdown",
6315
- "value": "```weidu-tp2-tooltip\nDIRECTORY_OF_FILESPEC\n```\nReturns the directory of a file specification. Compare to SOURCE_DIRECTORY. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable directory, or a warning will be raised.\n - RET `directory` returns the directory of the file specification."
6315
+ "value": "```weidu-tp2-tooltip\ndimorphic function DIRECTORY_OF_FILESPEC\n```\nReturns the directory of a file specification. Compare to SOURCE_DIRECTORY. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable directory, or a warning will be raised.\n - RET `directory` returns the directory of the file specification."
6316
6316
  }
6317
6317
  },
6318
6318
  {
@@ -6322,7 +6322,7 @@
6322
6322
  "category": "dimorphicFunctions",
6323
6323
  "documentation": {
6324
6324
  "kind": "markdown",
6325
- "value": "```weidu-tp2-tooltip\nEXT_OF_FILESPEC\n```\nReturns the resource extension of a file specification. Compare to SOURCE_EXT. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource extension, or a warning will be raised.\n - RET `ext` returns the resource extension of the file specification."
6325
+ "value": "```weidu-tp2-tooltip\ndimorphic function EXT_OF_FILESPEC\n```\nReturns the resource extension of a file specification. Compare to SOURCE_EXT. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource extension, or a warning will be raised.\n - RET `ext` returns the resource extension of the file specification."
6326
6326
  }
6327
6327
  },
6328
6328
  {
@@ -6332,7 +6332,7 @@
6332
6332
  "category": "dimorphicFunctions",
6333
6333
  "documentation": {
6334
6334
  "kind": "markdown",
6335
- "value": "```weidu-tp2-tooltip\nFILE_OF_FILESPEC\n```\nReturns the file of a file specification. Compare to SOURCE_FILE. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which may or may not include a directory.\n - RET `file` returns the file of the file specification."
6335
+ "value": "```weidu-tp2-tooltip\ndimorphic function FILE_OF_FILESPEC\n```\nReturns the file of a file specification. Compare to SOURCE_FILE. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which may or may not include a directory.\n - RET `file` returns the file of the file specification."
6336
6336
  }
6337
6337
  },
6338
6338
  {
@@ -6352,7 +6352,7 @@
6352
6352
  "category": "dimorphicFunctions",
6353
6353
  "documentation": {
6354
6354
  "kind": "markdown",
6355
- "value": "```weidu-tp2-tooltip\nGET_UNIQUE_FILE_NAME\n```\nCreates a file name that is currently unallocated. This is a PATCH and ACTION function. This function will create a filename using __ as a prefix. __ is reserved by The Bigg and writeable by anybody, as long as you dynamically create the file name (either by using this function or other code of your devising). The algorithm creates file names in base 36, going from __0000.ext to __zzzz.ext; this allows for 36 ^ 4 = 1679616 unique file names.\n To allow users to reinstall your mod without breaking the identity of these files, you can use the `base` parameter to ensure that the same thing will be mapped to the same file on reinstalls. For instance, if you're iterating through Mages to give each of them a spellbook, base should contain your modder prefix, an identifier for the purpose of the call, and the file name you're working on, for instance\":\" ~tb#spellbooks_%SOURCE_RES%~\n - STR_VAR `extension` to the desired extension (required).\n - STR_VAR `base` to a string unique to your mod and current file (optional).\n - RET `filename` the currently unallocated file name (sans the extension)."
6355
+ "value": "```weidu-tp2-tooltip\ndimorphic function GET_UNIQUE_FILE_NAME\n```\nCreates a file name that is currently unallocated. This is a PATCH and ACTION function. This function will create a filename using __ as a prefix. __ is reserved by The Bigg and writeable by anybody, as long as you dynamically create the file name (either by using this function or other code of your devising). The algorithm creates file names in base 36, going from __0000.ext to __zzzz.ext; this allows for 36 ^ 4 = 1679616 unique file names.\n To allow users to reinstall your mod without breaking the identity of these files, you can use the `base` parameter to ensure that the same thing will be mapped to the same file on reinstalls. For instance, if you're iterating through Mages to give each of them a spellbook, base should contain your modder prefix, an identifier for the purpose of the call, and the file name you're working on, for instance\":\" ~tb#spellbooks_%SOURCE_RES%~\n - STR_VAR `extension` to the desired extension (required).\n - STR_VAR `base` to a string unique to your mod and current file (optional).\n - RET `filename` the currently unallocated file name (sans the extension)."
6356
6356
  }
6357
6357
  },
6358
6358
  {
@@ -6362,7 +6362,7 @@
6362
6362
  "category": "dimorphicFunctions",
6363
6363
  "documentation": {
6364
6364
  "kind": "markdown",
6365
- "value": "```weidu-tp2-tooltip\nNAME_NUM_OF_SPELL_RES\n```\nConverts a spell resource name to a spell.ids reference. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_res` to the resource name for the referenced spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell."
6365
+ "value": "```weidu-tp2-tooltip\ndimorphic function NAME_NUM_OF_SPELL_RES\n```\nConverts a spell resource name to a spell.ids reference. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_res` to the resource name for the referenced spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell."
6366
6366
  }
6367
6367
  },
6368
6368
  {
@@ -6372,7 +6372,7 @@
6372
6372
  "category": "dimorphicFunctions",
6373
6373
  "documentation": {
6374
6374
  "kind": "markdown",
6375
- "value": "```weidu-tp2-tooltip\nRES_NAME_OF_SPELL_NUM\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_res` to the resource name for the referenced spell."
6375
+ "value": "```weidu-tp2-tooltip\ndimorphic function RES_NAME_OF_SPELL_NUM\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_res` to the resource name for the referenced spell."
6376
6376
  }
6377
6377
  },
6378
6378
  {
@@ -6382,7 +6382,7 @@
6382
6382
  "category": "dimorphicFunctions",
6383
6383
  "documentation": {
6384
6384
  "kind": "markdown",
6385
- "value": "```weidu-tp2-tooltip\nRES_NUM_OF_SPELL_NAME\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_res` to the resource name for the referenced spell."
6385
+ "value": "```weidu-tp2-tooltip\ndimorphic function RES_NUM_OF_SPELL_NAME\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_res` to the resource name for the referenced spell."
6386
6386
  }
6387
6387
  },
6388
6388
  {
@@ -6392,7 +6392,7 @@
6392
6392
  "category": "dimorphicFunctions",
6393
6393
  "documentation": {
6394
6394
  "kind": "markdown",
6395
- "value": "```weidu-tp2-tooltip\nRES_OF_FILESPEC\n```\nReturns the resource name of a file specification. Compare to SOURCE_RES. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource name, or a warning will be raised.\n - RET `res` returns the resource name of the file specification."
6395
+ "value": "```weidu-tp2-tooltip\ndimorphic function RES_OF_FILESPEC\n```\nReturns the resource name of a file specification. Compare to SOURCE_RES. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource name, or a warning will be raised.\n - RET `res` returns the resource name of the file specification."
6396
6396
  }
6397
6397
  },
6398
6398
  {
@@ -6412,7 +6412,7 @@
6412
6412
  "category": "actionMacros",
6413
6413
  "documentation": {
6414
6414
  "kind": "markdown",
6415
- "value": "```weidu-tp2-tooltip\nREAD_SOUNDSET\n```\nReads soundset of a creature and stores it as an array of string references This is an ACTION macro.\n - SPRINT `npc` to the target creature (with .cre extension)\n - SPRINT `soundset` to the name of soundset you want."
6415
+ "value": "```weidu-tp2-tooltip\naction macro READ_SOUNDSET\n```\nReads soundset of a creature and stores it as an array of string references This is an ACTION macro.\n - SPRINT `npc` to the target creature (with .cre extension)\n - SPRINT `soundset` to the name of soundset you want."
6416
6416
  }
6417
6417
  },
6418
6418
  {
@@ -6422,7 +6422,7 @@
6422
6422
  "category": "actionMacros",
6423
6423
  "documentation": {
6424
6424
  "kind": "markdown",
6425
- "value": "```weidu-tp2-tooltip\nWRITE_SOUNDSET\n```\nWrites soundset to all matching creatures. Regexp allowed. This is an ACTION macro.\n - SPRINT `npc` to a creature in question (with .cre extension)\n - SPRINT `soundset` to name of soundset you have.\n - SET `overwrite` to 2 if you want new soundset to overwrite the old one completely. Set it to 1 if you want to overwrite old string references only with non-empty new references (may keep some old). Set it to 0 it you want to overwrite only empty old references with new ones."
6425
+ "value": "```weidu-tp2-tooltip\naction macro WRITE_SOUNDSET\n```\nWrites soundset to all matching creatures. Regexp allowed. This is an ACTION macro.\n - SPRINT `npc` to a creature in question (with .cre extension)\n - SPRINT `soundset` to name of soundset you have.\n - SET `overwrite` to 2 if you want new soundset to overwrite the old one completely. Set it to 1 if you want to overwrite old string references only with non-empty new references (may keep some old). Set it to 0 it you want to overwrite only empty old references with new ones."
6426
6426
  }
6427
6427
  },
6428
6428
  {
@@ -6432,7 +6432,7 @@
6432
6432
  "category": "actionMacros",
6433
6433
  "documentation": {
6434
6434
  "kind": "markdown",
6435
- "value": "```weidu-tp2-tooltip\ntb#fix_file_size\n```\nOverwrites all files matching a certain regexp with a certain standard file, if they are under a certain size.\n This is an ACTION macro.\n - SET `tb#fix_file_size_min` to the maximum allowed size (files whose size is exactly this value are NOT overwritten).\n - SPRINT `tb#fix_file_size_target` to the standard file used to replace file(s) that match the regexp.\n - SPRINT `tb#fix_file_size_category` to a descriptive name.\n - SPRINT `tb#fix_file_size_regexp` to the regexp for the file(s) to be checked for a match."
6435
+ "value": "```weidu-tp2-tooltip\naction macro tb#fix_file_size\n```\nOverwrites all files matching a certain regexp with a certain standard file, if they are under a certain size.\n This is an ACTION macro.\n - SET `tb#fix_file_size_min` to the maximum allowed size (files whose size is exactly this value are NOT overwritten).\n - SPRINT `tb#fix_file_size_target` to the standard file used to replace file(s) that match the regexp.\n - SPRINT `tb#fix_file_size_category` to a descriptive name.\n - SPRINT `tb#fix_file_size_regexp` to the regexp for the file(s) to be checked for a match."
6436
6436
  }
6437
6437
  },
6438
6438
  {
@@ -6442,7 +6442,7 @@
6442
6442
  "category": "patchMacros",
6443
6443
  "documentation": {
6444
6444
  "kind": "markdown",
6445
- "value": "```weidu-tp2-tooltip\ntb#factorial\n```\nComputes the factorial of a number.\n This is a PATCH macro.\n - SET `tb#factorial_index` to the factorial you'd like to compute.\n - SET `tb#factorial_result` to 1;\n - The result is `tb#factorial_result`."
6445
+ "value": "```weidu-tp2-tooltip\npatch macro tb#factorial\n```\nComputes the factorial of a number.\n This is a PATCH macro.\n - SET `tb#factorial_index` to the factorial you'd like to compute.\n - SET `tb#factorial_result` to 1;\n - The result is `tb#factorial_result`."
6446
6446
  }
6447
6447
  }
6448
6448
  ]