Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[(BGEE, BG2) bug] Friends

CamDawgCamDawg Member, Developer Posts: 3,394
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

Sign In or Register to comment.