[(BGEE, BG2) bug] Grease
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.
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
0
Comments
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.)
Well, there are now 20 headers, i guess the script ran Damned i be if i check all effects in all headers
20 bloody Spell abilities for each level now... Grease just got a lot more slippery...
Spell description: 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: For once though we've got a spell fix that makes a spell more powerful rather than less. ;-)