polytope Posted October 28, 2022 Share Posted October 28, 2022 (edited) Basically I'm trying to set up monsters with unusual poisons. Their attack has the following effects: Poison (usually of a mild damage over time) Casts a spell at the target (same saving throw as the poison) Aforementioned spell sets the local variable POLYPOISON to 1 for the venomous attacker and applies a short duration detectable state on the target In the monster's script, if POLYPOISON = 1, and it can see a nearby creature with both STATE_POISONED and the other detectable state, then it sets POLYPOISON to zero and instantly fires a spell with the additional effects like paralysis, ability score reduction etc. at the creature. If POLYPOISON = 1 and no nearby creature is actually poisoned (probably because they're immune to poison) the script sets it back to zero. Can anyone suggest a better implementation? I want to respect poison immunity vs the secondary effects of a venomous bite/sting, the other obvious way to do it is regexp patching any creature or item or spell with 100% RESISTPOISON or #101 vs opcode #25 and applying #206 (if externalized as a spl) or #324 immunity vs the secondary spell. I really dislike globally patching things and of course it won't work for any mod added cre/itm/spl coming later in the install order. My solution has worked thus far, the main problem is that strange things can happen if the venomous creature is attacking while not running its usual scripts, i.e. because it is charmed, confused or berserk. Currently I've just given them immunity to those effects, then again, maybe such immunities are fine; it's plausible for cold-blooded, venomous, predators to be unswayed by charm, unmoved by anger, ignore distractions (like confusion) etc... Things that cure poison also don't remove the secondary effects for now, unless I patch all items/spells with opcode #11 to use a #321 to remove effects, as above. I'm less bothered by this, because curing poison has never reversed the damage it's already done. Edited October 28, 2022 by polytope Quote Link to comment
jmerry Posted October 28, 2022 Share Posted October 28, 2022 Basically every poison effect in the game has a 324 filter already. That's the standard method; no need to do things any differently here. You can get some debilitating effects with disease (opcode 78) rather than poison, in the form of ability score reductions and slowing. For other effects, you have to be more indirect. And of course, those other effects won't be removed automatically by effects that cure poison/disease. Quote Link to comment
polytope Posted October 28, 2022 Author Share Posted October 28, 2022 6 minutes ago, jmerry said: Basically every poison effect in the game has a 324 filter already. That's the standard method; no need to do things any differently here. Since when? It's fine for Cloudkill but how do you handle Storm of Vengeance, with elemental damage unrelated to the poison and a slay effect tenuously connected? 8 minutes ago, jmerry said: You can get some debilitating effects with disease (opcode 78) rather than poison, in the form of ability score reductions and slowing. I was aware, but while immunity to disease usually goes hand in hand with immunity to poison (except for monks who get the former earlier) the reverse is not true, someone wearing the periapt of proof against poison or wielding Albruin can't be poisoned and is totally susceptible to diseases. Quote Link to comment
jmerry Posted October 28, 2022 Share Posted October 28, 2022 1 hour ago, polytope said: Since when? It's fine for Cloudkill but how do you handle Storm of Vengeance, with elemental damage unrelated to the poison and a slay effect tenuously connected? The effects of Storm of Vengeance, in order, without any mods affecting the spell: 0. Fire damage with delay 0 1. Electric damage with delay 0 2. Acid damage with delay 0 3-5: Fire, electric, acid damage with delay 6 6-8: Fire, electric, acid damage with delay 12 9. 318 filter with duration 0; poison immune creatures get immunity to this spell. 10. 318 filter with duration 0; undead and golems get immunity to this spell. 11-13: Visual effect, sound effect, and Slay with an 8 HD limit. 14-15: Poison and associated portrait. There. That's how you do it. The elemental damage always applies, while the slay and poison effects are ignored by poison immunes, undead, and golems. If you have effects that you don't want to be blocked by the 318/324 filter, you just set the ordering to make that happen. Quote Link to comment
polytope Posted October 28, 2022 Author Share Posted October 28, 2022 (edited) #318 though, not #324 patching. #318 has a different function on the original game engine with ToBEx versus EE, hence why it wasn't my first choice. Easy enough to package two separate versions for EE and original since the EE utility in fairness seems more robust. I'm also skeptical about the logic in the new version of Storm of Vengeance, with Cloudkill it's obvious that low HD creatures shouldn't be slain by a cloud of poisonous gas if they're immune to poison, but not obvious that a storm that's also poisonous shouldn't sweep them away. An air elemental''s whirlwind (SPIN973) also auto-kills low HD creatures, and has nothing to do with poison. Edited October 28, 2022 by polytope Quote Link to comment
subtledoctor Posted October 28, 2022 Share Posted October 28, 2022 (edited) 1 hour ago, polytope said: 'm also skeptical about the logic in the new version of Storm of Vengeance, with Cloudkill it's obvious that low HD creatures shouldn't be slain by a cloud of poisonous gas if they're immune to poison, but not obvious that a storm that's also poisonous shouldn't sweep them away. Note the effect order - 318/324 only protects from effects lower/later in the stack. If you think the Slay effect or more likely connected to the fire or electric or acid damage, or just a whoosh of divine justice alongside them all, then you can simply move the Slay effect above the 318s. Bob's your uncle. 4 hours ago, polytope said: Poison (usually of a mild damage over time) Casts a spell at the target (same saving throw as the poison) Aforementioned spell sets the local variable POLYPOISON to 1 for the venomous attacker and applies a short duration detectable state on the target In the monster's script, if POLYPOISON = 1, and it can see a nearby creature with both STATE_POISONED and the other detectable state, then it sets POLYPOISON to zero and instantly fires a spell with the additional effects like paralysis, ability score reduction etc. at the creature. I don't understand the point of using a script here? Why not just apply the secondary effect in that spell, and do filtering there for poison resistance. Ah, wait - seems like unspoken here is "Can anyone suggest a better implementation for the non-EE engine?" You can't do 318/324-style filtering there, even with ToBEx AFAIK. Honestly, in that case I would not shy away from global patching. Plenty of mods use global patching and have to be installed after creatures/spells/items. CDTweaks is an example, and it doesn't exactly suffer for that. This is just one reason why install order is important. If the alterative is to apply simple spell effects by scripting subject to interruption, I would choose global patching any day of the week. Edited October 28, 2022 by subtledoctor Quote Link to comment
polytope Posted October 28, 2022 Author Share Posted October 28, 2022 Yes, I'd prefer engine independent fixes otherwise I'm complicating things with an extra directory in the setup (which I'll forget about at some point). It seems unlikely to have a clean solution on the original engine. 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.