Jump to content

Multiple Shapeshifting spells/abilities


Caedwyr

Recommended Posts

I've encountered a bug/issue with a fixpacked game regarding shapeshifting spells/abilities.

 

Say, for example one is playing a druid that has the fire elemental transformation HLA or the earth elemental HLA. One can shapeshift into a bear, using the innate druidic shapeshifting ability (adding a Shapeshift Natural Form icon to the innate abilities button) and then shapeshift directly into a Fire Elemental, creating a second Shapeshift Natural Form icon in the innate abilities button. You can then get buggy situations, where if you shapeshift into another animal, or use one of the Shapeshift Natural Form abilities but not the other that you end up with the wrong stats/creature weapons equipped.

 

 

What I'd suggest is to have one Shapeshift Natural form for all the various shapechanging spells and abilities, and avoid the issue of having duplicate Shapeshift Natural form buttons appearing.

 

Spells/abilities I can think of that would need to be modified are the following

 

Polymorph Self

Shapechange

Cloak of the Sewers

Cloak of the Wolf

Avenger Druid Shapeshifts

Shapeshifter Shapeshift

Normal Druid Shapeshifts

Fire Elemental Transformation HLA

Earth Elemental Transformation HLA

Link to comment

We need to fix this by making sure all the original SPINHUM spells do the appropriate cleanup for the new elemental transformation spells. :(

 

It would have been nice had they just made a single spell, yes, but we're stuck with multiples all doing the same thing. Thankfully, there are no druid/mage combos, which reduces the number we need to touch down to about 500 or so.

Link to comment

Is there any reason why it couldn't be altered so that there is only a single spell used shared by the mass of shapeshifting spells instead of multiples? I know for modders who want to add additional shapeshifting, it'd make it much simpler as they'd only need to patch on their additions to the single Shapeshift Natural Form to account for whatever new shapeshifts are used. This may not be a strict fix, but would be very much appreciated in the modders pack.

Link to comment

Players routinely install the modder's pack (it should be entirely removed IMO), and there just isn't any real justification for changing it at this point (I think it's possible, but I've never really looked to closely at the shapeshifting chain o' spells). It would be too easy to break any existing mod that depended on the old behavior; any particular modder can change the system in their own mod as they see fit without us breaking it for everyone else.

Link to comment

For modders, it's pretty much just an issue of COPY_EXISTING ~spin150.spl~ ~override~ ~spin151.spl~ ~override~ and running the same patch; it won't even hurt anything if duplicate removal effects are introduced.

 

For Bg2 in general it's not quite as bad as it looks, since there's no Druid/Wizard multiclass, although slayer change does need an update (I think? It's been a long time).

Link to comment

I remember wishing there was only one return to natural form ability when I was researching how to script a somewhat effective use of Shapechange for the eSeries.

 

I'm not against doing it to streamline things, but would need to update eSeries to allow for the possibility of either scenario.

Link to comment

This'll be ugly.

 

So all of the druid transforms route back to humans via spinhum.spl and spin122-124.spl. Since they can also use Cloak of the Sewers and Cloak of the Wolf, we also need to include spwi491.spl. Slayer change should also be factored in here.

 

For arcane spell casters, I'm inclined to change nothing. The two spells (Polymorph Self and Shapechange) disallow cross-casting, and trying to get the cloaks to interact properly here will not work--the spells allow unlimited changes during the spell duration, so the cloak return-to-human spells shouldn't be nuking Shapechange and Poly Self items and resources. It's just ugly, and there's a high probability of introducing unintended consequences here.

 

Since this may be of use to others, here's the list of items created by all of these transformation spells:

  • b1-20m4 (Slayer)
  • brblp (Druid Shapeshift: black bear)
  • brbrp (Druid Shapeshift: brown bear)
  • druear (Druid HLA: Earth Elemental Transformation)
  • drufir (Druid HLA: Fire Elemental Transformation)
  • earthrn (Shapechange: earth elemental)
  • firern (Shapechange: fire elemental)
  • goliro (Shapechange: iron golem)
  • mindflay (Shapechange: mind flayer)
  • plybear1 (Polymorph Self: brown bear, Polymorph Self: black bear)
  • plyflind (Polymorph Self: flind)
  • plyjelly (Cloak of the Sewers: mustard jelly, Polymorph Self: mustard jelly)
  • plymstar (Polymorph Self: ogre)
  • plysala (Avenger Shapeshift: fire salamander)
  • plyspid (Polymorph Self: spider, Avenger Shapeshift: spider)
  • plytroll (Cloak of the Sewers: troll)
  • plywolf1 (Polymorph Self: wolf)
  • plywyvrn (Avenger Shapeshift: baby wyvern)
  • polyrat (Cloak of the Sewers: rat)
  • slayerwp (Slayer)
  • trollall (Shapechange: giant troll)
  • wolfgr (Shapechange: greater wolfwere)
  • wolfm (Druid Shapeshift: wolf, Cloak of the Wolf)

So, spinhum, spwi491, and spin122-124 need to remove all of the cloak & druid spell items; reenable the Talk, Spell Select and Quick Spell buttons; remove 3x Breath Fireball (spin160, granted by the Fire Salamander form); and remove each other.

 

The transformation spells themselves (and Slayer change) need to remove 3x spin160 and remove the human transformation spells (except their own). They don't need to remove items because their own, created item should overwrite the old item.

 

Cloak of the Wolf also doesn't grant a way to transform back.

 

We good so far?

Link to comment
So, spinhum, spwi491, and spin122-124 need to remove all of the cloak & druid spell items; reenable the Talk, Spell Select and Quick Spell buttons; remove 3x Breath Fireball (spin160, granted by the Fire Salamander form); and remove each other.

 

Rather then remove all items, they destroy the existing magical weapon by creating wolfm and then removing wolfm, as it saves me umpteen new effects and mucho code.

 

// shapeshifting return-to-human spells need to remove all shapeshifted weapons, abilities, etc.
COPY_EXISTING ~spinhum.spl~ ~override~
             ~spwi491.spl~ ~override~
             ~spin122.spl~ ~override~
             ~spin123.spl~ ~override~
             ~spin124.spl~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 SET "fx_delta" = 0
 SET "new_fx_1" = 0
 SET "new_fx_2" = 0
 SET "new_fx_3" = 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
 SET "new_fx_11" = 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%" + "%fx_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%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
     READ_LONG  ("%fx_off%" + 0x08 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "param"
     READ_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "resref"
     // first, purge sound-to-be redundant effects
     PATCH_IF ("%opcode%" = 112) BEGIN // remove item, spell
       DELETE_BYTES ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) 0x30 // delete effect
       SET "fx_delta" = "%fx_delta%" - 1
       SET "index2" = "%index2%" - 1
       SET "abil_fx_num" = "%abil_fx_num%" - 1
     END
     PATCH_IF (("%opcode%" = 279) AND ("%param%" = 7)) BEGIN // reenable talk button
       SET "new_fx_1" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 279) AND ("%param%" = 2)) BEGIN // reenable select spell
       SET "new_fx_2" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 279) AND ("%param%" = 3)) BEGIN // reenable quick spell 1
       SET "new_fx_3" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 279) AND ("%param%" = 4)) BEGIN // reenable quick spell 2
       SET "new_fx_4" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 279) AND ("%param%" = 5)) BEGIN // reenable quick spell 3
       SET "new_fx_5" = 1
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin160" = 0)) BEGIN // remove spell
       SET "new_fx_6" = ("%new_fx_6%" + 1) // increment; should total 3
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spinhum" = 0)) BEGIN // remove spell
       SET "new_fx_7" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spwi491" = 0)) BEGIN // remove spell
       SET "new_fx_8" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin122" = 0)) BEGIN // remove spell
       SET "new_fx_9" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin123" = 0)) BEGIN // remove spell
       SET "new_fx_10" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin124" = 0)) BEGIN // remove spell
       SET "new_fx_11" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END
   END
   PATCH_IF ("%new_fx_1%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 279          // reenable button
       WRITE_LONG   ("%fx_off%" + 0x08 + ("%abil_fx_idx%" * 0x30)) 7            // talk
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_2%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 279          // reenable button
       WRITE_LONG   ("%fx_off%" + 0x08 + ("%abil_fx_idx%" * 0x30)) 2            // spell select
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_3%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 279          // reenable button
       WRITE_LONG   ("%fx_off%" + 0x08 + ("%abil_fx_idx%" * 0x30)) 3            // quick spell 1
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_4%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 279          // reenable button
       WRITE_LONG   ("%fx_off%" + 0x08 + ("%abil_fx_idx%" * 0x30)) 4            // quick spell 2
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_5%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 279          // reenable button
       WRITE_LONG   ("%fx_off%" + 0x08 + ("%abil_fx_idx%" * 0x30)) 5            // quick spell 3
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   FOR (index3 = new_fx_6 ; index3 < 3 ; index3 = index3 + 1) BEGIN // remove 3x salamander fire breath
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin160~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_7%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spinhum~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_8%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spwi491~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_9%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin122~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_10%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin123~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_11%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin124~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   // insert an item creation at top
   INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
     WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
     WRITE_SHORT  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 111          // create item
     WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~wolfm~ #8   // resource
   // at the end, remove the newly created wolfm
   INSERT_BYTES   ("%fx_off%" +        (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) 0x30
     WRITE_ASCIIE ("%fx_off%" +        (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) ~%template%~ // clone
     WRITE_SHORT  ("%fx_off%" +        (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) 112          // remove item
     WRITE_ASCII  ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%abil_fx_num%") * 0x30)) ~wolfm~ #8   // resource
   SET "fx_delta" = "%fx_delta%" + 2
   WRITE_SHORT  ("%abil_off%" + 0x1e + (0x28 * "%index%")) ("%abil_fx_num%" + 2)
 END
 BUT_ONLY_IF_IT_CHANGES

 

The transformation spells themselves (and Slayer change) need to remove 3x spin160 and remove the human transformation spells (except their own). They don't need to remove items because their own, created item should overwrite the old item.

 

// transformation spells themselves need to nuke leftover bits from other transformations
COPY_EXISTING ~spcl611.spl~ ~override~ // druid shapeshift brown bear
             ~spcl612.spl~ ~override~ // druid shapeshift wuff
             ~spcl613.spl~ ~override~ // druid shapeshift black bear
             ~spcl632.spl~ ~override~ // avenger shapeshift spider
             ~spcl633.spl~ ~override~ // avenger shapeshift baby wyvern
             ~spcl634.spl~ ~override~ // avenger shapeshift fire salamander
             ~spcl643.spl~ ~override~ // shapeshifter shapeshift werewolf
             ~spcl644.spl~ ~override~ // shapeshifter shapeshift greater werewolf
             ~spin823.spl~ ~override~ // slayer change
             ~spin852.spl~ ~override~ // slayer change ii
             ~sppr731.spl~ ~override~ // druid hla fire elemental transformation
             ~sppr732.spl~ ~override~ // druid hla earth elemental transformation
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 SET "abil_length" = 0x38
 SET "fx_delta" = 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
 SET "new_fx_11" = 0
 FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
   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%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
     READ_LONG  ("%fx_off%" + 0x08 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "param"
     READ_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "resref"
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin160" = 0)) BEGIN // remove spell
       SET "new_fx_6" = ("%new_fx_6%" + 1) // increment; should total 3
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spinhum" = 0)) BEGIN // remove spell
       SET "new_fx_7" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spwi491" = 0)) BEGIN // remove spell
       SET "new_fx_8" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin122" = 0)) BEGIN // remove spell
       SET "new_fx_9" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin123" = 0)) BEGIN // remove spell
       SET "new_fx_10" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END ELSE
     PATCH_IF (("%opcode%" = 172) AND ("%resref%" STRING_COMPARE_CASE "spin124" = 0)) BEGIN // remove spell
       SET "new_fx_11" = 1
       READ_ASCII ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "template" (48)
     END
   END
   FOR (index3 = new_fx_6 ; index3 < 3 ; index3 = index3 + 1) BEGIN // remove 3x salamander fire breath
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin160~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_7%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spinhum~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_8%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spwi491~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_9%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin122~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_10%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin123~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   PATCH_IF ("%new_fx_11%" = 0) BEGIN
     INSERT_BYTES   ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_ASCIIE ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) ~%template%~ // clone
       WRITE_ASCII  ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin124~ #8 // resref
     SET "fx_delta" = "%fx_delta%" + 1
     SET "abil_fx_num" = "%abil_fx_num%" + 1
   END
   WRITE_SHORT  ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) ("%abil_fx_num%")
 END
 BUT_ONLY_IF_IT_CHANGES

 

Cloak of the Wolf also doesn't grant a way to transform back.

 

// cloak of the wuff needs some work; clean up druid transformation spells and give a return to human innate
COPY_EXISTING ~clck04.itm~ ~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
   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 < 8 ; index2 = index2 + 1) BEGIN
     INSERT_BYTES  ("%fx_off%" +        ("%abil_fx_idx%" * 0x30)) 0x30
       WRITE_SHORT ("%fx_off%" +        ("%abil_fx_idx%" * 0x30))       172 // opcode: remove spell
       WRITE_BYTE  ("%fx_off%" + 0x02 + ("%abil_fx_idx%" * 0x30))         1 // target: self
       WRITE_BYTE  ("%fx_off%" + 0x0c + ("%abil_fx_idx%" * 0x30))         1 // instant/permanent
       WRITE_LONG  ("%fx_off%" + 0x12 + ("%abil_fx_idx%" * 0x30))       100 // probability
       WRITE_ASCII ("%fx_off%" + 0x14 + ("%abil_fx_idx%" * 0x30)) ~spin160~ // probability
   END
   WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + 3) * 0x30)) ~spinhum~
   WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + 4) * 0x30)) ~spwi491~
   WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + 5) * 0x30)) ~spin122~
   WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + 6) * 0x30)) ~spin123~
   WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + 7) * 0x30)) ~spin124~
   // finally, add return-to-human innate
   INSERT_BYTES  ("%fx_off%" +        (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30)) 0x30
     WRITE_SHORT ("%fx_off%" +        (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30))       171 // opcode: give innate ability
     WRITE_BYTE  ("%fx_off%" + 0x02 + (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30))         1 // target: self
     WRITE_LONG  ("%fx_off%" + 0x0e + (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30))       120 // duration
     WRITE_LONG  ("%fx_off%" + 0x12 + (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30))       100 // probability
     WRITE_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%abil_fx_num%" + 8) * 0x30)) ~spinhum~ // probability
   WRITE_SHORT  ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) ("%abil_fx_num%" + 9)
   SET "fx_delta" = ("%fx_delta%" + 9)
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...