Quote
Currently, the fixpack restores the bonus to saving throws but doesn't do anything about thieving skills. If we decide to fix that, the revised code would look like this:
// 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
Edited by aVENGER_(RR), 17 January 2012 - 02:44 AM.












