Skip to content

[(BGEE, BG2) bug] Grease

CamDawgCamDawg Member, Developer Posts: 3,438
edited August 2012 in Fixed
Grease lasts for 10 seconds, regardless of your level, and had an incorrect casting time, icon, and range to boot.

This will correct those errors and extend it out to level 20.
// grease fixes
COPY_EXISTING ~spwi101.spl~ ~override~
WRITE_ASCII 0x3a ~spwi101c~ // fixes icon
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
READ_SHORT 0x70 "fx_num"
FOR ("index" = 0; "%index%" < "%abil_num%"; "index" = ("%index%" + 1)) BEGIN // first fix existing effects
WRITE_SHORT ("%abil_off%" + 0x0e + ("%index%" * 0x28)) 30 // corrects range
WRITE_SHORT ("%abil_off%" + 0x12 + ("%index%" * 0x28)) 1 // casting time
READ_SHORT ("%abil_off%" + 0x10) "min_lev"
READ_SHORT ("%abil_off%" + 0x1e) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20) "abil_fx_idx"
FOR ("index2" = 0; "%index2%" < "%abil_fx_num%"; "index2" = ("%index2%" + 1)) BEGIN
READ_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "duration"
PATCH_IF ("%duration%" > 5) BEGIN // longer than one round
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%index2%"))) (18 + (6 * "%min_lev%")) // corrects duration
END
END
END
PATCH_IF ("%min_lev%" < 20) BEGIN // if abilities don't go to lev 20
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%" + (0x28 * ("%abil_num%" - 1))) "ability" (0x28) // reads last ability
FOR ("index" = 20; "%index%" > "%min_lev%"; "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%"))) (18 + (6 * "%index%")) // 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 "%abil_num%"
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Bhryaen on

Comments

  • WispWisp Member Posts: 1,102
    @CamDawg
    It does not really matter, since the vanilla spell only has 1 ability header, but the loop across existing abilities always reads and writes to/from the first ability, regardless of the value of the index variable. (Fixed in v10, btw.)
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Oh yeah, I see it now. You're right though, it won't affect this patch.
  • KeithSKeithS Member Posts: 623
    Adding...
  • NathanNathan Member Posts: 1,007
    Verified that this has been integrated internally, and should be present in the next build.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed fixed... tentatively.
    Well, there are now 20 headers, i guess the script ran :) Damned i be if i check all effects in all headers :D
  • BhryaenBhryaen Member Posts: 2,874
    Confirmed Fixed:

    20 bloody Spell abilities for each level now... Grease just got a lot more slippery...

    Spell description:
    Grease (Conjuration)
    Level: 1
    Range: 10 yards
    Duration: 3 rounds + 1 round/level
    Casting Time: 1
    Area of Effect: 30' x 30' square area
    Saving Throw: Special
    I'm assuming the duration shown in NI is in sec then, and 1 round = 6 sec. That's the formula that makes the following work...

    Duration set as such for Effects #0, 1, 3 in each:
             Dur Rng CastSpd      Icon
    Level1: 24 30 1 SPWI101C
    Level2: 30 30 1 SPWI101C
    Level3: 36 30 1 SPWI101C
    Level4: 42 30 1 SPWI101C
    Level5: 48 30 1 SPWI101C
    Level6: 54 30 1 SPWI101C
    Level7: 60 30 1 SPWI101C
    Level8: 66 30 1 SPWI101C
    Level9: 72 30 1 SPWI101C
    Level10: 78 30 1 SPWI101C
    Level11: 84 30 1 SPWI101C
    Level12: 90 30 1 SPWI101C
    Level13: 96 30 1 SPWI101C
    Level14: 102 30 1 SPWI101C
    Level15: 108 30 1 SPWI101C
    Level16: 114 30 1 SPWI101C
    Level17: 120 30 1 SPWI101C
    Level18: 126 30 1 SPWI101C
    Level19: 132 30 1 SPWI101C
    Level20: 138 30 1 SPWI101C
    For once though we've got a spell fix that makes a spell more powerful rather than less. ;-)
Sign In or Register to comment.