[(BGEE, BG2) Bug] Monster Summoning III
Per the description, MSIII has a 60% chance of summoning one creature and 40% for two. When cast at level 9 the percentage is actually 99% for one, 1% for two.
// mon sum iii has wrong probabilities at level 1
COPY_EXISTING ~spwi504.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
WHILE ("%abil_num%" > 0) BEGIN
SET "abil_num" = ("%abil_num%" - 1)
READ_SHORT ("%abil_off%" + 0x10 + (0x28 * "%abil_num%")) "min_lev"
PATCH_IF ("%min_lev%" = 1) BEGIN // if first header
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%abil_num%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%abil_num%")) "abil_fx_idx"
SET "eff" = 3
WHILE ("%abil_fx_num%" > 0) BEGIN
SET "abil_fx_num" = ("%abil_fx_num%" - 1)
READ_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) "opcode"
PATCH_IF (("%opcode%" = 177) AND ("%eff%" = 2)) BEGIN // last eff opcode
WRITE_BYTE ("%fx_off%" + 0x12 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 100 // probability
WRITE_BYTE ("%fx_off%" + 0x13 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 61 // probability
SET "eff" = 0
END ELSE
PATCH_IF (("%opcode%" = 177) AND ("%eff%" = 3)) BEGIN // first or second eff
SET "eff" = ("%eff%" - 1)
END
END
END
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Bhryaen on
1
Comments
Just a note, you can do this with 2 effects per level:
0-100 - one creature
61-100 - one more creature
Not a big deal, just nitpicking. Actually, it is less prone to the probability interval bug.
Did you mean: Confirmed... erm... well, looked at anyway...
I've noticed (maybe what Avenger_teambg did) that in each Spell Ability there are two identical 61-100 effects. No idea why this would be... out of my purview capacity...
Rather than restructuring the spell, I just kept the original, slightly less efficient way.
Using a level 9 Conjurer I casted the spell 30 time and got 2 monsters in 8 castings. Its not exactly 40% (lady luck is sometimes a bitch) but its certainly a lot more than 1%.
Confirmed Fixed.
@Bhryaen
I think you can move this one too.