Skip to content

[(BG2) bug] Luck bugs

CamDawgCamDawg Member, Developer Posts: 3,438
edited November 2012 in Fixed
Per its description, the spell Luck is supposed to provide bonuses to thieving, saves, thac0, etc. The spell currently provides the luck opcode, which after testing by aVENGER, was determined to do cool stuff, but nothing to thieving or saves. This will add the save and thieving bonii to the spell:
// luck not providing saving throw and thieving skill bonuses; duration incorrect
COPY_EXISTING ~spwi209.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
SET "fx_delta" = 0
FOR (index = 0 ; index < abil_num ; index = index + 1 ) BEGIN // cycle thru abilities
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "%abil_fx_idx%"
// first fix duration while we're here
FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
READ_SHORT ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "opcode"
READ_LONG ("%fx_off%" + 0x0e + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "duration"
READ_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "resref"
PATCH_IF ("%duration%" = 20) BEGIN
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%index2%" + "%abil_fx_idx%"))) 18
END
PATCH_IF (("%opcode%" = 174) AND ("%resref%" STRING_EQUAL_CASE "EFF_M05")) BEGIN
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%index2%" + "%abil_fx_idx%"))) 1 // fix invalid sound effect duration
END
PATCH_IF ("%opcode%" = 133) BEGIN
READ_ASCII ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "clone" (0x30)
FOR (index3 = 33 ; index3 < 38 ; index3 = index3 + 1) BEGIN
INSERT_BYTES ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) 0x30 // new effect
WRITE_ASCIIE ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "%clone%"
WRITE_SHORT ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "%index3%" // opcode: one of them thar saves
END
PATCH_FOR_EACH ~thskill~ IN ~59~ ~90~ ~91~ ~92~ ~275~ ~276~ ~277~ BEGIN // all 7 thieving skill opcodes
INSERT_BYTES ("%fx_off%" + ("%index2%" + "%abil_fx_idx%")) 0x30 // new effect
WRITE_EVALUATED_ASCII ("%fx_off%" + ("%index2%" + "%abil_fx_idx%")) "%clone%" // cloned effect
WRITE_SHORT ("%fx_off%" + ("%index2%" + "%abil_fx_idx%")) "%thskill%" // opcode
WRITE_LONG ("%fx_off%" + 0x04 + ("%index2%" + "%abil_fx_idx%")) 5 // param1: 5 (5% bonus)
WRITE_LONG ("%fx_off%" + 0x08 + ("%index2%" + "%abil_fx_idx%")) 0 // param2: 0 (cumulative bonus type)
END
SET "fx_delta" = ("%fx_delta%" + 12)
SET "index2" = ("%index2%" + 12)
SET "abil_fx_num" = ("%abil_fx_num%" + 12)
END
END
WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "%abil_fx_num%"
END
BUT_ONLY_IF_IT_CHANGES
More interesting is what to do with Alora's rabbit foot. It's currently providing a +2 luck bonus... should we also extend this to saves and thieving skills? I'd vote yes, but since this is a potential balance concern I'll let the devs make the call. If we do want to make this change, here's the code:
// alora's lucky rabbit foot not luck enough
COPY_EXISTING ~misc88.itm~ ~override~
PATCH_FOR_EACH index IN 277 276 275 92 91 90 59 BEGIN
LPF ADD_ITEM_EQEFFECT INT_VAR
opcode = index // thieving bonus opcodes
target = 1 // self
parameter1 = 10 // +10%
timing = 2 // while equipped
END
END
FOR (index = 33 ; index < 38 ; ++index) BEGIN
LPF ADD_ITEM_EQEFFECT INT_VAR
opcode = index // save bonus opcodes
target = 1 // self
parameter1 = 2 // +2
timing = 2 // while equipped
END
END
Post edited by Tanthalas on

Comments

  • TanthalasTanthalas Member Posts: 6,738
    I say give Alora's rabbit foot the same bonuses.
  • AndreaColomboAndreaColombo Member Posts: 5,533
    I agree with @Tanthalas. Alora should get the same bonuses.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    @SethDavis: I'm surprised that luck doesn't give save bonuses.
    I would rather check the code first, before adding extra opcodes.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2012
    Ok, so the picklock skill increase is definitely superfluous.
    @SethDavis what about pickpocketing :) that is a separate thing than lockpicking.
    Also, that random factor is negligible, as most difficulty settings are rounded to 10.
  • AndreaColomboAndreaColombo Member Posts: 5,533
    I'll drop @SethDavis name again, 'cause if you add a namedrop to a post through editing it doesn't really notify the person in question. Vanilla forums have this kind of quirks.
  • SethDavisSethDavis Member Posts: 1,812
    @Avenger_teambg - Now that you mention it they only appear to do this for removing traps, picking locks and breaking doors.... Sometimes I think hey must have had like 500 people working on the same thing all the time without talking to eachother.
  • AndreaColomboAndreaColombo Member Posts: 5,533
    SethDavis said:

    Sometimes I think hey must have had like 500 people working on the same thing all the time without talking to eachother.

    I came to the same conclusion while perusing the original dialog.tlk file...
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Yep, it is likely their QA didn't involve 100+ beta testers :)
  • SethDavisSethDavis Member Posts: 1,812
    edited August 2012
    Ok, so I'll apply the fixes but comment out the ones that are already being hit. If it still doesn't look like those ones are being modified by luck I'll just uncomment them

    Potentially fixed - @Camdawg's fix has been applied sans opcode 90
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    I regret i mentioned pick locks. 1 points in luck won't really affect the random factor, will it?
  • BhryaenBhryaen Member Posts: 2,874
    Not sure what was done by @SethDavis on the matter, but contrasting vBG2 v BGEE it's clear that a large bunch of Save and Thieving bonus effects were added to the spell ability of SPWI209 to augment the apparently limited Opcode 133 for Luck bonus. Present now are new bonuses for AC, Set traps, Detect illusions, Hide in shadows, Pick pockets, Find traps, Move silently, Save v Spell, Save v breath, Save v polymorph, Save v wand, and Save v death.

    Issues I find with it (which may be non-issues) are:
    1. All the AC bonuses have a Target of "None." Their only variety otherwise is in variables that NI calls "Unknown," so I can't comment.

    2. The Save bonuses are all duplicated for no apparent reason.

    3. Timing Mode varies throughout the effects:
    a. Set traps, two of the AC bonuses, original Lighting Effects, and the Display string are set to Timing Mode = 1 (Instant, permanent until death)
    b. The second Play Sound is set to Timing Mode = 4 (Delay/Permanent)
    c. Everything else is set to Timing Mode = 0 (Instant/Limited)... which seems like the correct mode for all

    4. One of the AC bonuses is applied to "All weapons." Seems better to apply THAC0 bonuses to weapons...

    But for sure the spell Luck now entails more than just Opcode 133's provisions...
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    @Bhryaen those effects are damaged. Something went awfully wrong with this spell patch.
    @CamDawg alerted.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    edited September 2012
    Wow, Luck got jacked as did Alora's lucky rabbit foot. This will remove all the funky opcodes and then re-insert them correctly.
    // repair to 0829 build luck spell
    COPY_EXISTING ~spwi209.spl~ ~override~
    PATCH_FOR_EACH effect IN 277 0 276 275 92 91 59 37 36 35 34 33 BEGIN
    LPF DELETE_SPELL_EFFECT INT_VAR opcode_to_delete = effect END // delete fubar'd effects
    END
    PATCH_FOR_EACH effect IN 0 33 34 35 36 37 BEGIN // for d20 effects use +1
    LPF ADD_SPELL_EFFECT INT_VAR opcode = effect duration = 18 target = 2 power = 2 parameter1 = 1 resist_dispel = 3 END
    END
    PATCH_FOR_EACH effect IN 59 91 92 275 276 277 BEGIN // for d100 effects use +5
    LPF ADD_SPELL_EFFECT INT_VAR opcode = effect duration = 18 target = 2 power = 2 parameter1 = 5 resist_dispel = 3 END
    END
    BUT_ONLY

    // build 0829, alora's rabbit foot
    COPY_EXISTING ~misc88.itm~ ~override~
    PATCH_FOR_EACH effect IN 277 0 276 275 92 91 59 37 36 35 34 33 BEGIN
    LPF DELETE_ITEM_EQEFFECT INT_VAR opcode_to_delete = effect END // delete fubar'd effects
    END
    PATCH_FOR_EACH effect IN 277 276 275 92 91 59 BEGIN // for d100 effects use +10
    LPF ADD_ITEM_EQEFFECT INT_VAR opcode = effect target = 1 parameter1 = 10 timing = 2 END
    END
    PATCH_FOR_EACH effect IN 37 36 35 34 33 0 BEGIN // for d20 effects use +2
    LPF ADD_ITEM_EQEFFECT INT_VAR opcode = effect target = 1 parameter1 = 2 timing = 2 END
    END
    BUT_ONLY
    Post edited by CamDawg on
  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @CamDawg's new fix has hopefully not been botched by the gremlins lurking inside my computer/mind
  • TanthalasTanthalas Member Posts: 6,738
    @SethDavis

    This one still has a problem.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Here is the fixed spell :D
    @CamDawg i told you, hehe.
    The rabbit foot seems to be ok.
  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @Avenger_teambg's file has been added and fixes the oddness nicely.
  • TanthalasTanthalas Member Posts: 6,738
    @Avenger_teambg

    Is Alora's rabbit foot also working?
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
    That was not messed up earlier, so it should have been fixed a few rounds earlier.
    It contains saving throw/thieving skill opcodes and nothing wrong.
Sign In or Register to comment.