Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[(BG2) bug] Luck bugs

CamDawgCamDawg Member, Developer Posts: 3,394
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
TanthalasAndreaColombo

Comments

Sign In or Register to comment.