MCmamont Posted September 29, 2013 Share Posted September 29, 2013 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 More sharing options...
samadchaz Posted September 30, 2013 Share Posted September 30, 2013 dont know about the sun damage(should be very easy to find though, try searching in disease scripts) but there is mod for water detection :oblivion.nexusmods.com/mods/35065/ Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted September 30, 2013 Share Posted September 30, 2013 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 More sharing options...
Maskar Posted September 30, 2013 Share Posted September 30, 2013 This can be done by using the GetWeatherSunDamage function. You probably want to add an additional check for IsInInterior and gamehour. Link to comment Share on other sites More sharing options...
MCmamont Posted October 1, 2013 Author Share Posted October 1, 2013 (edited) samadchaz Thank you for water detection mod example. Try to use it. DrakeTheDragonI 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. MaskarThis 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 October 1, 2013 by MCmamont Link to comment Share on other sites More sharing options...
Maskar Posted October 1, 2013 Share Posted October 1, 2013 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 More sharing options...
MCmamont Posted October 10, 2013 Author Share Posted October 10, 2013 ScriptName DriadRegen short BaseHealthshort FortifyHealthshort DrainHealthshort CurrentHPshort MaxHPshort RegenHealthshort RegenHealthTimer short BaseFatigueshort FortifyFatigueshort DrainFatigueshort CurrentAPshort MaxAPshort RegenFatigueshort RegenFatigue2short light short BaseMagickashort FortifyMagickashort DrainMagickashort CurrentMPshort MaxMPshort RegenMagicka float TimePassed begin ScriptEffectStartend Begin ScriptEffectUpdate set TimePassed to TimePassed + GetSecondsPassed If Player.IsSwimming == 1 set CurrentMP to Player.GetAV Magickaset BaseMagicka to Player.GetBaseAV Magickaset FortifyMagicka to Player.GetTotalAEMagnitude FOSPset DrainMagicka to Player.GetTotalAEMagnitude DRSPset MaxMP to BaseMagicka + FortifyMagicka - DrainMagicka if CurrentMP < MaxMP set RegenMagicka to MaxMP / 25 if TimePassed >= 1Player.ModAV2 Magicka RegenMagickaendif endif else set RegenMagicka to 0 endif If Player.IsOnGround == 1 set CurrentHP to Player.GetAV Healthset BaseHealth to Player.GetBaseAV Healthset FortifyHealth to Player.GetTotalAEMagnitude FOHEset DrainHealth to Player.GetTotalAEMagnitude DRHEset MaxHP to BaseHealth + FortifyHealth - DrainHealth if CurrentHP < MaxHP set RegenHealth to MaxHP / 100 if RegenHealth < 1set RegenHealth to 1endif if TimePassed >= 1Set RegenHealthTimer to RegenHealthTimer + TimePassedif RegenHealthTimer >= 5Player.ModAV2 Health RegenHealthSet RegenHealthTimer to 0endifendif 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 Fatigueset BaseFatigue to Player.GetBaseAV Fatigueset FortifyFatigue to Player.GetTotalAEMagnitude FOFAset DrainFatigue to Player.GetTotalAEMagnitude DGFAset MaxAP to BaseFatigue + FortifyFatigue - DrainFatigueset light to player.GetActorLightAmount if CurrentAP < MaxAP set RegenFatigue to MaxAP * light / 500 If Player.IsUnderWater == 1set RegenFatigue2 to RegenFatigue / 2elseset RegenFatigue2 to RegenFatigueendif if TimePassed >= 1Player.ModAV2 Fatigue RegenFatigue2endif endif else set RegenFatigue2 to 0 endif if TimePassed >= 1set TimePassed to 0endif end Begin ScriptEffectFinishend 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 More sharing options...
Recommended Posts