Jump to content

The "hostile" flag on spells/item abilities is underused


Recommended Posts

First, what's this about? That "hostile" flag does two things that I'm aware of: anything with it that hits a creature activates the "attacked by" script trigger, and anything without it bypasses level/school/sectype protections when applied to the caster. This lack of a "hostile" flag is why there are specific spell protections on stuff that provides protection to a class of spells. Demiliches get specific protection against Incendiary Cloud on their item which already provides immunity to level 8 spells, because otherwise a cloud they cast themselves could hurt them. Change the spell to be hostile, and that effect isn't needed anymore.

A lack of a "hostile" flag can also allow for some very cheesy tricks based on the other effect here. For example, the Wand of Paralyzation's ability isn't currently flagged hostile. In my speedrun, I had my character's ferret familiar equip such a wand, walk into Sarevok's sight, and start using the wand. He saves? No need to do anything, that wasn't an attack. He fails his save? That was an attack, so now he goes hostile ... but he's also stunned, so the summoned monsters beat him to death in complete safety.

As a general rule here, I'd say that if the primary effect would register as an attack and cause neutral NPCs to go hostile immediately, the spell/ability should be flagged as hostile. Magic Missile should be considered a hostile spell, even if a mage with Shield up absorbs it completely. Single-target spells and effects that you want to hit enemies with should also be considered hostile, even if their effect wouldn''t do it on its own. Spells with party-friendly projectiles don't really matter here; the issues we care about only come up when the spell hits the caster or a neutral/friendly NPC. They might still be worth changing for consistency; I don't think it hurts to have just about anything that only targets enemies flagged as hostile.

One specific thing to note: charm spells/abilities need to lack the "hostile" flag. With the flag, they break themselves immediately.

I've gone through the level 1 through 5 mage spells available to players in BGEE comprehensively.

Spells that aren't hostile but should be:

Mage 1: Burning Hands, Larloch's Minor Drain, Magic Missile. Note that the "drain to caster" effect of LMD is handled with a flag on the damage effect; it doesn't need to bypass caster protections.

Mage 2: Aganazzar's Scorcher, Melf's Acid Arrow.

Mage 3: Flame Arrow, Skull Trap, Vampiric Touch. Skull Trap is the first spell that gets exceptions written into spell protections.

Mage 5: Cloudkill, Cone of Cold, Sunfire subspell

There are also some optional changes for consistency on party-friendly spells: Horror, Hold Undead, Slow, Confusion, Teleport Field, and Hold Monster could/should be flagged as hostile. After all, Hold Person already is.

Link to comment

I'm not against many of these, but a common counterargument I've seen come up over the years is that the party's reputation shouldn't be penalized because a Neutral's AI script had them randomly walk into an area of effect spell like Cloudkill.  Thematically, that would be on them, not you.


Link to comment

If that neutral character walks into the Cloudkill, they're already getting mad at you unless they're fully immune (for example, through poison immunity). The damage opcode is always considered an attack, regardless of the amount dealt. And really, if you're crazy enough to throw a Cloudkill around on the city streets or something, you deserve the reputation penalties. And the law coming after you.

If you want to throw down battlefield effects in populated areas, you use spells like Grease, Stinking Cloud, or Web. Those aren't flagged as hostile, and their effects don't automatically count as attacks if successful.

Link to comment
6 hours ago, subtledoctor said:

I'd be pretty mad if someone cast Stinking Cloud near me.

Though, now I think about it, I do that to my wife often enough and she hasn't gone red-circle yet. So I guess not a bug.

oh geez i laughed so hard, you made my day 🤣

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.

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