[MOD] Sleep Fix
_Luke_
Member, Mobile Tester Posts: 1,535
Sleep Fix
Download from GitHub
Introduction
So, as you surely may have noticed, powerful spells such as Earthquake cannot knockdown humanoid Skeletons, Zombies, Golems and the like.
Similarly, if you're protected by spells such as Chaotic Commands, in addition to being protected by Mind-Affecting effects (Sleep, Charm, etc...), you're also protected by the knockdown effect from Earthquake-like spells (which is bad/incorrect).
All of this is due to the fact that there is a unique Sleep/Unconsciousness opcode.
It is used for Mind-Affecting effects (Sleep, Unconsciousness, Hopelessness), Nausea (Stinking Cloud and the like), Wing Buffet (DRAGON_WING_BUFFET, Staff of the Ram, etc...) and general Knockdown (Earthquake-like attacks). As you can see, unrelated attacks share the same opcode, and this causes the aforementioned issues.
Thanks to kjeron (once again!), I managed to put together this mod. It attempts to "fix" this situation by giving each Sleep effect its intended purpose.
There are some exceptions though: the following creatures
- Demogorgon, Belhifet, Luremaster, Bhaal (boss creatures)
- "Spirits/Ghosts" (Ghost Dragon, Shaman/Druid Spirits)
I'm not sure what to do with them... I'll probably add an option to patch them if someone really wants to...
Unfortunately, the patching process cannot be fully automated (feel free to correct me if I'm missing something), so don't hesitate to leave a message here in case something is incorrectly identified/patched.
In particular, I need help with:
- mod-added items/spells that grant immunity to Sleep
- mod-added Earthquake-like items/spells
These two categories of resources need to be patched manually (for best results), so if you know mods that add those resources, tell me and I'll add them to my list.
Compatibility
The mod supports the following games and game variants:
- BG:EE (with or without SoD)
- BG2:EE
- IWD:EE
- EET
@CamDawg @Galactygon Feel free to refer to this when you look at application of opcode 39 for v2.7.
I'm not sure how you will tackle this issue for v2.7, but what about implementing a "bypass op101" mode for opcode 39 (via `parameter1` which is currently unused)? The Panic opcode can already do that, maybe that feature can be useful in this case as well...
IMPORTANT!!!: When downloading from GitHub, always remember to download the latest release if available, as the master branch might contain untested changes.
5
Comments
Changelog:
May we get this mod added to the EET Compatibility List[/url[]?
Thankee!
This mod should be perfectly compatible with EET...
Changelog:
d2swd01.itm
d2swd02.itm
I have the effects directly on the melee attack.
Hi @dp85 , you might want to set the `resist_dispel` field (@0xD) of op235 and op39s to either 0 (Natural/Nonmagical) or 2 (Not dispel/Bypass resistance).
As of now, op235 qualifies as "Natural/Nonmagical" whereas op39s qualify as "Not dispel/Bypass resistance". That's why my automated code is currently failing to correctly patch them (the same holds for vanilla "balth01.spl", where I make sure the values are equal before patching it... Hmm, now that I think of it, maybe I should do something on my end... I mean, 0 and 2 are basically the same after all...)
Edit: update with new version, with resist field all set to 0. Thanks for letting me know. I prefer things to be more consistent anyways.