Oh, and going through an interior door fixed it.
Now that's something I may be able work off of, thanks.
pcref->xRemoveSpell lastid
pcref->xRemoveSpell lastid
set lastid to nightidset NightDarkness to LIN_NightDarknesssetx nightid to xStringBuild "LIN_DWN_%d" NightDarknessto that:
set prevNightDark to NightDarknessset NightDarkness to LIN_NightDarknesssetx nightid to xStringBuild "LIN_DWN_%d" NightDarknesssetx lastid to xStringBuild "LIN_DWN_%d" prevNightDarkwould solve this problem.
long templong lastidlong thisid...setx temp to xStringBuild "LIN_DWN_%%d"...setx thisid to xStringBuild temp NightDarknesssetx lastid to xStringBuild temp prevNightDark...setx thisid to xStringBuild temp HalfDarknesssetx lastid to xStringBuild temp prevHalfDark... setx thisid to xStringBuild temp StormDarknesssetx lastid to xStringBuild temp prevStormDarkNote that second '%' in first xStringBuild is required to get it to work properly, and you changed 'nightid', 'halfid', and 'stormid' at xAddSpell and xRemoveSpell to 'thisid'.
set prevNightDark to NightDarknessset NightDarkness to LIN_NightDarkness, etc. (a line before 'set NightDarkness' is missing) for each of mentioned variables. Currently they have always got value of 0, so the darkness spells will be stacking.
long stormidlong nightidlong halfid