Skip to content

Commit

Permalink
Add "drop undroppable magic arrows".
Browse files Browse the repository at this point in the history
  • Loading branch information
GraionDilach committed Apr 9, 2023
1 parent 41d2cff commit 929e8ff
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 1 deletion.
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions zgtweaks/english/setup.tra
Original file line number Diff line number Diff line change
Expand Up @@ -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~

Expand Down
32 changes: 32 additions & 0 deletions zgtweaks/library/dropmagicarrows.tpa
Original file line number Diff line number Diff line change
@@ -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
49 changes: 48 additions & 1 deletion zgtweaks/zgtweaks.tp2
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 929e8ff

Please sign in to comment.