Skip to content

[(BGEE, BG2) bug] Free action

CamDawgCamDawg Member, Developer Posts: 3,438
edited August 2012 in Fixed
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
AndreaColombo

Comments

  • KeithSKeithS Member Posts: 623
    Adding...
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited July 2012
    Charm protection was probably against domination or other body take over stuff, not real smiley charming. Another reason to split domination and charm. Actually, 0xf1 opcode should be used for domination stuff, and 0x5 should be used for charm.
    AndreaColombo
  • NathanNathan Member Posts: 1,007
    @Camdawg, @Avenger_teambg - should Camdawg's code be modified, then? Free action doesn't protect against any charm or domination effects normally...?

    As an aside, verified that the current code is present internally and should be present in the next build.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Imo, it should protect vs any paralyzation, sleep, entangle, grease, web. Also magical stunning or stuff like bigby's hand. (Only magical grappling/stunning).
    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.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Whether free action should protect against stun was one of the biggest, longest, funnest fights discussions we ever had in the Fixpack forums. We decided against and made an optional component to add back stun protection for the legion of dissenters. Years later we had it confirmed from Gaider that free action should not protect against stun, particularly from mental abilities like psionics or domination.
    Bhryaen
  • TanthalasTanthalas Member Posts: 6,738
    @Avenger_teambg

    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.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Well, then remove sleep and stun, i just read about that on the net. I agree, that too many effects would make it just too powerful. Its main "feat" is to disable paralyzation type effects and magical restraints.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed fixed ?
    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.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Wow, I'm not sure. I think these were spells added by Unfinished Business as part of their creature restorations. icelus asked us to add the patching in FP since it would be forever until the next UB release.

    I've obviously worked on way, way too many projects.
    AndreaColombo
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    @CamDawg Well, we can't say BGEE isn't mod friendly, lol. On the other hand, the rest of the stuff seems solid. Stun remained in and i'm happy about that. There are nasty stunning darts when leaving Candlekeep
    CrevsDaak
  • TanthalasTanthalas Member Posts: 6,738
    @Bhryaen

    More BG2 stuff.
  • BhryaenBhryaen Member Posts: 2,874
    @CamDawg
    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...
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Between this and the immunity effects batches, free action should be good to go.
  • ilpomoilpomo Member Posts: 3
    Can someone explain me why Free Action (from Flail of Ages +5) "stops" the movement speed buff from The Paws of the Cheetah?

    Thank you.
  • bob_vengbob_veng Member Posts: 2,308
    @ilpomo
    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.
Sign In or Register to comment.