From 929e8ffffdde4ffe30a3c92227b2505aa4ff0a94 Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Sun, 9 Apr 2023 11:40:55 +0200 Subject: [PATCH] Add "drop undroppable magic arrows". --- readme.md | 12 +++++++ zgtweaks/english/setup.tra | 8 +++++ zgtweaks/library/dropmagicarrows.tpa | 32 ++++++++++++++++++ zgtweaks/zgtweaks.tp2 | 49 +++++++++++++++++++++++++++- 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 zgtweaks/library/dropmagicarrows.tpa diff --git a/readme.md b/readme.md index 627d211..c068627 100644 --- a/readme.md +++ b/readme.md @@ -22,6 +22,18 @@ This means that a high-level Cleric-Mage can end up with up to 8 additional scro __COMPATIBILITY:__ These components should be installed after all mods which might buff spellcaster AI (SCS). These components functionally overlap with SCS's "Wider spell scrolls" but they can be installed together. These components __need__ to be installed after [Abel's Nonrandom Treasures](https://forums.beamdog.com/discussion/83483/mod-nonrandom-treasures) mod on IWDEE. +## Components 3X Replace nondroppable magic arrow clones with their droppable counterparts + +Depending on the subcomponent chosen, the quantity of the arrows in the stack will be decreased. +- __31:__ Keep 100% of the stack (no change on amount) +- __32:__ Keep 75% of the stack +- __33:__ Keep 66% of the stack +- __34:__ Keep 50% of the stack +- __35:__ Keep 33% of the stack +- __36:__ Keep 25% of the stack + +__COMPATIBILITY:__ This component wasn't tested against Item Revisions and doesn't consider changes from that mod. These components won't change individual arrow stacks which are marked as non-droppable on creatures. + ## Component 100 Mixed PnP-BG wisdom-based bonus spells table As discussed during the development of the EE Fixpack, Bioware made an error when they implemented a feature with the way the bonus spells are set up (which was only fixed in PST), resulting with more bonus mid-level spells and less low-level bonus spells than intended. This component tries to blend both options so that players will end up having the bonuses of both tables consistently excluding one caveat: both PnP and BG provides the first level 4 bonus spells on Wisdom 18 which breaks a pattern and is thereby delayed. diff --git a/zgtweaks/english/setup.tra b/zgtweaks/english/setup.tra index a4c22fa..3782e51 100644 --- a/zgtweaks/english/setup.tra +++ b/zgtweaks/english/setup.tra @@ -8,6 +8,14 @@ @6 = ~Add random arcane spell scrolls to divine casters up until their highest memorized level~ @7 = ~Add random arcane spell scrolls to divine casters up until their highest memorized level - 4~ +@30 = ~Replace nondroppable magic arrow clones with droppable counterparts~ +@31 = ~Do not change amounts in affected stacks~ +@32 = ~Decrease affected arrow stacks to 75%~ +@33 = ~Decrease affected arrow stacks to 66%~ +@34 = ~Decrease affected arrow stacks to 50%~ +@35 = ~Decrease affected arrow stacks to 33%~ +@36 = ~Decrease affected arrow stacks to 25%~ + @100 = ~Mixed PnP-BG wisdom-based bonus spells table~ @101 = ~Grant Ranger spell slots to Cleric-Ranger multiclasses~ diff --git a/zgtweaks/library/dropmagicarrows.tpa b/zgtweaks/library/dropmagicarrows.tpa new file mode 100644 index 0000000..8c4aa27 --- /dev/null +++ b/zgtweaks/library/dropmagicarrows.tpa @@ -0,0 +1,32 @@ +ACTION_DEFINE_ASSOCIATIVE_ARRAY magic_arrow_filenames_to_change BEGIN + ANGAROW => AROW08 + AROW12 => AROW05 + AROW16 => AROW09 + AROW1A => AROW11 + AROWKC => AROW08 + ARROPHE2 => AROW08 + CUTAROW1 => AROW09 + DW#ANGAR => AROW08 + DW#DIARM => AROW12 + XAROW11 => AROW11 + XBOLT06 => BOLT06 + XBULL03 => BULL03 +END + +COPY_EXISTING_REGEXP GLOB ~.*\.cre~ ~override~ + READ_LONG 0x2bc itm_off ELSE 0 + READ_LONG 0x2c0 itm_num ELSE 0 + FOR (index = 0; index < itm_num; ++index) BEGIN + SET currentitem = itm_off + index * 0x14 + READ_ASCII currentitem currentitem_name (8) NULL + PATCH_IF (VARIABLE_IS_SET currentitem_name) BEGIN + TO_UPPER currentitem_name + PATCH_IF (VARIABLE_IS_SET $magic_arrow_filenames_to_change(~%currentitem_name%~)) BEGIN + WRITE_ASCIIE currentitem $magic_arrow_filenames_to_change(~%currentitem_name%~) (8) + READ_SHORT (currentitem + 10) currentitem_count + currentitem_count = currentitem_count * magic_arrow_stack_modifier / 100 + WRITE_SHORT (currentitem + 10) currentitem_count + END + END + END + BUT_ONLY \ No newline at end of file diff --git a/zgtweaks/zgtweaks.tp2 b/zgtweaks/zgtweaks.tp2 index 4a6a574..75db14f 100644 --- a/zgtweaks/zgtweaks.tp2 +++ b/zgtweaks/zgtweaks.tp2 @@ -1,6 +1,6 @@ BACKUP ~weidu_external/zgtweaks/backup~ // location to store files for uninstall purposes AUTHOR ~Graion Dilach~ -VERSION ~1.9~ +VERSION ~1.10~ ALWAYS // do not convert Setup.tra files, those should be UTF8 already @@ -306,6 +306,53 @@ REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee iwdee eet~) @1000 SET max_spell_level = 0 BUT_ONLY +BEGIN @31 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-100 +DESIGNATED 31 + + OUTER_SET magic_arrow_stack_modifier = 100 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ + +BEGIN @32 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-75 +DESIGNATED 32 + + OUTER_SET magic_arrow_stack_modifier = 75 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ + +BEGIN @33 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-66 +DESIGNATED 33 + + OUTER_SET magic_arrow_stack_modifier = 66 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ + +BEGIN @34 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-50 +DESIGNATED 34 + + OUTER_SET magic_arrow_stack_modifier = 50 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ + +BEGIN @35 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-33 +DESIGNATED 35 + + OUTER_SET magic_arrow_stack_modifier = 33 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ + +BEGIN @36 SUBCOMPONENT @30 +LABEL ZG-DROP-MAGIC-ARROWS-25 +DESIGNATED 36 + + OUTER_SET magic_arrow_stack_modifier = 25 + + INCLUDE ~%MOD_FOLDER%/library/dropmagicarrows.tpa~ BEGIN @100 LABEL ZG-BOBW-WISDOM-TABLE