Jump to content

Simple script to apply stat penalties if its snowing?


Guest deleted2027229

Recommended Posts

Guest deleted2027229

Anyone know how I'd do this, ie if its snowing or heavy rain, script adds a custom spell that drains players attributes.

Link to comment
Share on other sites

For vanilla there is a set of commands IsPleasant/IsCloudy/IsRaining/IsSnowing. If you need exact weather for some reason, OBSE has GetCurrentWeatherID function, which can be used like this:

...
ref weather
...

(somewhere in begin/end block)
...
if player.IsInInterior == 0
	set weather to GetCurrentWeatherID
	if weather != 0
		if weather == Clear
			print "It's sunny right now."
		elseif weather == Cloudy
			print "It's cloudy right now."
		elseif weather == Fog
			print "Mist is all around you."
		elseif weather == Rain
			print "Now it's raining."
		elseif weather == Snow
			print "Now it's snowing."
		elseif weather == Thunderstorm
			print "The storm rages on."
		elseif weather == Overcast
			print "Overcast."
		else 
			print "Custom, special defined or Oblivion weather."
		endif
	endif
endif
...
Link to comment
Share on other sites

OK, I made some quest script example using vanilla GetIsCurrentWeather and GetCurrentWeatherPercent commands. Quest itself is set to priority 25 and script attached is:

scn RomRStormSlowingQuestScript
short storm 

begin GameMode
	if player.IsInInterior == 0
		if GetIsCurrentWeather Thunderstorm && GetCurrentWeatherPercent >= 0.08
			set storm to 1
		endif
		if storm != 0 && player.HasSpell AbStormSlowdown == 0
			Message "Storm began to slow you down..."
			player.AddSpellNS AbStormSlowdown
		endif		
		if GetIsCurrentWeather Thunderstorm == 0 && GetCurrentWeatherPercent >= 0.08
			if player.HasSpell AbStormSlowdown != 0
				Message "At last a storm is over..."
				player.RemoveSpell AbStormSlowdown
				set storm to 0
			endif
		endif
	else
		if player.HasSpell AbStormSlowdown != 0 
			Message "You escaped a storm's slowing effects."
			player.RemoveSpell AbStormSlowdown
		endif
	endif
end

As you see this scripts is adding or removing a spell, nothing more. Spell itself is a simple ability with some Drain Atribute effects (speed and agility) defined. Script was tested with ForceWeather command, so you will need propably adjust percentage for coming storm, as ForceWeather command already sets a weather at full transition already. Also you can change OBSE AddSpellNS command for vanilla one, but I found that vanilla workaround to supress messages makes too much delay to add spell in quest for some reason.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...