Skip to content

([BG2] bug) Elven sleep/charm resistance

CamDawgCamDawg Member, Developer Posts: 3,438
edited November 2012 in Fixed
Elves and half-elves are not receiving their innate sleep and charm resistance; 90% for elves and 30% for half-elves.

This works by inserting a bunch of targeted EFFs (attached) before sleep and charm effects with one-second immunities at the above probabilities to prevent the spells from going into effect.
 // elven sleep/charm immunity
COPY_EXISTING ~clck07.itm~ ~override~ // cloak of the nymph
~clck08.itm~ ~override~ // algernon's cloak
~gorwom1.itm~ ~override~ // undroppable nalmissra weapon - charm effect
~hgnymph.itm~ ~override~ // undroppable nymph weapon - charm effect
~misc2p.itm~ ~override~ // grager's harp
~psdclaw.itm~ ~override~ // ToB pseudodragon melee weapon
~ring03.itm~ ~override~ // Ring of Animal Friendship
~spcl311.spl~ ~override~ // ranger charm animal
~spcl641.spl~ ~override~ // charm person or animal (unused?)
~spin108.spl~ ~override~ // charm animal (elminster version)
~spin119.spl~ ~override~ // charm person (elminster version)
~spin883.spl~ ~override~ // vampire domination
~spin966.spl~ ~override~ // troll sleep
~spin980.spl~ ~override~ // beholder charm person
~spin985.spl~ ~override~ // beholder domination
~sppr102.spl~ ~override~ // command
~sppr204.spl~ ~override~ // charm person or mammal
~sppr512.spl~ ~override~ // greater command
~sppr982.spl~ ~override~ // dire charm (trap)
~spwi104.spl~ ~override~ // charm person
~spwi116.spl~ ~override~ // sleep
~spwi316.spl~ ~override~ // dire charm
~spwi506.spl~ ~override~ // domination
~spwi929.spl~ ~override~ // succubus charm male
~spwi930.spl~ ~override~ // succubus charm female
~spwi943.spl~ ~override~ // sirine dire charm
~spwm179.spl~ ~override~ // wild surge charm
~spwm187.spl~ ~override~ // wild surge sleep
~wand08.itm~ ~override~ // wand of sleep
READ_LONG 0x64 "abil_off" ELSE 0
READ_SHORT 0x68 "abil_num" ELSE 0
READ_LONG 0x6a "fx_off" ELSE 0
PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.spl" = 0) BEGIN
SET "abil_length" = 0x28
END ELSE BEGIN
SET "abil_length" = 0x38
END
SET "fx_delta" = 0
FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN // start iterating through abilities
READ_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) ("%abil_fx_idx%")
FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
READ_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "opcode"
PATCH_IF (("%opcode%" = 39) OR ("%opcode%" = 5)) BEGIN // if there's a sleep or charm opcode
READ_BYTE ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "target"
READ_BYTE ("%fx_off%" + 0x12 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "prob1"
READ_BYTE ("%fx_off%" + 0x13 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "prob2"
PATCH_IF ("%opcode%" = 5) BEGIN // if charm
SET "new_fx" = 14
END ELSE BEGIN
SET "new_fx" = 10
END
SET "fx_delta" = "%fx_delta%" + "%new_fx%"
FOR (index4 = 2 ; index4 < 4 ; index4 = index4 + 1) BEGIN
FOR (index3 = 0 ; index3 < (("%new_fx%" / 2)) ; index3 = index3 + 1) BEGIN
INSERT_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 0x30 // insert new effect
WRITE_SHORT ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 177 // use eff file
WRITE_BYTE ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) "%target%" // preserve target
WRITE_LONG ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) "%index4%" // elf or half elf
WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 4 // race.ids
WRITE_BYTE ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) ("%prob2%" + ((21 - ("%index4%" * 6)) * ("%prob1%" - "%prob2%") / 10)) // 90%
WRITE_BYTE ("%fx_off%" + 0x13 + (0x30 * "%abil_fx_idx%")) "%prob2%" // base prob
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) ~cdelfcm%index3%~ // eff file
PATCH_IF ("%opcode%" = 39) BEGIN
WRITE_ASCII ("%fx_off%" + 0x19 + (0x30 * "%abil_fx_idx%")) ~sl~ #2 // eff file
END
END
END
SET "index2" = "%index2%" + "%new_fx%"
SET "abil_fx_num" = "%abil_fx_num%" + "%new_fx%"
END
END
WRITE_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "%abil_fx_num%"
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Tanthalas on
AndreaColombo

Comments

  • CamDawgCamDawg Member, Developer Posts: 3,438
    ...and a note to testers here, most sleep projectiles (via spell or wand) are party friendly so you'll need to test on a non-party member.
    AndreaColombo
  • SethDavisSethDavis Member Posts: 1,812
    edited August 2012
    checking this one now

    Potentially fixed - @CamDawg's fix and files have been applied. 15 attempts to charm Agnasia all failed and only 5 of 10 worked on Jaheira, though one was a roll save
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed that the big heap of ids targeting effects have been applied.

    notes:
    1. the new effects use the CD* name space, but this is how @CamDawg supplied them.
    2. it would be cool to have a new opcode which applies a whole spell instead of one-by-one effects.
    AndreaColombo
  • TanthalasTanthalas Member Posts: 6,738
    edited August 2012
    Confirmed partially fixed:

    Its a lot easier to charm Khalid than it is to charm Xan.

    Its a lot easier to sleep Khalid than it is to sleep Kivan.

    @SethDavis, @CamDawg

    One problem though, when Elves resist Sleep, they still get the "Kivan/Xan/Elf - sleep" message as if they hadn't resisted it.

    When sleep works (regardless of the target's race) we get two messages:

    Target - Sleep
    Target - Unconscious

    Post edited by Tanthalas on
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Well, this can be fixed by another batch of effects. It is a lot of effort, we probably need a better opcode :)
    AndreaColombo
  • BhryaenBhryaen Member Posts: 2,874
    @CamDawg
    Are the "Display String- Sleep" disables happening in immunities batches elsewhere? Planning another batch for this or something? Or are we anticipating a new opcode on this one? To send this one on maybe we can make a new thread for the opcode request...
  • CamDawgCamDawg Member, Developer Posts: 3,438
    No, it's because dialog.tlk changes positions more than Mitt Romney.

    Thank you, thank you, be sure to tip your waitresses.
    BhryaenTanthalas
  • CamDawgCamDawg Member, Developer Posts: 3,438
    edited September 2012
    Basically, I ended up having to run a new immunity effects batch to clean up the sleep strings.
    // sleep string fixes
    COPY_EXISTING ~cdelfsl3.eff~ ~override~
    WRITE_LONG 0x1c 26371

    // fixed stuff at the top of the effects batches
    DEFINE_PATCH_MACRO ~cd_fx_batch_prep~ BEGIN

    PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.spl" = 0) BEGIN
    READ_LONG 0x64 abil_off ELSE 0
    READ_SHORT 0x68 abil_num ELSE 0
    READ_LONG 0x6a fx_off ELSE 0
    SET counter_offset = 0x70
    SET abil_length = 0x28
    SET global_loop = 0
    SET fx_type = 0
    SET min_size = 0x72
    SET cosmetic = 1
    END ELSE
    PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.itm" = 0) BEGIN
    READ_LONG 0x64 abil_off ELSE 0
    READ_SHORT 0x68 abil_num ELSE 0
    READ_LONG 0x6a fx_off ELSE 0
    SET counter_offset = 0x70
    SET abil_length = 0x38
    SET global_loop = 1
    SET fx_type = 0
    SET min_size = 0x72
    READ_BYTE 0x18 flags ELSE 0
    PATCH_IF ((flags BAND BIT2) = BIT2) BEGIN // if droppable, add portrait icons and whatnot
    SET cosmetic = 1
    END ELSE BEGIN
    SET cosmetic = 0
    END
    END ELSE
    PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.cre" = 0) BEGIN
    SET abil_off = 0
    SET abil_num = 0
    READ_LONG 0x2c4 fx_off ELSE 0
    READ_BYTE 0x33 fx_type ELSE 2
    SET counter_offset = 0x2c8
    SET abil_length = 0
    SET global_loop = 1
    SET min_size = 0x2d4
    SET cosmetic = 0
    END
    SET debug = 0
    SET new_fx = 0

    END

    // fixed stuff at the bottom of the effects batches
    DEFINE_PATCH_MACRO ~cd_fx_batch_final~ BEGIN

    PATCH_IF (("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.cre" = 0) AND (new_fx > 0)) BEGIN // fix offsets for cre files if fx inserted
    SET inserted = ((0x30 + (0xd8 * fx_type)) * new_fx)
    PATCH_FOR_EACH coffset IN 0x2a0 0x2a8 0x2b0 0x2b8 0x2bc BEGIN
    READ_LONG coffset offset
    PATCH_IF (fx_off < offset) BEGIN
    WRITE_LONG coffset (offset + inserted)
    END
    END
    END
    PATCH_IF ((new_fx > 0) AND (debug = 1)) BEGIN
    READ_LONG 0x0c name
    PATCH_IF (name > 0) AND (name < `0) BEGIN
    READ_STRREF 0x0c name
    END ELSE BEGIN
    READ_STRREF 0x08 name
    END
    PATCH_PRINT " ~%SOURCE_FILE%~ ~override~ // %name%"
    END

    END

    ACTION_FOR_EACH file IN
    ABAZRING.ITM /* Ring */ AMUL17.ITM /* Amulet */ BHAALHP1.ITM /* */ BHAALIMM.ITM /* */ CHALCY3.ITM /* Amulet */
    CHALSLAY.ITM /* Ring */ DEMOGORG.ITM /* */ FINMEL01.ITM /* */ GORFIRG.ITM /* Ring */ GORJELFU.ITM /* Ring */
    GORJELGR.ITM /* Ring */ GORMISTI.ITM /* Ring */ HGBER01.ITM /* Two-handed Sword */ IMMCHS.ITM /* */ IMMCLOUD.ITM /* */
    IMOENHP1.ITM /* */ INNOC.ITM /* Ring */ IPSION.ITM /* Amulet */ IRONGOL.ITM /* */ MISTPO01.CRE /* Poison Mist */
    RAVAG03.ITM /* */ REF1.ITM /* */ RING92.ITM /* Ring */ RING94.ITM /* Ring */ RING95.ITM /* Ring */ RING98.ITM /* Ring */
    RING99.ITM /* Ring */ RINGKORA.ITM /* Ring */ SENGUA04.ITM /* */ SPCL152.SPL /* Barbarian Rage */ SPCL321.SPL /* Enrage */
    SPIN117.SPL /* Berserk */ SPIN783.SPL /* Slayer Change */ SPIN823.SPL /* Slayer Change */ SPIN852.SPL /* Slayer Change */ SPIN872.SPL /* */
    SPIN906.SPL /* */ SPPR508.SPL /* Chaotic Commands */ SPRNGB02.ITM /* Ring */ SPRNGB03.ITM /* Ring */ SPRNGB04.ITM /* Ring */
    SPRNGS04.ITM /* Ring */ SPRNGW01.ITM /* Ring */ SPRNGW02.ITM /* Ring */ SPRNGW03.ITM /* Ring */ SPRNGW04.ITM /* Ring */ SPRNGZ05.ITM /* Ring */
    SUREHP1.ITM /* Ring */ TELSLAV2.ITM /* */ TROLLALL.ITM /* Attack */ TROLLIMM.ITM /* Ring */
    BEGIN

    COPY_EXISTING ~%file%~ ~override~
    LAUNCH_PATCH_MACRO ~cd_fx_batch_prep~ // defines vars for rest of patch
    PATCH_IF (SOURCE_SIZE >= min_size) BEGIN
    FOR (index = (0 - global_loop) ; index < abil_num ; index = index + 1) BEGIN
    PATCH_IF ("%cosmetic%" = 1) BEGIN // if cosmetic effects needed
    SET "new_fx_3" = 0
    END ELSE BEGIN // if no cosmetic effects should be added
    SET "new_fx_3" = 1
    END
    SET "new_fx_1" = 0
    SET "new_fx_2" = 0
    SET "new_fx_4" = 0
    SET "new_fx_5" = 0
    SET "new_fx_6" = 0
    SET "new_fx_7" = 0
    SET "new_fx_8" = 0
    SET "new_fx_9" = 0
    SET "new_fx_10" = 0
    PATCH_IF ("%index%" < 0) BEGIN // if loop through globals needed
    SET "abil_fx_idx" = 0
    END ELSE BEGIN // otherwise normal ability
    SET "counter_offset" = ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%"))
    READ_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
    SET "abil_fx_idx" = ("%abil_fx_idx%" + "%new_fx%")
    WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) ("%abil_fx_idx%")
    END
    READ_SHORT "%counter_offset%" "counter" // fx_num on global loop, otherwise abil_fx_num
    FOR (index2 = 0 ; index2 < counter ; index2 = index2 + 1) BEGIN
    READ_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "opcode"
    READ_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "param1"
    READ_LONG ("%fx_off%" + 0x08 + (0x10 * "%fx_type%") + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "param2"
    READ_ASCII ("%fx_off%" + 0x14 + (0x14 * "%fx_type%") + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "resref"
    PATCH_IF (("%opcode%" = 101) AND ("%param2%" = 39)) BEGIN // sleep immunity
    SET "new_fx_1" = 1
    READ_ASCII ("%fx_off%" + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "template" ((0x30 + (0xd8 * "%fx_type%")))
    END ELSE
    PATCH_IF (("%opcode%" = 101) AND ("%param2%" = 217)) BEGIN // pw sleep immunity
    SET "new_fx_2" = 1
    READ_ASCII ("%fx_off%" + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) "template" ((0x30 + (0xd8 * "%fx_type%")))
    END ELSE
    PATCH_IF (("%opcode%" = 169) AND ("%param2%" = 14)) BEGIN // prevent sleep icon
    SET "new_fx_3" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 14001)) BEGIN // disable string "sleep"
    SET "new_fx_4" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 26040)) BEGIN // disable string "sleep"
    SET "new_fx_5" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 26371)) BEGIN // disable string "sleep"
    SET "new_fx_6" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 12047)) BEGIN // disable string "sleep"
    SET "new_fx_7" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 12958)) BEGIN // disable string "sleep"
    SET "new_fx_8" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 13027)) BEGIN // disable string "sleep"
    SET "new_fx_9" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 17405)) BEGIN // disable string "sleep"
    SET "new_fx_10" = 1
    END ELSE
    PATCH_IF (("%opcode%" = 267) AND ("%param1%" = 26001)) BEGIN // disable string "sleep"
    DELETE_BYTES ("%fx_off%" + (0x10 * "%fx_type%") + (("%abil_fx_idx%" + "%index2%") * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    SET "new_fx" = ("%new_fx%" - 1)
    SET "counter" = ("%counter%" - 1)
    END
    END
    PATCH_IF (("%new_fx_1%" = 1) OR ("%new_fx_2%" = 1)) BEGIN
    PATCH_IF ("%new_fx_1%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_LONG ("%fx_off%" + 0x08 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 39 // sleep
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_2%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_LONG ("%fx_off%" + 0x08 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 217 // pw sleep
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_3%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 169 // prevent portrait icon
    WRITE_LONG ("%fx_off%" + 0x08 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 14 // sleep
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_4%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 14001 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_5%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 26040 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_6%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 26371 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_7%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 12047 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_8%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 12958 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_9%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 13027 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    PATCH_IF ("%new_fx_10%" = 0) BEGIN
    INSERT_BYTES ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) (0x30 + (0xd8 * "%fx_type%"))
    WRITE_ASCIIE ("%fx_off%" + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) "%template%" // clones immunity effect
    WRITE_SHORT ("%fx_off%" + (0x08 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 267 // disable string
    WRITE_LONG ("%fx_off%" + 0x04 + (0x10 * "%fx_type%") + ("%abil_fx_idx%" * (0x30 + (0xd8 * "%fx_type%")))) 17405 // strref
    SET "new_fx" = ("%new_fx%" + 1)
    SET "counter" = ("%counter%" + 1)
    END
    END
    WRITE_SHORT "%counter_offset%" "%counter%"
    END
    LAUNCH_PATCH_MACRO ~cd_fx_batch_final~ // wrapup creature offset patching
    END
    BUT_ONLY_IF_IT_CHANGES

    END
  • TanthalasTanthalas Member Posts: 6,738
    @SethDavis

    @camDawg's code should fix the lingering issues with this.
  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @CamDawg's terrifyingly long fix has been applied
    Tanthalas
  • CamDawgCamDawg Member, Developer Posts: 3,438
    This appears to be fixed in 0924.
  • TanthalasTanthalas Member Posts: 6,738
    Sleep resistance giving the incorrect battle log message is fixed.

    Confirmed Fixed in Build 0924.
Sign In or Register to comment.