Jump to content

spell that only affects invisible targets?


Recommended Posts

I'd like to create an AoE spell that only affects people who are invisible. Is this possible?

 

It looks like opcode 20 does not set a stat that I can check for, surprisingly. STATE.ids has an entry for "STATE_INVISIBLE" but can 324/326 filter for those states?

 

I guess I could patch all Invisibility spells to set a SpellState... and then... I don't know, have BALDUR.bcs remove it if/when the invisibility goes away? That would be pretty annoying...

Link to comment

Op 324 can check states, IIRC, and enemy/ally can be handled by the projectile.

 

STATE.IDS seems to use hex values... and I notice that all of the existing instances of 0x111 in SPLPROT.2DA use either 8 or 9 ("bit equal" or "bit not equal") in the RELATION column. Are these things related? If I need to add more rows to SPLPROT.2DA for other states, should I be using bit equality?

Link to comment

You want to check bit values because while the target may be under multiple states you only care about one. Checking directly for state = 0x10 means you would miss a creature who's invisible plus any other state like silenced (0x1010, or bit5 + bit13). Every state in kit.ids corresponds to a bit, and the special ones like CD_STATE_NOTVALID are just combos of existing bits.

Link to comment

You can set up an entry with 0x111 -1 8 and another with 0x111 -1 9

 

Then use param1 in the 318/324/326 effect to cover for the real bit value.

Note, there are more binary relational operators, you surely can find the perfect one. They are usable to check more than one bit(s) simultaneously.

Link to comment

All good to know. I'll probably first try the idea of merging the invisibility and Sanctuary effects, so this hopefully won't be necessary for STATE_INVISIBLE.

But I'm also trying to make an "Absorb Infliction" ability which would need to target STATE_DISEASED, STATE_POISONED, and STATE_BLIND, so this is useful.

Edited by subtledoctor
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...