Jump to content

Script - Sunlight Restoration


MCmamont

Recommended Posts

Hello, I have a little problem with spells and magical effects in Oblivion.

I wanted to give plants rece the ability to restore power while on the sunlight. In fact, the opposite effect Sun damage (vampires), who, instead of fire damage imposed to restore stamina, depending on the light conditions. But I have not found a script describing the mechanism of sun damage.

You can help me?

Also, I wanted to give the effect of restoring mana when placed in water, but it is not so important.

Thanks in advance and sorry for my terrible English.

Link to comment
Share on other sites

Last time I checked sun damage was a Vanilla spell effect. That means it is hardcoded just like everything else Vampire in the game engine. You cannot mess with it or change it, or look up how it's done.

You could not find any Vampire Sun Damage related scripting up to now, because there is none. It simply isn't 'scripted'.

 

You can, however, very likely create a Scripted Spell Effect for your own implementation of Sun Damage or Sunlight Restoration which does exactly what you want.

I'm just not sure exactly which scripting functions there are to achieve it. But custom vampire races I've seen have their own implementation of sun damage as well already, and custom vampire races also can't make use of the game's own sun damage effects, at least not if you want to be in control of what it does or how it works. So I'm pretty sure there are implementations where you can look up how others have done it, and implement your own solution like they did.

Link to comment
Share on other sites

samadchaz

Thank you for water detection mod example.

 

Try to use it.

 

 

DrakeTheDragon

I will know that finding a vanilla effect is extremely difficult, I do not just googled and whot all I found:

Whenever this effect is active, the target will suffer damage continuously when outside during the day (starting at 6:00 am and ending at 8:00 pm)...

 

The damage done by sun damage depends on two factors. One is the level of sun damage that you have. The second is how bright the sun is, which depends on the time of day and the prevailing weather. During the brightest conditions (around midday with little cloud cover) the victim of sun damage takes twice the value given per second.

 

I'm not as well-in the script writing to write such a script myself.

 

Maskar

This can be done by using the GetWeatherSunDamage function.

 

thank you, but I understand that this is the very effect of burning on the sun, and even if I will reimburse his life Recover it will check graphically as burning? (which would have gotten away if I created a Fire Elemental, but I'm trying to create a plant).

 

You probably want to add an additional check for IsInInterior and gamehour.

 

Maybe I'm not sure what it is exactly. but like the effect itself does not act in the Interiors?

Edited by MCmamont
Link to comment
Share on other sites

GetWeatherSunDamage simply returns the sun damage value based on a certain weather type. It has nothing to do with a specific character taking damage or whatever. You might want to download beta 2 of my overhaul mod and check out the MOOTokenVampireScript script.

Link to comment
Share on other sites

  • 2 weeks later...

 

ScriptName DriadRegen

 

short BaseHealth

short FortifyHealth

short DrainHealth

short CurrentHP

short MaxHP

short RegenHealth

short RegenHealthTimer

 

short BaseFatigue

short FortifyFatigue

short DrainFatigue

short CurrentAP

short MaxAP

short RegenFatigue

short RegenFatigue2

short light

 

short BaseMagicka

short FortifyMagicka

short DrainMagicka

short CurrentMP

short MaxMP

short RegenMagicka

 

float TimePassed

 

begin ScriptEffectStart

end

 

Begin ScriptEffectUpdate

 

 

 

set TimePassed to TimePassed + GetSecondsPassed

 

 

 

If Player.IsSwimming == 1

 

set CurrentMP to Player.GetAV Magicka

set BaseMagicka to Player.GetBaseAV Magicka

set FortifyMagicka to Player.GetTotalAEMagnitude FOSP

set DrainMagicka to Player.GetTotalAEMagnitude DRSP

set MaxMP to BaseMagicka + FortifyMagicka - DrainMagicka

 

if CurrentMP < MaxMP

 

set RegenMagicka to MaxMP / 25

 

if TimePassed >= 1

Player.ModAV2 Magicka RegenMagicka

endif

 

endif

 

else set RegenMagicka to 0

 

endif

 

 

 

If Player.IsOnGround == 1

 

set CurrentHP to Player.GetAV Health

set BaseHealth to Player.GetBaseAV Health

set FortifyHealth to Player.GetTotalAEMagnitude FOHE

set DrainHealth to Player.GetTotalAEMagnitude DRHE

set MaxHP to BaseHealth + FortifyHealth - DrainHealth

 

if CurrentHP < MaxHP

 

set RegenHealth to MaxHP / 100

 

if RegenHealth < 1

set RegenHealth to 1

endif

 

if TimePassed >= 1

Set RegenHealthTimer to RegenHealthTimer + TimePassed

if RegenHealthTimer >= 5

Player.ModAV2 Health RegenHealth

Set RegenHealthTimer to 0

endif

endif

 

endif

 

else set RegenHealth to 0

 

endif

 

 

 

If Player.GetSunDamage Clear || Clearb || Cloudy || Cloudyb || DefaultWeather == 1 && IsInInterior == 0 && GameHour >=6 && GameHour <=20

 

set CurrentAP to Player.GetAV Fatigue

set BaseFatigue to Player.GetBaseAV Fatigue

set FortifyFatigue to Player.GetTotalAEMagnitude FOFA

set DrainFatigue to Player.GetTotalAEMagnitude DGFA

set MaxAP to BaseFatigue + FortifyFatigue - DrainFatigue

set light to player.GetActorLightAmount

 

if CurrentAP < MaxAP

 

set RegenFatigue to MaxAP * light / 500

 

If Player.IsUnderWater == 1

set RegenFatigue2 to RegenFatigue / 2

else

set RegenFatigue2 to RegenFatigue

endif

 

if TimePassed >= 1

Player.ModAV2 Fatigue RegenFatigue2

endif

 

endif

 

else set RegenFatigue2 to 0

 

endif

 

if TimePassed >= 1

set TimePassed to 0

endif

 

end

 

 

Begin ScriptEffectFinish

end

 

 

Finally I made this script.Thank you guys. If you find a way to improve it, I would appreciate it.

 

I took the regenerative part of the "Health Regeneration by Tahiti", thanks to him too.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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