[(BG2) bug] Luck bugs
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 incorrectMore 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:
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
// 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
2
Comments
I would rather check the code first, before adding extra opcodes.
@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.
Potentially fixed - @Camdawg's fix has been applied sans opcode 90
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...
@CamDawg alerted.
This one still has a problem.
@CamDawg i told you, hehe.
The rabbit foot seems to be ok.
Is Alora's rabbit foot also working?
It contains saving throw/thieving skill opcodes and nothing wrong.