Skip to content

(BG1, BG2) STR bonus applied to arrow damage

BhryaenBhryaen Member Posts: 2,874
edited August 2012 in Fixed
This is a follow-up to @CamDawg's thread here regarding bullets that has already been fixed:
http://forum.baldursgate.com/discussion/1484/bgee-bg1-bg2-consistency-discussion-strength-bonuses-and-slings/p1

OBSERVED:
STR bonus is incorrectly added to the following ammo:
AROW05 (Arrows of Biting)
AROW12 (Arrows of Biting)
AROW14 (Eldoth's arrows)
AROW15 (Eldoth's arrows) (Not used in-game)

This is also true in BG1 and BG2.

EXPECTED:
Remove the STR bonus.

NOTES:
Not sure if it's necessary in all cases- don't know how to check if an game resource isn't being employed by the game. But here is an attempt to use @CamDawg's code as a template to fix a similar issue (not sure if different ammo uses a different format):
// disallows str bonus for specific arrows
COPY_EXISTING ~arow05.itm~ ~override~
~arow12.itm~ ~override~
~arow14.itm~ ~override~
~arow15.itm~ ~override
PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
WHILE ("%abil_num%" > 0) BEGIN // looks for ranged ability header
SET "abil_num" = ("%abil_num%" - 1)
READ_BYTE ("%abil_off%" + ("%abil_num%" * 0x38)) "type"
PATCH_IF ("%type%" = 2) BEGIN // ranged ability check
WRITE_BYTE ("%abil_off%" + 0x26 + ("%abil_num%" * 0x38)) 0 // disallow strength bonus
END
END
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Bhryaen on

Comments

  • CamDawgCamDawg Member, Developer Posts: 3,438
    Bhryaen said:

    Not sure if it's necessary in all cases- don't know how to check if an game resource isn't being employed by the game.

    NearInfinity to the rescue! Go to the edit tab on any item and then use the find button at the bottom to 'find references to this file'. It's not perfect--i.e. it will miss items 2das like the random treasure table (*cough* attn: @FredSRichardson *cough*)--but it's usually a pretty good start. Legit items will generally turn up on a creature, store, area, script, dialogue, or spell.

  • CamDawgCamDawg Member, Developer Posts: 3,438
    ...and that code will work for these items, but it's sloppy. I didn't bother with the bits so it nukes all flags on that particular byte. For these it's OK, because the strength bonus is the only bit set.
  • BhryaenBhryaen Member Posts: 2,874
    @CamDawg
    Great! Works: AROW15 isn't used anywhere- so I'll take it out of the code... I suppose...

    If you ever have some large group of fixes that you have the first general coding for that can serve as a template, you can just shoot it by if I can do the legwork of getting the relevant list of .itm or .cre or what-have-you. I can't compose code, but I can certainly expropriate it. >:-) Probably won't work in most cases, but worth a try...
  • BalquoBalquo Member, Developer Posts: 2,746
    Suppose there is no harm in fixing AROW15 in any case.
  • SethDavisSethDavis Member Posts: 1,812
    edited July 2012
    checking this one now

    [EDIT] Potentially fixed - @Bhryaen 's mutation has been applied

    [NOTE] *suspicious glare* You left off that ~ on purpose didn't you. Well I shall not be caught off guard!
  • BhryaenBhryaen Member Posts: 2,874
    @SethDavis
    Sorry! Good catch. :-/ Mutation indeed...
  • BhryaenBhryaen Member Posts: 2,874
    Confirmed Fixed. :-) Mutations work! Mwuahahaha Frankencoding...
  • LuneverLunever Member Posts: 307
    For ages in A/D&D there have been mighty composite bows that do add some strength bonus, please implement them.
Sign In or Register to comment.