Jump to content

Setting special saving throw parameters


temnix

Recommended Posts

I want to use Weidu to set flags for a bunch of effects to Ignore secondary target (bit 11) and Ignore difficulty (bit 25). How can I do that? It's possible to use "savingthrow = BIT11 | BIT25," but this eliminates the actual already set saving throw type, usually 0 (vs. spell). If I write "savingthrow = BIT0 | BIT11 | BIT25," I get all three, but this assumes that the saving throw is indeed vs. spell. In most cases for this particular effect it will be, but there is no guarantee. How do I add flags without touching the existing save type? It looks like ALTER_SPELL_EFFECT only rewrites saving throw values, it can't add them.

Edited by temnix
Link to comment
12 hours ago, temnix said:

How do I add flags without touching the existing save type?

"savingthrow = THIS | BIT11 | BIT25" (you can find more details in this post, towards the end...).

However, you cannot use it with ALTER_SPELL_EFFECT and the like, so you might want to cycle through the current effect(s) with something like GET_OFFSET_ARRAY / GET_OFFSET_ARRAY2, i.e.:

Spoiler


COPY_EXISTING myitem.itm override
  GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS
  PHP_EACH ab_array AS int => ab_off BEGIN
    GET_OFFSET_ARRAY2 fx_array ab_off SPL_V10_HEAD_EFFECTS
    PHP_EACH fx_array AS int => fx_off BEGIN
      READ_SHORT fx_off fx_type
      PATCH_IF fx_type = 12 BEGIN
        WRITE_LONG (fx_off + 0x24) (THIS | BIT11 | BIT25)
      END
    END
  END
BUT_ONLY

 

 

Edited by Luke
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...