Compare commits

...
18 Commits
Author SHA1 Message Date
NovaRain 1354ff2ec6 Updated changelog 2024-12-04 09:06:45 +08:00
NovaRain 38eed54c9f Added upper limit to WorldMapDelay2 2024-11-22 12:50:07 +08:00
NovaRain 5230d0aeca Tweaked how XPTable data was loaded
* to align hook functions with the engine functions they replaced.
2024-11-19 21:55:57 +08:00
NovaRain 62f9eb1987 Removed unnecessary selfrun file creation
* autoplay was disabled in 3.8.30 (commit 6c2eb479)

Updated version number.
2024-10-14 10:56:09 +08:00
NovaRain ef791b872a Updated version number and changelog 2024-09-15 12:45:36 +08:00
NovaRain bbf8e84696 Fixed the behavior of game_loaded script function
(always returned 1 when called from normal scripts)

- Revert the changes to ScriptExtender.cpp in commit 9149df1, and use
unordered_set instead of vector for caching script program pointers.
2024-09-10 09:52:21 +08:00
NovaRain b8add3dec5 Fixed issues with picking Tag! or Mutate! perk if there are unused perks
* their windows keep reappearing when picking other perks, can cause
various issues or even crashes.
2024-09-01 12:22:31 +08:00
NovaRain d3ff9d04b4 Fixed object_fix_weapon_ammo_ engine function
(was incorrectly checking Misc "object" type instead of item subtype.)
2024-08-14 14:42:20 +08:00
NovaRain 587ca5bee1 Fixed the return value of using_skill script function
* if the arguments are not the player and SKILL_SNEAK, it returned
garbage values due to the uninitialized variable.
2024-07-31 20:20:28 +08:00
NovaRain 20bf2ce145 Added a tweak to restore the sneak state when switching between maps
(can be overridden with map_enter/exit_p_proc in global scripts)

Minor edit to function notes.
2024-07-31 08:23:03 +08:00
NovaRain 486c897243 Added new HOOK_BUILDSFXWEAPON
* Hook for gsnd_build_weapon_sfx_name
* Fixed long name ACM crash in AutoSearchSFX
* Updated documents
2024-07-19 19:51:04 +08:00
NovaRain 87eca4898a Scripting headers: add material-related constants, minor lib extensions 2024-07-18 08:36:30 +08:00
NovaRain 3515dac146 Prevent unnecessary toggling of the tags in show/hide_iface_tag 2024-07-16 10:54:42 +08:00
NovaRain 73deda86c8 Fixed the skilldex art for the hero appearance mod (#555)
* the info card doesn't refresh properly due to cached FRM.
2024-07-07 18:18:49 +08:00
NovaRain d39535e0a6 Fixed inconsistent behavior of escaped percent sign in sprintf/string_format
Minor code edits to LoadGameHook.cpp.
2024-07-06 22:17:10 +08:00
NovaRain 5c246ba614 Reverted GameReset in LoadGameHook.cpp to pre-3.8.29 behavior
(when the engine's game_reset is called, sfall will reset modules as
well for consistency.)
2024-06-29 17:34:15 +08:00
NovaRain 33943bb6ff Added OutlineColorContainers/Corpses to the built-in item highlighting
Minor code refactor of the built-in item highlighting.
Updated version number.
2024-06-28 22:11:00 +08:00
NovaRain 81f4af927b Synced item highlighting mod with 4.x 2024-06-28 21:14:46 +08:00
34 changed files with 548 additions and 252 deletions
+26 -7
View File
@@ -1,6 +1,25 @@
# Changelog
## v3.8.44
## 3.8.45.1
* Fixed a bug in **XPTable** that caused leveling issues with **Here and Now** perk
* Disabled unnecessary selfrun file creation in the recording mode (autoplay has been disabled in 3.8.30)
## 3.8.45
* Fixed a bug introduced in 3.8.29 that caused `game_loaded` script function to always return 1 when called from normal scripts
* Fixed a bug introduced in 3.8.44 that caused the information card for the **hero appearance mod** not to refresh properly
* Fixed a crash bug in **AutoSearchSFX** when an **ACM** file has a name longer than 12 characters
* Fixed an issue with sfall not resetting data properly after attempting to load a corrupted saved game
* Fixed the inconsistent behavior of the escaped percent sign `%` in `sprintf` and `string_format` script functions
* Fixed `show/hide_iface_tag` script functions to prevent unnecessary toggling of tags
* Fixed `using_skill` script function returning garbage values when the arguments are not the player and Sneak skill
* Added a fix for the engine not checking **'misc'** type items when correcting data for items on maps
* Added a fix to prevent the windows of **Tag!** and **Mutate!** perks from reappearing when there are still unused perks
* Added a tweak to restore the player's sneak state when switching between maps
* Added options to separately set the color of outlines for highlighted containers and corpses
* Updated **item highlighting mod** in the **modders pack** to match the feature set of the 4.x version
* New hook script: `hs_buildsfxweapon`
## 3.8.44
* Fixed a bug in **NPCsTryToSpendExtraAP** that caused NPCs to still be able to move in their combat turn after they killed themselves
* Fixed a bug in **PlayIdleAnimOnReload** that could cause critters to lose highlights after reloading weapons in combat
* Fixed a crash bug in `interface_art_draw` script function when drawing beyond window bounds
@@ -154,7 +173,7 @@
* Added missing sounds for the markers on the world map interface (similar to Fallout 1, from Ghosthack)
## 3.8.34
* Minor fixes to **LocalMapXLimit/LocalMapYLimit** options and the built-in **item highlighting mod**
* Minor fixes to **LocalMapXLimit/LocalMapYLimit** options and the built-in **item highlighting**
* Removed **FadeBackgroundMusic** option because the fix in 3.8.33 doesn't work reliably in all cases
* Added a fix for being unable to plant items on non-biped critters with the **'Barter'** flag set (e.g. Skynet and Goris)
* Updated the ammo ini loader mod in the **modders pack**
@@ -219,7 +238,7 @@
* Added a config file to change some engine parameters for the game mechanics
* Added the ability to continuously play the music when moving to another map that uses the same music
* Added the ability to set custom names for unarmed attacks in the inventory to **TranslationsINI**
* Added support for using the newline control character `'\n'` in the object description in `pro_*.msg` files
* Added support for using the newline control character `\n` in the object description in `pro_*.msg` files
* Added support for the new **'Healing Item'** flag to item protos. Now AI will also use items with this flag for healing in combat
* Added support for the new **'Cannot Use'** flag to the misc flags of item objects. This flag makes a weapon object unusable in combat
* Added missing sounds for the buttons on the world map interface (similar to Fallout 1 behavior)
@@ -275,7 +294,7 @@
* Added a tweak to remove the unspent skill points limit
* Added an option to disable the special handling of city areas 45 and 46 in the engine when visiting Area 45
* Added an option to load alternative dialog msg and subtitle files for female PC (translation friendly)
* Added an option to allow using the caret character `'^'` in dialog msg files to specify alternative text in dialogue based on the player's gender
* Added an option to allow using the caret character `^` in dialog msg files to specify alternative text in dialogue based on the player's gender
* Added a new value to **AIDrugUsePerfFix** to allow NPCs to use only the drugs listed in `chem_primary_desire` and healing drugs
* Added support for loading premade character **GCD/BIO** files from the `premade\<language>\` directory for non-English languages
* Added support for loading fonts from the `fonts\<language>\` directory for non-English languages
@@ -451,7 +470,7 @@
* Fixed the timing of setting `WORLDMAP`, `DIALOG`, `PIPBOY`, `INVENTORY`, `INTFACEUSE`, and `INTFACELOOT` game mode flags
* Fixed the execution of the timer event in global scripts
* Fixed the palette and the movie playback in **DX9** mode
* Improved the functionality of `create_message_window` script function to support the newline control character `'\n'`
* Improved the functionality of `create_message_window` script function to support the newline control character `\n`
* Removed **TownMapHotkeysFix** and **DisplaySecondWeaponRange** from `ddraw.ini` because there is little reason to turn them off
* Added a fix for duplicate critters being added to the list of potential targets for AI
* Added a fix for the playback of the speech sound file for the death screen being ended abruptly in some cases
@@ -475,7 +494,7 @@
* Changed the debug message about a missing critter art file to also be displayed in the game
* Code refactoring for various script functions
* Added a fix to prevent the player from moving when clicking on a script-created window and prevent the mouse cursor from being toggled when hovering over a **'hidden'** window
* Added a fix to prevent crashes when **DebugMode** is enabled and there is a `'%'` character in the printed message
* Added a fix to prevent crashes when **DebugMode** is enabled and there is a `%` character in the printed message
* Added an option to load a global shader file at game startup and added an example global shader file to the **modders pack**
* Added an option to highlight lootable corpses as well as items
* Added support for executing the `timed_event_p_proc` procedure in global scripts
@@ -932,4 +951,4 @@ Original engine bug fixes and various features based on the work by Crafty:
* Added an option to allow 9 options (lines of text) to be displayed correctly in the dialog window
* Added an option to display additional points of damage from **Bonus HtH/Ranged Damage** perks in the inventory
__For changelogs prior to 3.7, please read the `sfall-readme.txt` in the [release files](https://github.com/sfall-team/sfall/releases).__
__For changelogs prior to version 3.7, please refer to the `sfall-readme.txt` in the [release files](https://github.com/sfall-team/sfall/releases).__
+7 -8
View File
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -664,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+9 -3
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v3.8.44
;v3.8.45.1
[Main]
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
@@ -223,7 +223,7 @@ HighlightContainers=0
;Set to 1 to also highlight lootable corpses
HighlightCorpses=0
;Set the color of outlines, available colors:
;Set the color of outlines for items, available colors:
;1 - glowing red
;2 - red
;4 - grey
@@ -234,6 +234,12 @@ HighlightCorpses=0
;You can set a custom color from the game palette by multiplying the color index value by 256 (in 3.8.27 or later)
OutlineColor=16
;Set the color of outlines for containers
OutlineColorContainers=4
;Set the color of outlines for corpses
OutlineColorCorpses=4
;A key to press to reload your currently equipped weapon or use the active item
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
ReloadWeaponKey=0
@@ -280,7 +286,7 @@ WorldMapTimeMod=100
WorldMapFPSPatch=1
;Controls the world map speed if WorldMapFPSPatch is 1. Higher values cause slower movement
;Default is 66 milliseconds
;Default is 66 milliseconds, and the maximum is 150
WorldMapDelay2=66
;Set to 1 to enable Ray's patch to make world map encounter rate independent of your travel speed
@@ -17,7 +17,7 @@
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
version 1.2
version 1.3
**/
@@ -38,6 +38,8 @@ variable alsoCorpse;
variable alsoCritter;
variable checkLOS;
variable outlineColor;
variable outlineColorContainers;
variable outlineColorCorpses;
variable motionScanner;
variable highlightFailMsg1;
variable highlightFailMsg2;
@@ -67,6 +69,12 @@ procedure GetOutlineColor(variable obj, variable isCritter) begin
if checkLOS and not DudeCanSee(obj) then
return 0;
if obj_type(obj) == OBJ_TYPE_CRITTER then
return outlineColorCorpses;
if obj_item_subtype(obj) == item_type_container then
return outlineColorContainers;
return outlineColor;
end
@@ -168,6 +176,10 @@ procedure start begin
checkLOS := GetConfig(configSection, "CheckLOS", 0);
outlineColor := GetConfig(configSection, "OutlineColor", 16);
if (outlineColor < 1) then outlineColor := 64;
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 16);
if (outlineColorContainers < 1) then outlineColorContainers := 64;
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 16);
if (outlineColorCorpses < 1) then outlineColorCorpses := 64;
motionScanner := GetConfig(configSection, "MotionScanner", 0);
highlightFailMsg1 := Translate("HighlightFail1", "You aren't carrying a motion sensor.");
@@ -15,7 +15,7 @@ Critters=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=1
; Set the color of outlines for items, corpses, and containers; available colors:
; Set the color of outlines for items; available colors:
; 1 - glowing red
; 2 - red
; 4 - grey
@@ -26,6 +26,12 @@ CheckLOS=1
; You can set a custom color from the game palette by multiplying the color index value by 256 (in 3.8.27 or later)
OutlineColor=16
; Set the color of outlines for containers
OutlineColorContainers=4
; Set the color of outlines for corpses
OutlineColorCorpses=4
; Motion Scanner mode:
; 0 - ignored
; 1 - requires Motion Sensor to be present in the player's inventory to activate highlighting
@@ -306,6 +306,22 @@
#define PROTO_CR_AI_PACKET (408)
#define PROTO_CR_TEAM_NUM (412)
// scenery
#define PROTO_SC_MATERIAL (44)
// walls
#define PROTO_WL_MATERIAL (32)
// material types
#define MATERIAL_TYPE_GLASS (0)
#define MATERIAL_TYPE_METAL (1)
#define MATERIAL_TYPE_PLASTIC (2)
#define MATERIAL_TYPE_WOOD (3)
#define MATERIAL_TYPE_DIRT (4)
#define MATERIAL_TYPE_STONE (5)
#define MATERIAL_TYPE_CEMENT (6)
#define MATERIAL_TYPE_LEATHER (7)
// weapon calibers
#define CALIBER_NONE (0)
#define CALIBER_ROCKET (1)
+12 -4
View File
@@ -554,14 +554,14 @@ procedure array_transform_kv(variable arr, variable keyFunc, variable valueFunc)
end
/**
* Converts given array into a new map where keys are array values and all values are 1.
* Converts given array into a new map where keys are array values and all values are set to specified value.
* @arg {array} arr
* @ret {array}
*/
procedure array_to_set(variable arr) begin
procedure array_to_set(variable arr, variable value := 1) begin
variable v, retArr := temp_array_map;
foreach (v in arr) begin
retArr[v] := 1;
retArr[v] := value;
end
return retArr;
end
@@ -641,7 +641,7 @@ procedure array_fill(variable arr, variable pos, variable count, variable value)
end
/**
* Adds all the values of the second array to the first array.
* Adds all the values of the second array to the first array. If arr1 is a map then for values with same keys, values from arr2 will take priority.
* @arg {array} arr1
* @arg {array} arr2
* @ret {array} - the first array after modification
@@ -661,6 +661,14 @@ procedure array_append(variable arr1, variable arr2) begin
return arr1;
end
/**
* Creates a new temp array with all values from arr1 and arr2. If arr1 is a map then for values with same keys, values from arr2 will take priority.
* @arg {array} arr1
* @arg {array} arr2
* @ret {array} - the created temp array
*/
#define array_concat(arr1, arr2) array_append(clone_array(arr1), arr2)
/**
* Loads a "saved" array. If it doesn't exist, creates it (with a given size).
* @arg {string} name - saved array name/key
+20 -52
View File
@@ -65,6 +65,21 @@ procedure unwield_armor(variable critter) begin
end
end
/**
* Makes critter put away given item if it's in armor or any item/weapon slot.
* @arg {ObjectPtr} critter
* @arg {ObjectPtr} item
*/
procedure inven_unwield_item(variable critter, variable item) begin
if (obj_type(critter) != OBJ_TYPE_CRITTER) then return;
if (critter_inven_obj(critter, INVEN_TYPE_WORN) == item) then begin
call unwield_armor(critter);
end else if ((critter_inven_obj(critter, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(critter, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(critter);
end
end
/**
* Removes items of given pid from given object's inventory. Returns number of actually removed items.
* @arg {ObjectPtr} invenObj - obj to remove items from
@@ -86,13 +101,7 @@ procedure remove_items_pid(variable invenObj, variable itemPid, variable quantit
toRemoveQty := quantity;
while (quantity > 0) do begin
item := obj_carrying_pid_obj(invenObj, itemPid);
if (obj_type(invenObj) == OBJ_TYPE_CRITTER) then begin
if (critter_inven_obj(invenObj, INVEN_TYPE_WORN) == item) then begin
call unwield_armor(invenObj);
end else if ((critter_inven_obj(invenObj, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(invenObj, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(invenObj);
end
end
call inven_unwield_item(invenObj, item);
quantity -= rm_mult_objs_from_inven(invenObj, item, quantity);
destroy_object(item);
end
@@ -100,19 +109,14 @@ procedure remove_items_pid(variable invenObj, variable itemPid, variable quantit
end
/**
* Remove the whole stack of a given *item* object from *invenObj* inventory.
* Remove one item from a given *item* stack object from *invenObj* inventory.
* For a critter, this will correctly remove item from armor/hand slot, if it is equipped.
* Note that *item* pointer will be invalid after this.
* @arg {ObjectPtr} invenObj - obj to remove from
* @arg {ObjectPtr} item - item (stack) object to remove
*/
procedure remove_item_obj(variable invenObj, variable item) begin
if (obj_type(invenObj) == OBJ_TYPE_CRITTER) then begin
if (critter_inven_obj(invenObj,INVEN_TYPE_WORN) == item) then begin
call unwield_armor(invenObj);
end else if ((critter_inven_obj(invenObj, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(invenObj, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(invenObj);
end
end
call inven_unwield_item(invenObj, item);
rm_obj_from_inven(invenObj, item);
destroy_object(item);
end
@@ -136,7 +140,7 @@ end
/**
* Ensures a given *quantity* of *itemPid* in *invenObj* inventory, adding or removing items as necessary.
* @arg {ObjectPtr} invenObj - obj to add/remove items to/from
* @arg {int} itemPid - PID of item to remove
* @arg {int} itemPid - PID of item to add/remove
* @arg {int} quantity
*/
procedure set_items_qty_pid(variable invenObj, variable itemPid, variable quantity)
@@ -154,42 +158,6 @@ begin
end
end
/**
* Removes money and items from a *critter*'s inventory, using provided probabilities (applied to whole stacks, not individual items).
* Useful for reducing loot of merchants after death.
* @arg {ObjectPtr} critter
* @arg {int} moneyPercent - Percent of money to remove.
* @arg {int} probArmor - % probability to remove armor.
* @arg {int} probDrugs - % probability to remove drugs.
* @arg {int} probWeapons - % probability to remove weapons.
* @arg {int} probAmmo - % probability to remove ammo.
* @arg {int} probMisc - % probability to remove misc item.
*/
procedure reduce_merchant_loot(variable critter, variable moneyPercent, variable probArmor, variable probDrugs, variable probWeapons, variable probAmmo, variable probMisc) begin
variable inv, item, it, prob, tmp;
inv := inven_as_array(critter);
item_caps_adjust(critter, -(item_caps_total(critter) * moneyPercent / 100));
//display_msg("total items "+len_array(inv));
foreach item in inv begin
if (obj_pid(item) != PID_BOTTLE_CAPS) then begin
it := obj_item_subtype(item);
if (it == item_type_armor) then
prob := probArmor;
else if (it == item_type_drug) then
prob := probDrugs;
else if (it == item_type_weapon) then
prob := probWeapons;
else if (it == item_type_ammo) then
prob := probAmmo;
else
prob := probMisc;
if (random(0, 99) < prob) then begin
//display_msg("remove "+obj_name(item));
call remove_all_items_pid(critter, obj_pid(item));
end
end
end
end
/**
* Returns item in one of *critter*'s hand slots using given attack type.
+2
View File
@@ -76,6 +76,8 @@
#define HOOK_ROLLCHECK (46)
#define HOOK_BESTWEAPON (47)
#define HOOK_CANUSEWEAPON (48)
// RESERVED 49..60
#define HOOK_BUILDSFXWEAPON (61)
// Valid arguments to list_begin
#define LIST_CRITTERS (0)
+20
View File
@@ -878,3 +878,23 @@ int arg3 - original result of engine function: 1 - can use, 0 - cannot use
int ret0 - overrides the result of engine function. Any non-zero value allows using the weapon
```
-------------------------------------------
#### `HOOK_BUILDSFXWEAPON (hs_buildsfxweapon.int)`
Runs before each weapon sound effect is played or added to the animation queue to determine the name of the sound effect file based on the weapon, target, and action being performed.
```
int arg0 - weapon sound effect type:
0 - ready/reload
1 - attack
2 - out of ammo
3 - flying (for projectiles from weapons)
4 - hit
Item arg1 - the weapon being used
int arg2 - attack type (see ATKTYPE_* constants)
Obj arg3 - the target of the attack (can be 0)
String ret0 - the filename of the new sound effect to use, without extension (relative to the sound\sfx\ directory)
```
+1 -1
View File
@@ -450,7 +450,7 @@ FUNCTION REFERENCE
-----
##### `array party_member_list(int includeHidden)`
- Returns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)
- Returns an array of all current party members (0 - only critters that are alive and visible will be returned, 1 - all objects, including the car trunk, etc.)
-----
##### `array path_find_to(object objFrom, int tileTo, int blockingType)`
+46 -28
View File
@@ -1,5 +1,6 @@
// X-Macro for function offsets
FUNC(Add4thTagSkill_, 0x43D6F8)
FUNC(AddHotLines_, 0x4998C0)
FUNC(Check4Keys_, 0x43F73C)
FUNC(Create_AudioDecoder_, 0x4D50A8)
@@ -20,6 +21,7 @@ FUNC(GNW_button_refresh_, 0x4D9A58)
FUNC(GNW_do_bk_process_, 0x4C8D1C)
FUNC(GNW_find_, 0x4D7888)
FUNC(GNW_win_refresh_, 0x4D6FD8)
FUNC(GetMutateTrait_, 0x43D38C)
FUNC(GetSlotList_, 0x47E5D0)
FUNC(ListDPerks_, 0x43D0BC)
FUNC(ListDrvdStats_, 0x43527C)
@@ -130,7 +132,7 @@ FUNC(config_get_value_, 0x42C05C)
FUNC(config_set_value_, 0x42C160)
FUNC(construct_box_bar_win_, 0x461134)
FUNC(container_exit_, 0x476394)
FUNC(correctFidForRemovedItem_, 0x45409C) // (int critter@<eax>, int oldArmor@<edx>, int removeSlotsFlags@<ebx>)
FUNC(correctFidForRemovedItem_, 0x45409C)
FUNC(createWindow_, 0x4B7F3C)
FUNC(credits_, 0x42C860)
FUNC(credits_get_next_line_, 0x42CE6C)
@@ -230,8 +232,8 @@ FUNC(elapsed_tocks_, 0x4C9400)
FUNC(elevator_end_, 0x43F6D0)
FUNC(elevator_start_, 0x43F324)
FUNC(endgame_slideshow_, 0x43F788)
FUNC(exec_script_proc_, 0x4A4810) // unsigned int aScriptID<eax>, int aProcId<edx>
FUNC(executeProcedure_, 0x46DD2C) // <eax> - programPtr, <edx> - procNumber
FUNC(exec_script_proc_, 0x4A4810)
FUNC(executeProcedure_, 0x46DD2C)
FUNC(exit_inventory_, 0x46FBD8)
FUNC(fadeSystemPalette_, 0x4C7320)
FUNC(findCurrentProc_, 0x467160)
@@ -366,8 +368,8 @@ FUNC(inc_stat_, 0x4AF5D4)
FUNC(insert_withdrawal_, 0x47A290)
FUNC(interpretAddString_, 0x467A80) // edx = ptr to string, eax = script
FUNC(interpretError_, 0x4671F0)
FUNC(interpretFindProcedure_, 0x46DCD0) // get proc number (different for each script) by name: *<eax> - scriptPtr, char* <edx> - proc name
FUNC(interpretFreeProgram_, 0x467614) // <eax> - program ptr, frees it from memory and from scripting engine
FUNC(interpretFindProcedure_, 0x46DCD0)
FUNC(interpretFreeProgram_, 0x467614)
FUNC(interpretGetString_, 0x4678E0) // eax = script ptr, edx = var type, ebx = var
FUNC(interpretPopLong_, 0x467500)
FUNC(interpretPopShort_, 0x4674F0)
@@ -391,8 +393,8 @@ FUNC(intface_update_hit_points_, 0x45EBD8)
FUNC(intface_update_items_, 0x45EFEC)
FUNC(intface_update_move_points_, 0x45EE0C)
FUNC(intface_use_item_, 0x45F5EC)
FUNC(invenUnwieldFunc_, 0x472A64) // (int critter@<eax>, int slot@<edx>, int a3@<ebx>) - int result (-1 on error, 0 on success)
FUNC(invenWieldFunc_, 0x472768) // (int who@<eax>, int item@<edx>, int a3@<ecx>, int slot@<ebx>) - int result (-1 on error, 0 on success)
FUNC(invenUnwieldFunc_, 0x472A64)
FUNC(invenWieldFunc_, 0x472768)
FUNC(inven_display_msg_, 0x472D24)
FUNC(inven_find_id_, 0x4726EC)
FUNC(inven_find_type_, 0x472698)
@@ -403,7 +405,8 @@ FUNC(inven_set_mouse_, 0x470BCC)
FUNC(inven_unwield_, 0x472A54)
FUNC(inven_wield_, 0x472758)
FUNC(inven_worn_, 0x471C08)
FUNC(isPartyMember_, 0x494FC4) // (<eax> - object) - bool result
FUNC(isPartyMember_, 0x494FC4)
FUNC(is_pc_flag_, 0x42E2F8)
FUNC(is_pc_sneak_working_, 0x42E3F4)
FUNC(is_within_perception_, 0x42BA04)
FUNC(item_a_ac_adjust_, 0x479A74)
@@ -442,7 +445,7 @@ FUNC(item_total_weight_, 0x477E98)
FUNC(item_w_anim_code_, 0x478DA8)
FUNC(item_w_anim_weap_, 0x47860C)
FUNC(item_w_can_reload_, 0x478874)
FUNC(item_w_compute_ammo_cost_, 0x4790AC) // signed int aWeapon<eax>, int *aRoundsSpent<edx>
FUNC(item_w_compute_ammo_cost_, 0x4790AC)
FUNC(item_w_curr_ammo_, 0x4786A0)
FUNC(item_w_dam_div_, 0x479294)
FUNC(item_w_dam_mult_, 0x479230)
@@ -463,10 +466,10 @@ FUNC(item_w_unload_, 0x478F80)
FUNC(item_weight_, 0x477B88)
FUNC(kb_clear_, 0x4CBDA8)
FUNC(light_get_ambient_, 0x47A8F8)
FUNC(light_get_tile_, 0x47A980) // aElev<eax>, aTilenum<edx>
FUNC(light_get_tile_, 0x47A980)
FUNC(loadColorTable_, 0x4C78E4)
FUNC(loadPCX_, 0x496494)
FUNC(loadProgram_, 0x4A3B74) // loads script from scripts/ folder by file name and returns pointer to it: char* <eax> - file name (w/o extension)
FUNC(loadProgram_, 0x4A3B74)
FUNC(load_frame_, 0x419EC0)
FUNC(load_frame_into_, 0x419FC0)
FUNC(loot_container_, 0x473904)
@@ -477,12 +480,9 @@ FUNC(main_menu_create_, 0x481650)
FUNC(main_menu_hide_, 0x481A00)
FUNC(main_menu_is_shown_, 0x481A8C)
FUNC(main_menu_loop_, 0x481AEC)
// (int aObjFrom<eax>, int aTileFrom<edx>, char* aPathPtr<ecx>, int aTileTo<ebx>, int a5, int (__fastcall *a6)(_DWORD, _DWORD))
// - path is saved in ecx as a sequence of tile directions (0..5) to move on each step,
// - returns path length
FUNC(make_path_func_, 0x415EFC)
FUNC(make_straight_path_, 0x4163AC)
FUNC(make_straight_path_func_, 0x4163C8) // (GameObject *aObj<eax>, int aTileFrom<edx>, int a3<ecx>, signed int aTileTo<ebx>, GameObject **aObjResult, int a5, int (*a6)(void))
FUNC(make_straight_path_func_, 0x4163C8)
FUNC(map_disable_bk_processes_, 0x482104)
FUNC(map_enable_bk_processes_, 0x4820C0)
FUNC(map_exit_, 0x482084)
@@ -523,7 +523,7 @@ FUNC(nmalloc_, 0x4EF1C5)
FUNC(nrealloc_, 0x4F1669)
FUNC(objPMAttemptPlacement_, 0x49D628)
FUNC(obj_ai_blocking_at_, 0x48BA20)
FUNC(obj_blocking_at_, 0x48B848) // <eax>(int aExcludeObject<eax> /* can be 0 */, signed int aTile<edx>, int aElevation<ebx>)
FUNC(obj_blocking_at_, 0x48B848) // (EAX *obj, EDX hexNum, EBX level)
FUNC(obj_bound_, 0x48B66C)
FUNC(obj_change_fid_, 0x48AA3C)
FUNC(obj_connect_, 0x489EC4)
@@ -535,7 +535,7 @@ FUNC(obj_erase_object_, 0x48B0FC)
FUNC(obj_examine_, 0x49AD78)
FUNC(obj_find_first_, 0x48B3A8)
FUNC(obj_find_first_at_, 0x48B48C)
FUNC(obj_find_first_at_tile_, 0x48B5A8) // <eax>(int elevation<eax>, int tile<edx>)
FUNC(obj_find_first_at_tile_, 0x48B5A8)
FUNC(obj_find_next_, 0x48B41C)
FUNC(obj_find_next_at_, 0x48B510)
FUNC(obj_find_next_at_tile_, 0x48B608)
@@ -613,7 +613,7 @@ FUNC(proto_get_msg_info_, 0x49EAA4)
FUNC(proto_list_str_, 0x49E758)
FUNC(proto_make_path_, 0x49E270)
FUNC(proto_name_, 0x49EAFC)
FUNC(proto_ptr_, 0x4A2108) // eax - PID, edx - int** - pointer to a pointer to a proto struct
FUNC(proto_ptr_, 0x4A2108)
FUNC(pushLongStack_, 0x46736C)
FUNC(qsort_, 0x4F05B6)
FUNC(queue_add_, 0x4A258C)
@@ -672,19 +672,19 @@ FUNC(reset_box_bar_win_, 0x4614A0)
FUNC(roll_check_, 0x4A3000)
FUNC(roll_check_critical_, 0x4A3030)
FUNC(roll_random_, 0x4A30C0)
FUNC(runProgram_, 0x46E154) // eax - programPtr, called once for each program after first loaded - hooks program to game and UI events
FUNC(runProgram_, 0x46E154)
FUNC(scr_build_lookup_table_, 0x4A49D0)
FUNC(scr_clear_dude_script_, 0x4A5044)
FUNC(scr_exec_map_enter_scripts_, 0x4A67DC)
FUNC(scr_exec_map_exit_scripts_, 0x4A69A0)
FUNC(scr_exec_map_update_scripts_, 0x4A67E4)
FUNC(scr_find_first_at_, 0x4A6524) // eax - elevation, returns spatial scriptID
FUNC(scr_find_next_at_, 0x4A6564) // no args, returns spatial scriptID
FUNC(scr_find_obj_from_program_, 0x4A39AC) // eax - *program - finds self_obj by program pointer (has nice additional effect - creates fake object for a spatial script)
FUNC(scr_find_first_at_, 0x4A6524)
FUNC(scr_find_next_at_, 0x4A6564)
FUNC(scr_find_obj_from_program_, 0x4A39AC)
FUNC(scr_find_sid_from_program_, 0x4A390C)
FUNC(scr_get_local_var_, 0x4A6D64)
FUNC(scr_new_, 0x4A5F28) // eax - script index from scripts lst, edx - type (0 - system, 1 - spatials, 2 - time, 3 - items, 4 - critters)
FUNC(scr_ptr_, 0x4A5E34) // eax - scriptId, edx - **ScriptInstance (where to store script pointer)
FUNC(scr_new_, 0x4A5F28)
FUNC(scr_ptr_, 0x4A5E34)
FUNC(scr_remove_, 0x4A61D4)
FUNC(scr_set_ext_param_, 0x4A3B34)
FUNC(scr_set_local_var_, 0x4A6E58)
@@ -696,12 +696,12 @@ FUNC(set_game_time_, 0x4A347C)
FUNC(setup_move_timer_win_, 0x476AB8)
FUNC(skill_check_stealing_, 0x4ABBE4)
FUNC(skill_dec_point_, 0x4AA8C4)
FUNC(skill_get_tags_, 0x4AA508) // eax - pointer to array DWORD, edx - number of elements to read
FUNC(skill_get_tags_, 0x4AA508)
FUNC(skill_inc_point_, 0x4AA6BC)
FUNC(skill_is_tagged_, 0x4AA52C)
FUNC(skill_level_, 0x4AA558)
FUNC(skill_points_, 0x4AA680)
FUNC(skill_set_tags_, 0x4AA4E4) // eax - pointer to array DWORD, edx - number of elements to write
FUNC(skill_set_tags_, 0x4AA4E4)
FUNC(skill_use_, 0x4AAD08)
FUNC(skilldex_select_, 0x4ABFD0)
FUNC(soundDelete_, 0x4AD8DC)
@@ -713,14 +713,32 @@ FUNC(soundSetFileIO_, 0x4AE2FC)
FUNC(soundVolume_, 0x4ADE0C)
FUNC(sprintf_, 0x4F0041)
FUNC(square_num_, 0x4B1F04)
FUNC(statPCAddExperienceCheckPMs_, 0x4AFAB8)
FUNC(statPcMinExpForLevel_, 0x4AF9A8)
FUNC(statPcResetExperience_, 0x4AFC38)
FUNC(stat_description_, 0x4AF898)
FUNC(stat_exit_, 0x4AEEE4)
FUNC(stat_get_base_, 0x4AF3E0)
FUNC(stat_get_base_direct_, 0x4AF408)
FUNC(stat_get_bonus_, 0x4AF474)
FUNC(stat_init_, 0x4AED70)
FUNC(stat_level_, 0x4AEF48) // &GetCurrentStat(void* critter, int statID)
FUNC(stat_level_description_, 0x4AF8DC)
FUNC(stat_load_, 0x4AEEF4)
FUNC(stat_name_, 0x4AF854)
FUNC(stat_pc_add_experience_, 0x4AFAA8)
FUNC(stat_pc_description_, 0x4AFA14)
FUNC(stat_pc_get_, 0x4AF8FC)
FUNC(stat_pc_min_exp_, 0x4AF9A0)
FUNC(stat_pc_name_, 0x4AF9F4)
FUNC(stat_pc_set_, 0x4AF910)
FUNC(stat_pc_set_defaults_, 0x4AF980)
FUNC(stat_picture_, 0x4AFA34)
FUNC(stat_recalc_derived_, 0x4AF6FC)
FUNC(stat_reset_, 0x4AEEC0)
FUNC(stat_result_, 0x4AFA78)
FUNC(stat_save_, 0x4AEF20)
FUNC(stat_set_base_, 0x4AF4BC)
FUNC(stat_set_bonus_, 0x4AF63C)
FUNC(stat_set_defaults_, 0x4AF6CC)
FUNC(strParseStrFromList_, 0x4AFE08)
@@ -733,7 +751,7 @@ FUNC(text_curr_, 0x4D58D4)
FUNC(text_font_, 0x4D58DC)
FUNC(text_font_exists_, 0x4D595C)
FUNC(text_object_create_, 0x4B036C)
FUNC(tile_coord_, 0x4B1674) // eax - tilenum, edx (int*) - x, ebx (int*) - y
FUNC(tile_coord_, 0x4B1674)
FUNC(tile_dir_, 0x4B1ABC)
FUNC(tile_dist_, 0x4B185C)
FUNC(tile_idistance_, 0x416360) // EST
@@ -742,7 +760,7 @@ FUNC(tile_num_beyond_, 0x4B1B84)
FUNC(tile_num_in_direction_, 0x4B1A6C)
FUNC(tile_on_edge_, 0x4B1D20)
FUNC(tile_refresh_display_, 0x4B12D8)
FUNC(tile_refresh_rect_, 0x4B12C0) // (int elevation<edx>, unkown<ecx>)
FUNC(tile_refresh_rect_, 0x4B12C0)
FUNC(tile_scroll_to_, 0x4B3924)
FUNC(tile_set_center_, 0x4B12F8)
FUNC(trait_adjust_skill_, 0x4B40FC)
+3
View File
@@ -133,6 +133,7 @@ WRAP_WATCOM_FUNC1(fo::GameObject*, inven_right_hand, fo::GameObject*, critter) /
WRAP_WATCOM_FUNC2(fo::GameObject*, inven_pid_is_carried_ptr, fo::GameObject*, invenObj, long, pid)
WRAP_WATCOM_FUNC2(long, inven_unwield, fo::GameObject*, critter, long, slot)
WRAP_WATCOM_FUNC1(fo::GameObject*, inven_worn, fo::GameObject*, critter) // Critter worn item (armor)
WRAP_WATCOM_FUNC1(long, is_pc_flag, long, flag)
WRAP_WATCOM_FUNC0(long, is_pc_sneak_working)
WRAP_WATCOM_FUNC2(long, is_within_perception, fo::GameObject*, source, fo::GameObject*, target)
WRAP_WATCOM_FUNC1(long, isPartyMember, fo::GameObject*, obj)
@@ -187,6 +188,8 @@ WRAP_WATCOM_FUNC1(long, obj_lock_is_jammed, fo::GameObject*, object) // Checks/u
WRAP_WATCOM_FUNC1(void, obj_unjam_lock, fo::GameObject*, object)
WRAP_WATCOM_FUNC0(void, object_anim_compact)
WRAP_WATCOM_FUNC1(long, partyMemberGetCurLevel, fo::GameObject*, obj)
WRAP_WATCOM_FUNC1(void, pc_flag_off, long, flag)
WRAP_WATCOM_FUNC1(void, pc_flag_on, long, flag)
WRAP_WATCOM_FUNC2(void, perk_add_effect, fo::GameObject*, critter, long, perkId)
WRAP_WATCOM_FUNC2(long, perk_can_add, fo::GameObject*, critter, long, perkId)
WRAP_WATCOM_FUNC2(long, perk_level, fo::GameObject*, critter, long, perkId)
+2
View File
@@ -428,6 +428,8 @@ struct FrmFrameHeader { // sizeof 12 byte
// structures for holding frms loaded with fallout2 functions
struct FrmFrameData : FrmFrameHeader { // sizeof 12 + 1 byte
BYTE data[1]; // begin frame image data
BYTE* dataPtr() const { return (BYTE*)data; }
};
// for one frame
+2 -2
View File
@@ -357,13 +357,13 @@ bool BarBoxes::GetBox(int i) {
}
void BarBoxes::AddBox(int i) {
if (i < 5 || i > BarBoxes::MaxBox()) return;
if (i < 5 || i > BarBoxes::MaxBox() || boxText[i - 5].isActive) return;
boxText[i - 5].isActive = true;
__asm call fo::funcoffs::refresh_box_bar_win_;
}
void BarBoxes::RemoveBox(int i) {
if (i < 5 || i > BarBoxes::MaxBox()) return;
if (i < 5 || i > BarBoxes::MaxBox() || !boxText[i - 5].isActive) return;
boxText[i - 5].isActive = false;
__asm call fo::funcoffs::refresh_box_bar_win_;
}
+65 -1
View File
@@ -3424,6 +3424,58 @@ static __declspec(naked) void gmouse_handle_event_hook_use_inv() {
}
}
static __declspec(naked) void op_using_skill_hack() {
static const DWORD op_using_skill_Ret = 0x4546C4;
__asm {
mov dword ptr [esp + 0x28 - 0x1C + 4], 0; // initialize the value
cmp dword ptr [esp + 0x28 - 0x28 + 4], SKILL_SNEAK; // overwritten engine code
jne skip;
retn;
skip:
add esp, 4;
jmp op_using_skill_Ret;
}
}
static bool pickedTag = false;
static bool pickedMutate = false;
static __declspec(naked) void perks_dialog_hook_tag() {
static const DWORD perks_dialog_tag_Ret = 0x43C9C5;
__asm {
cmp pickedTag, 0;
jne skip;
call fo::funcoffs::Add4thTagSkill_;
mov pickedTag, al;
retn;
skip:
add esp, 4;
jmp perks_dialog_tag_Ret;
}
}
static __declspec(naked) void perks_dialog_hook_mutate() {
static const DWORD perks_dialog_mutate_Ret = 0x43CA04;
__asm {
cmp pickedMutate, 0;
jne skip;
call fo::funcoffs::GetMutateTrait_;
mov pickedMutate, al;
retn;
skip:
add esp, 4;
jmp perks_dialog_mutate_Ret;
}
}
static __declspec(naked) void editor_design_hook() {
__asm { // eax = 0
mov pickedTag, al;
mov pickedMutate, al;
jmp fo::funcoffs::intface_update_hit_points_;
}
}
// Missing game initialization
void BugFixes::OnBeforeGameInit() {
Initialization();
@@ -4243,7 +4295,7 @@ void BugFixes::init() {
SafeWrite8(0x440C8E, 7); // jnz 0x440C96
// Fix for gaining two levels at once when leveling up from level 97
SafeWrite8(0x4AF9AF, 0x7F); // jge > jg (stat_pc_min_exp_)
SafeWrite8(0x4AF9AF, 0x7F); // jge > jg (statPcMinExpForLevel_)
// Fix to prevent integer overflow for the number of items in a stack in the inventory
// If the number of items in a stack is less than 1, it is considered an integer overflow
@@ -4268,6 +4320,18 @@ void BugFixes::init() {
// Fix for clickability issue of the "Use Inventory Item On" action when the selected item overlaps an object
MakeCall(0x44BFB9, gmouse_handle_event_hack_use_inv, 2);
HookCall(0x44C6FB, gmouse_handle_event_hook_use_inv);
// Fix for using_skill function returning garbage values when the arguments are not the player and SKILL_SNEAK
MakeCall(0x4546A5, op_using_skill_hack, 1);
// Fix for object_fix_weapon_ammo_ engine function not checking "misc" type items
SafeWrite8(0x48916B, 0x41); // jnz 0x4891AD
SafeWrite8(0x4891C8, CodeType::JumpShort); // jmp 0x4891E9 (skip proto data correction)
// Fix to prevent the windows of Tag! and Mutate! perks from reappearing when there are still unused perks
HookCall(0x43C9A0, perks_dialog_hook_tag);
HookCall(0x43C9E2, perks_dialog_hook_mutate);
HookCall(0x4329D1, editor_design_hook); // reset flags on exiting the character screen
}
}
+6 -5
View File
@@ -518,7 +518,7 @@ static void surface_draw(long width, long height, long fromWidth, long fromX, lo
static void DrawBody(long critNum, BYTE* surface, long x, long y, long toWidth) {
DWORD critFrmLock;
fo::FrmFile *critFrm = fo::func::art_ptr_lock(BuildFrmId(1, critNum), &critFrmLock);
fo::FrmFile* critFrm = fo::func::art_ptr_lock(BuildFrmId(1, critNum), &critFrmLock);
DWORD critWidth = fo::func::art_frame_width(critFrm, 0, charRotOri);
DWORD critHeight = fo::func::art_frame_length(critFrm, 0, charRotOri);
BYTE* critSurface = fo::func::art_frame_data(critFrm, 0, charRotOri);
@@ -586,9 +586,10 @@ static void DrawCharNote(bool style, int winRef, DWORD xPosWin, DWORD yPosWin, B
BYTE *PadSurface = new BYTE [280 * 168];
surface_draw(280, 168, widthBG, xPosBG, yPosBG, BGSurface, 280, 0, 0, PadSurface);
fo::FrmFile *frm = LoadUnlistedFrmCached((style) ? "AppStyle.frm" : "AppRace.frm", fo::OBJ_TYPE_SKILLDEX);
fo::FrmFile* frm = LoadUnlistedFrm((style) ? "AppStyle.frm" : "AppRace.frm", fo::OBJ_TYPE_SKILLDEX);
if (frm != nullptr) {
fo::util::DrawToSurface(frm->frameData[0].width, frm->frameData[0].height, 0, 0, frm->frameData[0].width, frm->frameData[0].data, 136, 37, 280, 168, PadSurface, 0); // cover buttons pics bottom
fo::util::DrawToSurface(frm->frameData[0].width, frm->frameData[0].height, 0, 0, frm->frameData[0].width, frm->frameData[0].dataPtr(), 136, 37, 280, 168, PadSurface, 0); // cover buttons pics bottom
UnloadFrmFile(frm);
}
int oldFont = GetFont(); // store current font
@@ -653,7 +654,7 @@ static void __stdcall DrawCharNoteNewChar(bool type) {
void __stdcall HeroSelectWindow(int raceStyleFlag) {
if (!HeroAppearance::appModEnabled) return;
fo::FrmFile *frm = LoadUnlistedFrmCached("AppHeroWin.frm", fo::OBJ_TYPE_INTRFACE);
fo::FrmFile* frm = LoadUnlistedFrmCached("AppHeroWin.frm", fo::OBJ_TYPE_INTRFACE);
if (frm == nullptr) {
fo::func::debug_printf("\nApperanceMod: art\\intrface\\AppHeroWin.frm file not found.");
return;
@@ -1147,7 +1148,7 @@ static __declspec(naked) void FixCharScrnBack() {
if (charScrnBackSurface == nullptr) {
charScrnBackSurface = new BYTE [640 * 480];
fo::FrmFile *frm = LoadUnlistedFrmCached((*fo::ptr::glblmode) ? "AppChCrt.frm" : "AppChEdt.frm", fo::OBJ_TYPE_INTRFACE);
fo::FrmFile* frm = LoadUnlistedFrmCached((*fo::ptr::glblmode) ? "AppChCrt.frm" : "AppChEdt.frm", fo::OBJ_TYPE_INTRFACE);
if (frm != nullptr) {
surface_draw(640, 480, 640, 0, 0, frm->frameData[0].data, 640, 0, 0, charScrnBackSurface);
} else {
+18 -3
View File
@@ -30,6 +30,7 @@
#include "HookScripts\InventoryHs.h"
#include "HookScripts\ObjectHs.h"
#include "HookScripts\MiscHs.h"
#include "HookScripts\SoundHs.h"
#include "HookScripts.h"
@@ -99,18 +100,31 @@ static HooksInjectInfo injectHooks[] = {
{HOOK_DESCRIPTIONOBJ, Inject_DescriptionObjHook, false},
{HOOK_USESKILLON, Inject_UseSkillOnHook, false},
{HOOK_ONEXPLOSION, Inject_OnExplosionHook, false},
{-1, nullptr, false}, // dummy
{-1}, // unimplemented
{HOOK_SETLIGHTING, Inject_SetLightingHook, false},
{HOOK_SNEAK, Inject_SneakCheckHook, false},
{HOOK_STDPROCEDURE, Inject_ScriptProcedureHook, false},
{HOOK_STDPROCEDURE_END, Inject_ScriptProcedureHook2, false},
{HOOK_TARGETOBJECT, Inject_TargetObjectHook, false},
{HOOK_ENCOUNTER, Inject_EncounterHook, false},
{-1, nullptr, false}, // dummy
{-1, nullptr, false}, // dummy
{-1}, // unimplemented
{-1}, // unimplemented
{HOOK_ROLLCHECK, Inject_RollCheckHook, false},
{HOOK_BESTWEAPON, Inject_BestWeaponHook, false},
{HOOK_CANUSEWEAPON, Inject_CanUseWeaponHook, false},
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // HOOK_MOUSEWHEEL
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // HOOK_COMBATATTACK
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // RESERVED
{-1}, // RESERVED
{HOOK_BUILDSFXWEAPON, Inject_BuildSfxWeaponHook, false},
};
void HookScripts::InjectingHook(int hookId) {
@@ -217,6 +231,7 @@ void HookScripts::LoadHookScripts() {
InitInventoryHookScripts();
InitObjectHookScripts();
InitMiscHookScripts();
InitSoundHookScripts();
HookScripts::LoadHookScript("hs_keypress", HOOK_KEYPRESS);
HookScripts::LoadHookScript("hs_mouseclick", HOOK_MOUSECLICK);
+2
View File
@@ -75,6 +75,8 @@ enum HookType
HOOK_ROLLCHECK = 46,
HOOK_BESTWEAPON = 47,
HOOK_CANUSEWEAPON = 48,
// RESERVED 49 to 60
HOOK_BUILDSFXWEAPON = 61,
HOOK_COUNT
};

Some files were not shown because too many files have changed in this diff Show More