temnix Posted April 28, 2021 Share Posted April 28, 2021 (edited) 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 April 29, 2021 by temnix Quote Link to comment
Luke Posted April 29, 2021 Share Posted April 29, 2021 (edited) 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 April 29, 2021 by Luke Quote Link to comment
temnix Posted September 12, 2021 Author Share Posted September 12, 2021 (edited) Never mind. Edited September 12, 2021 by temnix Quote Link to comment
Recommended Posts
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.