Skip to content

[(BGEE, BG2) bug] Friends

CamDawgCamDawg Member, Developer Posts: 3,438
edited August 2012 in Fixed
Friends behaves poorly in the current build/BG2. The spell duration was set to 4 rounds + 1 round/level of the caster, but was only improving every other round (i.e. 5 rounds at level 1-2, 7 rounds at 3-4, 9 at 5-6, etc.). It also wasn't capped at level 20.

The spell is supposed to last 1d4 rounds + 1 round/level of the caster. However, because of the staggered probability bug we could never get the 1d4 part of the duration working and just set it as 4 rds + 1 rd/level of the caster. If the other bug gets resolved, we should revisit this.
// friends fixes
COPY_EXISTING ~spwi107.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
READ_SHORT ("%abil_off%" + 0x48) "second_fx_idx"
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * ("%abil_num%" - 1))) "last_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * ("%abil_num%" - 1))) "last_fx_idx"
DELETE_BYTES ("%fx_off%" + (0x30 * "%second_fx_idx%")) (0x30 * (("%last_fx_idx%" + "last_fx_num") - "%second_fx_idx%")) // eliminates all high lev effects
DELETE_BYTES ("%abil_off%" + 0x28) (0x28 * ("%abil_num%" - 1)) // eliminates all abilities beyond the first
SET "fx_off" = ("%fx_off%" - (0x28 * ("%abil_num%" - 1)))
// now to patch effects at lev 1 before cloning
READ_SHORT ("%abil_off%" + 0x1e) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20) "abil_fx_idx"
READ_ASCII ("%fx_off%" + (0x30 * "%abil_fx_idx%")) "effects" ("%abil_fx_num%" * 0x30) // reads whole block of effects from last ability
READ_ASCII ("%abil_off%") "ability" (0x28) // reads last ability
FOR ("index" = 20; "%index%" > 1; "index" = ("%index%" - 1)) BEGIN // now extend headers
INSERT_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) ("%abil_fx_num%" * 0x30) // inserts bytes
WRITE_EVALUATED_ASCII ("%fx_off%" + (0x30 * "%abil_fx_idx%")) "%effects%" // clones existing effects
FOR ("index2" = 0; "%index2%" < "%abil_fx_num%"; "index2" = ("%index2%" + 1)) BEGIN // loop to adjust effects by min level
READ_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%" + "%index2%"))) "duration"
PATCH_IF ("%duration%" > 5) BEGIN // longer than one round
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%" + "%index2%"))) ("%duration%" + (6 * ("%index%" - 1))) // corrects duration
END
END
INSERT_BYTES ("%abil_off%" + 0x28) 0x28 // inserts bytes
WRITE_EVALUATED_ASCII ("%abil_off%" + 0x28) "%ability%" // clones existing ability
WRITE_SHORT ("%abil_off%" + 0x38) ("%index%") // minimum level
WRITE_SHORT ("%abil_off%" + 0x46) "%abil_fx_num%"
WRITE_SHORT ("%abil_off%" + 0x48) ("%abil_fx_idx%" + ("%abil_fx_num%" * ("%index%" - 1)))
SET "fx_off" = ("%fx_off%" + 0x28)
SET "abil_num" = ("%abil_num%" + 1)
END
WRITE_LONG 0x6a "%fx_off%"
WRITE_SHORT 0x68 20
BUT_ONLY_IF_IT_CHANGES
Post edited by Bhryaen on

Comments

  • KeithSKeithS Member Posts: 623
    Adding...
  • NathanNathan Member Posts: 1,007
    edited July 2012
    Verified that this has been integrated internally, and should be present in the next build.

    (also: earmarked for re-testing should we feature probability bug be changed..)
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Nathan said:

    Verified that this has been integrated internally, and should be present in the next build.

    (also: earmarked for re-testing should we feature probability bug be changed..)

    If it does, we'll also need to address the stun effects of comet (supposed to be 1d4 rounds, fixed at 3).
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed fixed - checked in editor
  • TanthalasTanthalas Member Posts: 6,738
    Confirmed Fixed:

    Level 1 -> 30 sec -> 5 rounds
    Level 2 -> 36 sec -> 6 rounds
    Level 3 -> 42 sec -> 7 rounds
    Level 4 -> 48 sec -> 8 rounds
    Level 5 -> 54 sec -> 9 rounds
    Level 6 -> 60 sec -> 10 rounds
    Level 7 -> 66 sec -> 11 rounds
    Level 8 -> 72 sec -> 12 rounds
    Level 9 -> 78 sec -> 13 rounds
    Level 10 -> 84 sec -> 14 rounds

    *got lazy*

    Level 20 -> 144 sec -> 24 rounds

    I wanted to test Level 21 too, but I didn't have HLA abilities to select :(

    In case that probability thing isn't fixed, the spell description should be changed.

Sign In or Register to comment.