Skip to content

[(BGEE, BG2) Bug] Monster Summoning III

CamDawgCamDawg Member, Developer Posts: 3,428
edited August 2012 in Fixed
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
AndreaColombo

Comments

  • CorianderCoriander Member Posts: 1,667
    I'll do it!
  • NathanNathan Member Posts: 1,007
    Verified, this has been integrated internally and should be present in the next build.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2012
    Confirmed fixed.
    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.
    AndreaColombo
  • BhryaenBhryaen Member Posts: 2,874
    edited August 2012
    @Avenger_teambg
    Did you mean:
    0-60 - one creature
    61-100 - one more creature
    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...
  • CamDawgCamDawg Member, Developer Posts: 3,428
    Nah, @Avenger_teambg's pointing out that the original files do with three effects what you could accomplish with two. If you have two summons, one that always occurs and then a second that occurs at 61-100 (on a percentile dice) you can replace the way it's currently done--one summon for 0-60, one summon for 61-100, and another summon for 61-100. Same result, more bloat.

    Rather than restructuring the spell, I just kept the original, slightly less efficient way.
    Avenger_teambg
  • TanthalasTanthalas Member Posts: 6,738
    I don't know how to look at the spell code but:

    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.
Sign In or Register to comment.