Jump to content

[bug?] Some spells lack the 'hostile' flag


DavidW

Recommended Posts

I also posted a thread about this. And it's not just area spells that have issues with the "hostile" flag. Item abilities and single-target spells should also be checked. For example, the wand of paralyzation's ability isn't flagged as hostile - which means you can use it on a neutral NPC and they won't get mad until they fail a save. And Magic Missile isn't hostile - you can cast Magic Missile at a mage with Shield up and they won't care even though you're clearly targeting them with an attack spell.

Link to comment

Bumping this (necroposting) because this has been on my mind occasionally and there's no really good solution that's within the scope of the fixpack. A bunch of 206s is a bandaid solution since you have to account for spell duplicates and mods will have to be diligent with iterations and duplicates.

The ideal solution would be to fix opcode 102 to be able to block all effects regardless of this flag with the following exceptions:

  • self- (1) and original caster- (9) targeted effectsshi
  • party- (3), global- (4), not party (5), kin to source (6), kin to target (7) if the caster happens to be included in those groups
  • and pre-target (2) if the caster is the target but the projectile is single-target

So effects carried by area of effect projectiles should be blocked where the target is (2). Then this relationship with the hostile flag can be removed.

It would be an extra nifty feature if the opcode could discriminate based on where the explosion point occoured relative to the creature being protected so it can block effects if the explosion occoured beyond a certain distance (unused param2 can be used). i.e. if you cast a fireball centered onto yourself but param2 is nonzero then it affects you.

Another shortcoming for this opcode is how it's restricted to values of (0/1?)-9. If it could handle any value up to 255 then we can create a new category of magical effects i.e. from potions and some on-hit effects that are "levelless" yet still magical and could be blocked by effects such as Antimagic Shell. Whichever these effects would be is another discussion.

Edited by Galactygon
Link to comment
On 9/20/2023 at 12:25 PM, Galactygon said:

It would be an extra nifty feature if the opcode could discriminate based on where the explosion point occoured relative to the creature being protected so it can block effects if the explosion occoured beyond a certain distance (unused param2 can be used). i.e. if you cast a fireball centered onto yourself but param2 is nonzero then it affects you.

What do you mean exactly here...?

Link to comment
On 9/26/2023 at 10:38 PM, Luke said:

What do you mean exactly here...?

Let me try to explain with an example. I gave it a bit more thought so this concept is slightly modified.

A hypothetical use of param2 (if nonzero) for that function would somewhat approximate a physical protective globe around the caster for all effects that are delivered via a projectile or global/party/same as kin/etc. For example, if it's set to 5, then it would make the following checks:

1. if the projectile used by a blockable effect is single-target but not a line (i.e. scorcher) or a path (i.e. lightning bolt), then check if the caster of the projectile is within 5 feet before blocking it. If the caster of the single-target projectile is the same as the protected creature then the distance is 0 and the effects will always get through.

2. If the projectile used by a blockable effect is area of effect or single target but line or path projectile, then look at both the distance between the caster of the projectile and protected creature as well as the point of explosion and protected creature. If both are less than 5 then the effects get through.

3. If the effects aren't delivered via a projectile (i.e. global/party/kin/etc) then only the distance between the caster and the protected creature are measured.

If the caster is the protected creature then the distance is 0 and if the caster targets the projectile onto him/herself then that distance as well is 0. So if we use (DistanceCaster <= param2 && DistanceExplosionPoint <= param2) then a caster centering fireball onto him/herself will be hurt, which for the most part preserves original behavior. Of course the player wouldn't be able to do that because the Fireball always targets a nearby area so the measured distance would never be zero. But a wizard using Invisibility 10-foot would be able to hide himself after casting MGoI, since Invisibility 10-foot is a self-centered spell. If it's another wizard doing the casting, then Invisibility 10-foot would be blocked as it should be.

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...