@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.
@@ -1364,13 +1364,13 @@
1364
1364
  "COMPILE_BAF_TO_BCS": {
1365
1365
  "contents": {
1366
1366
  "kind": "markdown",
1367
- "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."
1367
+ "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**"
1368
1368
  }
1369
1369
  },
1370
1370
  "COMPILE_D_TO_DLG": {
1371
1371
  "contents": {
1372
1372
  "kind": "markdown",
1373
- "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."
1373
+ "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**"
1374
1374
  }
1375
1375
  },
1376
1376
  "COMPRESS_INTO_FILE": {
@@ -1418,13 +1418,13 @@
1418
1418
  "DECOMPILE_BCS_TO_BAF": {
1419
1419
  "contents": {
1420
1420
  "kind": "markdown",
1421
- "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."
1421
+ "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**"
1422
1422
  }
1423
1423
  },
1424
1424
  "DECOMPILE_DLG_TO_D": {
1425
1425
  "contents": {
1426
1426
  "kind": "markdown",
1427
- "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."
1427
+ "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**"
1428
1428
  }
1429
1429
  },
1430
1430
  "DECOMPRESS_INTO_FILE": {
@@ -3434,319 +3434,319 @@
3434
3434
  "HANDLE_AUDIO": {
3435
3435
  "contents": {
3436
3436
  "kind": "markdown",
3437
- "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"
3437
+ "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"
3438
3438
  }
3439
3439
  },
3440
3440
  "HANDLE_CHARSETS": {
3441
3441
  "contents": {
3442
3442
  "kind": "markdown",
3443
- "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"
3443
+ "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"
3444
3444
  }
3445
3445
  },
3446
3446
  "HANDLE_TILESETS": {
3447
3447
  "contents": {
3448
3448
  "kind": "markdown",
3449
- "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"
3449
+ "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"
3450
3450
  }
3451
3451
  },
3452
3452
  "INSTALL_PVRZ": {
3453
3453
  "contents": {
3454
3454
  "kind": "markdown",
3455
- "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."
3455
+ "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."
3456
3456
  }
3457
3457
  },
3458
3458
  "sc#addWmpAre": {
3459
3459
  "contents": {
3460
3460
  "kind": "markdown",
3461
- "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"
3461
+ "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"
3462
3462
  }
3463
3463
  },
3464
3464
  "ADD_AREA_ITEM": {
3465
3465
  "contents": {
3466
3466
  "kind": "markdown",
3467
- "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)"
3467
+ "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)"
3468
3468
  }
3469
3469
  },
3470
3470
  "ADD_AREA_REGION_TRIGGER": {
3471
3471
  "contents": {
3472
3472
  "kind": "markdown",
3473
- "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..."
3473
+ "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..."
3474
3474
  }
3475
3475
  },
3476
3476
  "ADD_CRE_EFFECT": {
3477
3477
  "contents": {
3478
3478
  "kind": "markdown",
3479
- "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."
3479
+ "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."
3480
3480
  }
3481
3481
  },
3482
3482
  "ADD_CRE_ITEM_FLAGS": {
3483
3483
  "contents": {
3484
3484
  "kind": "markdown",
3485
- "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)."
3485
+ "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)."
3486
3486
  }
3487
3487
  },
3488
3488
  "ADD_CRE_SCRIPT": {
3489
3489
  "contents": {
3490
3490
  "kind": "markdown",
3491
- "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."
3491
+ "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."
3492
3492
  }
3493
3493
  },
3494
3494
  "ADD_ITEM_EFFECT": {
3495
3495
  "contents": {
3496
3496
  "kind": "markdown",
3497
- "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."
3497
+ "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."
3498
3498
  }
3499
3499
  },
3500
3500
  "ADD_ITEM_EQEFFECT": {
3501
3501
  "contents": {
3502
3502
  "kind": "markdown",
3503
- "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."
3503
+ "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."
3504
3504
  }
3505
3505
  },
3506
3506
  "ADD_SPELL_CFEFFECT": {
3507
3507
  "contents": {
3508
3508
  "kind": "markdown",
3509
- "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."
3509
+ "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."
3510
3510
  }
3511
3511
  },
3512
3512
  "ADD_SPELL_EFFECT": {
3513
3513
  "contents": {
3514
3514
  "kind": "markdown",
3515
- "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."
3515
+ "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."
3516
3516
  }
3517
3517
  },
3518
3518
  "ADD_STORE_ITEM_EX": {
3519
3519
  "contents": {
3520
3520
  "kind": "markdown",
3521
- "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."
3521
+ "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."
3522
3522
  }
3523
3523
  },
3524
3524
  "ADD_STORE_DRINK": {
3525
3525
  "contents": {
3526
3526
  "kind": "markdown",
3527
- "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."
3527
+ "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."
3528
3528
  }
3529
3529
  },
3530
3530
  "ADD_STORE_CURE": {
3531
3531
  "contents": {
3532
3532
  "kind": "markdown",
3533
- "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."
3533
+ "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."
3534
3534
  }
3535
3535
  },
3536
3536
  "ADD_WORLDMAP_LINKS": {
3537
3537
  "contents": {
3538
3538
  "kind": "markdown",
3539
- "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."
3539
+ "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."
3540
3540
  }
3541
3541
  },
3542
3542
  "ALTER_AREA_ACTOR": {
3543
3543
  "contents": {
3544
3544
  "kind": "markdown",
3545
- "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."
3545
+ "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."
3546
3546
  }
3547
3547
  },
3548
3548
  "ALTER_AREA_CONTAINER": {
3549
3549
  "contents": {
3550
3550
  "kind": "markdown",
3551
- "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."
3551
+ "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."
3552
3552
  }
3553
3553
  },
3554
3554
  "ALTER_AREA_DOOR": {
3555
3555
  "contents": {
3556
3556
  "kind": "markdown",
3557
- "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."
3557
+ "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."
3558
3558
  }
3559
3559
  },
3560
3560
  "ALTER_AREA_ENTRANCE": {
3561
3561
  "contents": {
3562
3562
  "kind": "markdown",
3563
- "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."
3563
+ "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."
3564
3564
  }
3565
3565
  },
3566
3566
  "ALTER_AREA_REGION": {
3567
3567
  "contents": {
3568
3568
  "kind": "markdown",
3569
- "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"
3569
+ "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"
3570
3570
  }
3571
3571
  },
3572
3572
  "ALTER_ITEM_EFFECT": {
3573
3573
  "contents": {
3574
3574
  "kind": "markdown",
3575
- "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."
3575
+ "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."
3576
3576
  }
3577
3577
  },
3578
3578
  "ALTER_ITEM_HEADER": {
3579
3579
  "contents": {
3580
3580
  "kind": "markdown",
3581
- "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"
3581
+ "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"
3582
3582
  }
3583
3583
  },
3584
3584
  "ALTER_SPELL_EFFECT": {
3585
3585
  "contents": {
3586
3586
  "kind": "markdown",
3587
- "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."
3587
+ "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."
3588
3588
  }
3589
3589
  },
3590
3590
  "ALTER_SPELL_HEADER": {
3591
3591
  "contents": {
3592
3592
  "kind": "markdown",
3593
- "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."
3593
+ "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."
3594
3594
  }
3595
3595
  },
3596
3596
  "DELETE_AREA_ITEM": {
3597
3597
  "contents": {
3598
3598
  "kind": "markdown",
3599
- "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."
3599
+ "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."
3600
3600
  }
3601
3601
  },
3602
3602
  "DELETE_CRE_EFFECT": {
3603
3603
  "contents": {
3604
3604
  "kind": "markdown",
3605
- "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."
3605
+ "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."
3606
3606
  }
3607
3607
  },
3608
3608
  "DELETE_CRE_ITEM": {
3609
3609
  "contents": {
3610
3610
  "kind": "markdown",
3611
- "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."
3611
+ "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."
3612
3612
  }
3613
3613
  },
3614
3614
  "DELETE_ITEM_EFFECT": {
3615
3615
  "contents": {
3616
3616
  "kind": "markdown",
3617
- "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."
3617
+ "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."
3618
3618
  }
3619
3619
  },
3620
3620
  "DELETE_ITEM_EQEFFECT": {
3621
3621
  "contents": {
3622
3622
  "kind": "markdown",
3623
- "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."
3623
+ "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."
3624
3624
  }
3625
3625
  },
3626
3626
  "DELETE_ITEM_HEADER": {
3627
3627
  "contents": {
3628
3628
  "kind": "markdown",
3629
- "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)"
3629
+ "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)"
3630
3630
  }
3631
3631
  },
3632
3632
  "DELETE_SPELL_EFFECT": {
3633
3633
  "contents": {
3634
3634
  "kind": "markdown",
3635
- "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."
3635
+ "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."
3636
3636
  }
3637
3637
  },
3638
3638
  "DELETE_SPELL_HEADER": {
3639
3639
  "contents": {
3640
3640
  "kind": "markdown",
3641
- "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)"
3641
+ "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)"
3642
3642
  }
3643
3643
  },
3644
3644
  "DELETE_STORE_ITEM": {
3645
3645
  "contents": {
3646
3646
  "kind": "markdown",
3647
- "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."
3647
+ "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."
3648
3648
  }
3649
3649
  },
3650
3650
  "DELETE_WORLDMAP_LINKS": {
3651
3651
  "contents": {
3652
3652
  "kind": "markdown",
3653
- "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."
3653
+ "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."
3654
3654
  }
3655
3655
  },
3656
3656
  "FJ_CRE_EFF_V2": {
3657
3657
  "contents": {
3658
3658
  "kind": "markdown",
3659
- "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."
3659
+ "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."
3660
3660
  }
3661
3661
  },
3662
3662
  "FJ_CRE_REINDEX": {
3663
3663
  "contents": {
3664
3664
  "kind": "markdown",
3665
- "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."
3665
+ "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."
3666
3666
  }
3667
3667
  },
3668
3668
  "FJ_CRE_VALIDITY": {
3669
3669
  "contents": {
3670
3670
  "kind": "markdown",
3671
- "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"
3671
+ "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"
3672
3672
  }
3673
3673
  },
3674
3674
  "FL#FJ_CRE_REINDEX": {
3675
3675
  "contents": {
3676
3676
  "kind": "markdown",
3677
- "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`."
3677
+ "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`."
3678
3678
  }
3679
3679
  },
3680
3680
  "FL#FJ_CRE_VALIDITY": {
3681
3681
  "contents": {
3682
3682
  "kind": "markdown",
3683
- "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`."
3683
+ "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`."
3684
3684
  }
3685
3685
  },
3686
3686
  "ITEM_EFFECT_TO_SPELL": {
3687
3687
  "contents": {
3688
3688
  "kind": "markdown",
3689
- "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."
3689
+ "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."
3690
3690
  }
3691
3691
  },
3692
3692
  "REMOVE_CRE_ITEM_FLAGS": {
3693
3693
  "contents": {
3694
3694
  "kind": "markdown",
3695
- "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)."
3695
+ "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)."
3696
3696
  }
3697
3697
  },
3698
3698
  "REPLACE_AREA_ITEM": {
3699
3699
  "contents": {
3700
3700
  "kind": "markdown",
3701
- "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)"
3701
+ "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)"
3702
3702
  }
3703
3703
  },
3704
3704
  "REPLACE_STORE_ITEM": {
3705
3705
  "contents": {
3706
3706
  "kind": "markdown",
3707
- "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)"
3707
+ "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)"
3708
3708
  }
3709
3709
  },
3710
3710
  "SET_CRE_ITEM_FLAGS": {
3711
3711
  "contents": {
3712
3712
  "kind": "markdown",
3713
- "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)."
3713
+ "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)."
3714
3714
  }
3715
3715
  },
3716
3716
  "T-CRE_EFF_V1": {
3717
3717
  "contents": {
3718
3718
  "kind": "markdown",
3719
- "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."
3719
+ "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."
3720
3720
  }
3721
3721
  },
3722
3722
  "UPDATE_PVRZ_INDICES": {
3723
3723
  "contents": {
3724
3724
  "kind": "markdown",
3725
- "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."
3725
+ "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."
3726
3726
  }
3727
3727
  },
3728
3728
  "fj_are_structure": {
3729
3729
  "contents": {
3730
3730
  "kind": "markdown",
3731
- "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"
3731
+ "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"
3732
3732
  }
3733
3733
  },
3734
3734
  "DIRECTORY_OF_FILESPEC": {
3735
3735
  "contents": {
3736
3736
  "kind": "markdown",
3737
- "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."
3737
+ "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."
3738
3738
  }
3739
3739
  },
3740
3740
  "EXT_OF_FILESPEC": {
3741
3741
  "contents": {
3742
3742
  "kind": "markdown",
3743
- "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."
3743
+ "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."
3744
3744
  }
3745
3745
  },
3746
3746
  "FILE_OF_FILESPEC": {
3747
3747
  "contents": {
3748
3748
  "kind": "markdown",
3749
- "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."
3749
+ "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."
3750
3750
  }
3751
3751
  },
3752
3752
  "FIND_FREE_PVRZ_INDEX": {
@@ -3758,31 +3758,31 @@
3758
3758
  "GET_UNIQUE_FILE_NAME": {
3759
3759
  "contents": {
3760
3760
  "kind": "markdown",
3761
- "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)."
3761
+ "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)."
3762
3762
  }
3763
3763
  },
3764
3764
  "NAME_NUM_OF_SPELL_RES": {
3765
3765
  "contents": {
3766
3766
  "kind": "markdown",
3767
- "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."
3767
+ "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."
3768
3768
  }
3769
3769
  },
3770
3770
  "RES_NAME_OF_SPELL_NUM": {
3771
3771
  "contents": {
3772
3772
  "kind": "markdown",
3773
- "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."
3773
+ "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."
3774
3774
  }
3775
3775
  },
3776
3776
  "RES_NUM_OF_SPELL_NAME": {
3777
3777
  "contents": {
3778
3778
  "kind": "markdown",
3779
- "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."
3779
+ "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."
3780
3780
  }
3781
3781
  },
3782
3782
  "RES_OF_FILESPEC": {
3783
3783
  "contents": {
3784
3784
  "kind": "markdown",
3785
- "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."
3785
+ "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."
3786
3786
  }
3787
3787
  },
3788
3788
  "SUBSTRING": {
@@ -3794,25 +3794,25 @@
3794
3794
  "READ_SOUNDSET": {
3795
3795
  "contents": {
3796
3796
  "kind": "markdown",
3797
- "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."
3797
+ "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."
3798
3798
  }
3799
3799
  },
3800
3800
  "WRITE_SOUNDSET": {
3801
3801
  "contents": {
3802
3802
  "kind": "markdown",
3803
- "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."
3803
+ "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."
3804
3804
  }
3805
3805
  },
3806
3806
  "tb#fix_file_size": {
3807
3807
  "contents": {
3808
3808
  "kind": "markdown",
3809
- "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."
3809
+ "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."
3810
3810
  }
3811
3811
  },
3812
3812
  "tb#factorial": {
3813
3813
  "contents": {
3814
3814
  "kind": "markdown",
3815
- "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`."
3815
+ "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`."
3816
3816
  }
3817
3817
  }
3818
3818
  }