Jump to content

OBC Reminder: Spell Immunity not stacking


Recommended Posts

I'd do it, but what's the best way? I've always been incredibly bad at getting spells effects to remove when I want them to.

 

(While I remember, has anyone else ever managed to dispel anything by secondary type, because I certainly can't make it work.)

Link to comment
(While I remember, has anyone else ever managed to dispel anything by secondary type, because I certainly can't make it work.)

It's used in Refinements (the Second Wind HLA for Monks) and in TB#Tweaks (the standard petrify/unpetrify technique, but not working ATM in cutscenes and already-petrified creatures a la Branwen).

Link to comment

Ouch, eheh ;)

 

Refinements uses secondary type, though. See the attached file if you don't have Ref on the ready - tg#secw is the ability you launch, which will cast tg#sec2 when your health is < 10%; tg#sec2 heals you and removes the effects secondary type 50 (I.E. tg#secw).

 

BTW, we should start a Secondary and Primary type reservation centralized database ;)

 

EDIT: attachment removed, PM if you need this (or download Refinements).

Link to comment
I'd do it, but what's the best way? I've always been incredibly bad at getting spells effects to remove when I want them to.

I think we should just go the lazy way and an protection from spell effect that prevents multiple applications, like we do with a number of other spells (doom, defensive harmony, etc.).

 

edit: Here we go.

 

// spell immunity should not be able to protect from more than one school
COPY_EXISTING ~spwi590.spl~ ~override~ // spell immunity: abjuration
             ~spwi591.spl~ ~override~ // spell immunity: conjuration
             ~spwi592.spl~ ~override~ // spell immunity: divination
             ~spwi593.spl~ ~override~ // spell immunity: enchantment
             ~spwi594.spl~ ~override~ // spell immunity: illusion
             ~spwi595.spl~ ~override~ // spell immunity: evocation
             ~spwi596.spl~ ~override~ // spell immunity: necromancy
             ~spwi597.spl~ ~override~ // spell immunity: alteration
 PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
   READ_LONG  0x64 "abil_off"
   READ_SHORT 0x68 "abil_num"
   READ_LONG  0x6a "fx_off"
   READ_LONG  0x34 "level"
   SET "delta" = 0
   FOR (index = 0; index < abil_num; index = index + 1) BEGIN
     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%" + "%delta%")
     WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%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%" = 204) BEGIN // protection from school effect
         READ_ASCII ("%fx_off%" +        (0x30 * ("%abil_fx_idx%" + "%index2%"))) "clone" (48) // clones effect
         SET "index2" = "%abil_fx_num%" // kills FOR loop
         INSERT_BYTES            ("%fx_off%" +        (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 0x30
           WRITE_EVALUATED_ASCII ("%fx_off%" +        (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) ~%clone%~    // dupes opcode 204 effect
           WRITE_SHORT           ("%fx_off%" +        (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) 206          // protection from spell
           SAY                   ("%fx_off%" + 0x04 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) @114         // ~You cannot cast...~
           WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) ~spwi510~ #8 // spell immunity
         SET "delta" = ("%delta%" + 1)
         WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) ("%abil_fx_num%" + 1)
       END
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

If that's what he was talking about, it looks good. I'd want to test and make sure that it works with the select spell ability used in 510, though (I imagine it does, but who knows?).

 

EDIT: I was afraid of that. Luckily, I don't think it can be easily done. I suppose giving each a unique secondary type, and then updating all items and spells with the remove protections effect (hopefully not messing up too many mod items) could work, but it's a tad sketchy.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...