Jump to content

Sleep spell


Salk

Recommended Posts

Hello!

 

The question is simple: is it safe to overwrite the Baldur's Gate Sleep spell (.spl) with the Icewind Dale's version?

 

The latter is way better in that it makes the affected creature awaken immediately after being hit instead of lay and let himself be slaughtered for the whole duration of the spell.

 

For that reason, I'd like to do the swap and use Icewind Dale's version of Sleep for my BG game.

 

Has anybody ever tried doing something like this?

 

Could there be techincal incompatibilities or will it be safe?

 

Thanks!

Link to comment

It probably wouldn't be quite that simple, since the IWD spell might make use of resources unavailable in BG by default.

 

Can you attach or send me the .spl file - just export it from NI or DLTCEP. I don't have IWD so I can't look at it.

 

The safest way of course would be to patch the BG spell so that it emulates the IWD spell.

Link to comment

It isn't going to do what you want, unfortunately.

 

The difference between the two games is actually in the definition for the sleep effect, which is located not in a .spl file but in the .exe. Icewind Dale happens to define sleep such that it breaks when damage is taken, Baldur's Gate II does not.

Link to comment

Yeah, I kinda figured it was an engine limitation.

 

Apart from that, there are some differences in the IWD version:

  • Has no elven sleep resistance effects that I can see (might be built into the engine)
  • Has no saving throw (BG version is vs. Death/Poison -3)
  • Is not a "hostile spell" (maybe this is a BG-only flag)
  • Spell animation is different (plays opcode 233 Icewind Visual Spell Hit, which maps to a proficiency modifier opcode in BG2)

So even if you could overwrite or patch the BG version, it wouldn't have much effect and might hose your game. Maybe you can get Ascension64 to do some more .exe hackery...

Link to comment
[*]Has no saving throw (BG version is vs. Death/Poison -3)

 

Shouldn't it be +3 against Death/Poison?

 

And no, poor Ascension64 has already worked miracles for me in the past and I put already too much pressure on him with all kinds of requests.

 

Really, I feel I have already abused of him too much.

 

Hm... :p

 

Please do not misinterpret my words here.

Link to comment
It isn't going to do what you want, unfortunately.

 

The difference between the two games is actually in the definition for the sleep effect, which is located not in a .spl file but in the .exe. Icewind Dale happens to define sleep such that it breaks when damage is taken, Baldur's Gate II does not.

 

Thank you for one more clear and exhaustive explanation, Nythrun!

 

I guess I can't say "You're the man!" but you know what I mean...

Link to comment
Shouldn't it be +3 against Death/Poison?
It says -3.

 

It is -3. That's why it's such a lethal spell at low levels (it doesn't affect 5th level characters and up, of course).

 

I don't actually mind the malus. It's the fact that you don't awaken even after being hit that I find unacceptable... :p

Link to comment
Apart from that, there are some differences in the IWD version:

[*]Has no elven sleep resistance effects that I can see (might be built into the engine)

 

Actually, as far as I know, IWD1 is the only IE game which tried to implement the Elven innate resistances. Try casting a Charm Person on an Elf in IWD and you'll get an "Unaffected by Charm Person" message. However, Dire Charm seems to work on elves normally, and the Sleep resistance appears to be completely absent. :p

Link to comment

Thanks to Avenger who have fixed the Cure Sleep effect it should be possible to make sleeping characters awake when attacked.

 

I've tried attaching a Cast Spell on Condition (232) - Cure Sleep (2) on hit but it doesn't work as enemies seem to consider the spell itself as an attack in order to fulfill the requirement for being awaken ---> which translate in them not even fall sleep because they are immediately awakened!

 

Any suggestion?

 

- Edit -

 

Actually i've found a way to solve it but it's sub-optimal: the spell has to be not flagged as "hostile spell"...which however means that sleep spells will not break invisibility.

Link to comment

Ascension64 has suggested adding an awaken effect to every single weapon/spell in the game that does damage. Aside from being a bit cludgy, Nythrun pointed out this would also "awaken" people from other spells that use the unconscious opcode, like Stinking Cloud and Emotion (though I would probably look at reimplementing that first spell, since it's only supposed to make victims unable to attack, not unable to move).

One way to make this behaviour occur is to fix the Awaken opcode (0x2) in the way that Avenger suggested (http://forums.gibberlings3.net/index.php?showtopic=12050) and apply an ability to every damage-dealing item or spell. I tested this by manually adding the Awaken to the Quarterstaff and hitting a sleeping Xvart (after applying a patch to BGMain.exe). The Xvart wakes up just fine. I'm checking to see whether using Awaken on a non-sleeping creature causes any interference with the creature's actions (apart from spellcasting failure from damage, of course).

 

However, this approach might be impractical since we have to patch every item/spell that actually does damage. It would be better to apply something extra to only those things that cause sleep. The Awaken effect would need a DamageTaken() or similar trigger, so that means scripting appears the only way. Unfortunately, using a set AI script opcode won't do because some creatures affected by sleep may use all script types.

I'm not sure if the second option can be implemented without cramming more junk in baldur.bcs or the like.
Link to comment

Imo the best solution is to implement a "cast cure-sleep if hit" attached to spells which are supposed to cause sleep state as i've done. There's no reason to patch all weapon in game if spells itself have that effect and it doesn't cause unconscious enemies to awake if hit.

 

I'm not sure but i think Emotion and Greater Command are supposed to cause unconsciousness...

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...