[(BGEE, BG2) bug] Free action
Free action was capped at level 18 and had several other errors--it inexplicably protects against charm and the hold immunity was always applied to the caster, even if targeted at another creature.
// free action misc errors and missing lev 19, 20 headers
// all supplementary effects handled in effects batches below
COPY_EXISTING ~sppr403.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
SET "basedur" = 96
FOR (loops = abil_num; loops > 0; loops = loops - 0x01) BEGIN
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * ("%loops%" - 1))) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * ("%loops%" - 1))) "abil_fx_idx"
WHILE ("%abil_fx_num%" > 0) BEGIN // first fix existing effects
SET "abil_fx_num" = ("%abil_fx_num%" - 1)
READ_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) "opcode"
READ_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) "immunity"
PATCH_IF (("%opcode%" = 101) AND ("%immunity%" = 5)) BEGIN // immunity to charm
WRITE_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 126 // movementrate bonus
WRITE_LONG ("%fx_off%" + 0x04 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 100 // percentage
WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 2 // set to %
END
PATCH_IF (("%opcode%" = 101) AND ("%immunity%" = 185)) BEGIN // immunity to hold 2 shouldn't be there, also targeted at self
WRITE_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 169 // prevent portait icon
WRITE_BYTE ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 2 // target: preset target
WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 145 // grease
END
END
END
// read data from last ability
READ_SHORT ("%abil_off%" + 0x10 + (0x28 * ("%abil_num%" - 1))) "min_lev"
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * ("%abil_num%" - 1))) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * ("%abil_num%" - 1))) "abil_fx_idx"
SET "abil_insert" = ("%abil_off%" + (0x28 * "%abil_num%"))
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%"))) (60 + (6 * "%index%")) // corrects duration
END
END
INSERT_BYTES ("%abil_insert%" ) 0x28 // inserts bytes
WRITE_EVALUATED_ASCII ("%abil_insert%" ) "%ability%" // clones existing ability
WRITE_SHORT ("%abil_insert%" + 0x10) "%index%" // minimum level
WRITE_SHORT ("%abil_insert%" + 0x1e) "%abil_fx_num%"
WRITE_SHORT ("%abil_insert%" + 0x20) ("%abil_fx_idx%" + ("%abil_fx_num%" * ("%index%" - "%min_lev%")))
SET "fx_off" = ("%fx_off%" + 0x28)
SET "abil_num" = ("%abil_num%" + 1)
END
WRITE_LONG 0x6a "%fx_off%"
WRITE_SHORT 0x68 "%abil_num%"
END
Post edited by Bhryaen on
1
Comments
As an aside, verified that the current code is present internally and should be present in the next build.
I would accept domination (0xf1), but charm is a bit excess to me. If it didn't protect in any vanilla game before, then it shouldn't now.
I disagree that free action should prevent sleep. Unless the item actually mentions it.
To me free action should protect only against effects that directly impair movement, not effects that indirectly impair movement.
My question is, what is cdmound/CDHGNYA1 (these 'spells' don't exist in bg1) they are some fixpack things. Looks like fixpack has gone viral.
I've obviously worked on way, way too many projects.
More BG2 stuff.
Is there more that needs to be extracted from Free Action (Sleep, Stun, Domination) or is that already dealt with/ not going to be dealt with/ never was happening in the first place? Just wondering if I should look for that as a cue to issues still afoot...
Thank you.
conceptually, free action prevents those effects that
- target a creature's natural mobility
- come from an external source (not from innate, natural abilities)
it's a "dumb" effect in that it doesn't differentiate between desirable and undesirable effects
so being stuck during defensive spin is not prevented because it's an innate and natural ability (this is undesirable but isn't prevented)
and, famously, haste is (this is desirable and is prevented)
paws of the cheetah grant a haste-like effect so it gets disabled by the FoA+5's freedom of action
...logically, the name contradicts some of what the spell actually does, because moving faster doesn't reduce your freedom of movement but if you disregard the name and look at how it works it's actually pretty self-consistent.