Jump to content

Need Scripting Help


apocalypse1138

Recommended Posts

A bit of scripting I cannot figure out...

 

I would like to make a potion, when consumed, would restore 50% of the PC's health. If you can help me out with this, post an example script here so I can get an idea on where to start.

 

Thank you for reading and for your time in advance.

Link to comment
Share on other sites

A bit of scripting I cannot figure out...

 

I would like to make a potion, when consumed, would restore 50% of the PC's health. If you can help me out with this, post an example script here so I can get an idea on where to start.

 

Thank you for reading and for your time in advance.

 

to get the value:

 

http://cs.elderscrolls.com/constwiki/index.php/GetActorValue

 

I suggest bookmarking the function list.

 

I do not remember if you can get the max health though.

Link to comment
Share on other sites

We've discussed it a little bit and got to this one in the end...

(Asked it somewhere else, that why...)

 

This is a - I evaded the use of OBSE - script.. using OBSE would probably be better.

It should be added as a script-effect (Magic Effect), instead of a normal (Object) script

scn Recoverhealth50percent

float healthcalc
float healthcalc2
ref myself

Begin scripteffectstart

set healthcalc to GetBaseActorValue Health
set healthcalc2 to healthcalc / 2
if GetActorValue Health == healthcalc
Message "You've wasted a potion, You have full health already!", 3
elseif GetActorValue Health + healthcalc2 > healthcalc
myself.ForceActorValue Health healthcalc
Message "You have recovered all of your health!", 3
else
myself.ModAv Health healthcalc2
Message "You have recovered half of your health!", 3
endif
end

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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