Curse of Hircine, Real Thirst, Real Hunger and Real Sleep Ex

Post » Fri Apr 08, 2011 6:55 am

This is my first attempt at scripting, so I've obviously made some errors. Help much appreciated. Basically:

There is a spell called cidhealing (or something close) in Curse of Hircine that fires when a werewolf feeds on a corpse.

I have added a scripteffect to the spell in an override patch and tried to change the values of the hunger thirst sleep mods in the script so that the werewolf is completely refreshed. All relevant mods are masters of the patch. Here is the script:

ScriptName cidHungerThirstSleep

float aThirstLevel
short RHLevel
float sleepLevel
short tiredness

BEGIN ScriptEffectStart

if (aThirstQuest.aThirstRegen == 0.0) [This is for Real Thirst, it's just the bottled water script effect. This works]
SetStage aThirstQuest 140
endif
if (RHLevel < 0) [this is an attempt to reset Real Hunger level to 0 - doesn't work]
set RHLevel to 0
Message "My bloodthirst is lessened."
endif
if (sleepLevel < 1) [this is an attempt to set Real Sleep Extended level to 0 - doesn't work]
set sleepLevel to 0
set tiredness to 0
endif

END

The thirst section is fine because it's completely cannibalised from Real Thirst itself (also using the cobl versions of all mods when available).

By the way, for anyone who doesn't know and has problems with Curse of Hircine spamming the 'You cannot unequip this item' message, it has been fixed but not released. Here is the fix for those interested, it's a script called cidwwclawscript. When you change it be sure to indent the code as in the original script:

scn cidwwclawscript

short wait

;; Note: This is also used for the "shield"

Begin OnDrop
;; Have to use a game mode delay, since removing an item the same frame its placed will cause a crash
set wait to 1
End

Begin GameMode
if ( wait >= 1 || GetContainer == 0 )
if ( wait > 1)
if ( GetContainer == 0 )
Disable
set wait to 0
else
RemoveMe
endif
elseif ( wait > 0 )
set wait to wait + 1
endif
endif
End



Cheers!
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Fri Apr 08, 2011 5:51 am

Thansk, this will be useful if I decide to use Curce of Hircine in my next game.
User avatar
Undisclosed Desires
 
Posts: 3388
Joined: Fri Mar 02, 2007 4:10 pm


Return to IV - Oblivion