Ok so I mixed your stuff with the script from the vault that Vivienne suggested above:
https://neverwintervault.org/project/nwn1/script/desert-heat-242
This combined scripting does work. When you exit the area the effect (the continuing damage stops) but, you still have the constitution and strength reduction and slow effects until you use a Greater Restoration (which removes the Const and Str decreases and then you have to rest to remove the slow effect).
I like your point damaging system much much better than his. Also, his “SendMessageToPC” I am leaving in as it shows in the bottom left hand box more detail of what is going on. I included your "string sThirsty = “Whew…it’s so hot and I’m thirsty and tired.”; because I like to see the PC speak about his being thirsty and tired.
I put those strings in two places (see script) I wish I could put different strings of sayings alongside each yellow description that shows up in the lower box. Like I mentioned in my list above. Don’t know if you or some other scripter can do that.
I did manage to add the (vault script) onactivateitem module event script (his part) to the bottom of my current onactivateitem script. I need to test his water system AND make sure I didn’t break my items (make sure they still work) when activating them since I am not so good at scripting.
I will do further testing.
I noticed with the mixed script below in testing that the Constitution never dips below 9 (it somehow manages to get down to 9 then bounces back up to 10. While strength goes down as far as 9. I would like to keep making these go down.
I love your damage as the damages keep increasing…even after drinking potions of Cure Critical wounds. Drinking “Heals” cures everything but the slow effect. yet even after a heal…the damage numbers continue to increase (they never stopped). I like this. I think the only way it should stop is by drinking the water which I need to figure out how to use his scripts to do that.
So when I get a chance tomorrow…I will test how the drinking water works.
The improved script below for the OnEnter (area):
///////////////////////////////////////////////////////
// DESERT HEAT 2.0 - OnAreaEnter
// By Deva Bryson Winblood
// 10/10/2003
///////////////////////////////////////////////////////
////////////////////////////
// Prototypes
////////////////////////////
void fnHeatEffects(object oPC,object oArea);
//////////////////////////////////////////// MAIN
void main()
{
object oPC=GetEnteringObject();
object oIntensity=GetNearestObjectByTag("DH2_INTENSITY",oPC);
object oArea=GetArea(oPC);
int nIntensity=30;
if (oIntensity!=OBJECT_INVALID)
nIntensity=StringToInt(GetName(oIntensity));
SetLocalInt(oPC,"DH2_Intensity",nIntensity);
if (nIntensity<5) nIntensity=30;
if (GetIsNight()==TRUE&&GetWaypointByTag("DH2_DAYNIGHT")!=OBJECT_INVALID) nIntensity=nIntensity*2;
if (GetIsPC(oPC)==TRUE)
{ // is PC
DelayCommand(IntToFloat(nIntensity),fnHeatEffects(oPC,oArea));
} // is PC
}
//////////////////////////////////////////// MAIN
///////////////////////////
// Functions
///////////////////////////
void fnHeatEffects(object oPC,object oArea)
{
int nHeat;
effect eCon=EffectAbilityDecrease(ABILITY_CONSTITUTION,1);
effect eMov=EffectMovementSpeedDecrease(20);
effect eStr=EffectAbilityDecrease(ABILITY_STRENGTH,1);
effect eLight=EffectVisualEffect(VFX_IMP_DAZED_S);
effect eFull=EffectVisualEffect(VFX_IMP_SLOW);
int nDamage = GetLocalInt(oArea, "damage");
nDamage = nDamage + 2;
SetLocalInt(oArea, "damage", nDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_DIVINE), oPC);
if (GetArea(oPC)==oArea)
{ // still in same area
//SendMessageToPC(oPC,"fnHeatEffects("+GetName(oPC)+","+GetName(oArea)+") current area:"+GetName(GetArea(oPC)));
nHeat=GetLocalInt(oPC,"DH2_HeatLevel");
nHeat=nHeat+1;
SetLocalInt(oPC,"DH2_HeatLevel",nHeat);
string sThirsty = "Whew…it’s so hot and I’m thirsty and tired.";
AssignCommand(oPC, ActionSpeakString(sThirsty));
if (nHeat==2)
SendMessageToPC(oPC,"You are starting to feel thirsty.");
else if (nHeat==3)
SendMessageToPC(oPC,"You need a drink of water soon.");
else if (nHeat==4)
{
SendMessageToPC(oPC,"You are extremely thirsty.");
ApplyEffectToObject(DURATION_TYPE_INSTANT,eLight,oPC,5.0);
}
else if (nHeat>4)
{ // suffer heat problems
SendMessageToPC(oPC,"You are suffering from thirst");
string sThirsty = "Whew…it’s so hot and I’m thirsty and tired.";
AssignCommand(oPC, ActionSpeakString(sThirsty));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eCon,oPC,140.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eMov,oPC,130.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStr,oPC,120.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFull,oPC,5.0);
} // suffer heat problems
nHeat=GetLocalInt(oPC,"DH2_Intensity");
if (GetIsNight()==TRUE&&GetWaypointByTag("DH2_DAYNIGHT")!=OBJECT_INVALID) nHeat=nHeat*2;
DelayCommand(IntToFloat(nHeat),fnHeatEffects(oPC,oArea));
} // still in same area
} // fnHeatEffects()