Difference between revisions of "Resurrecting the Player"

Jump to navigation Jump to search
1,842 bytes added ,  20:45, 18 July 2008
no edit summary
imported>Qazaaq
(moved to category solutions)
imported>Althir
Line 33: Line 33:


[[Category: Solutions]]
[[Category: Solutions]]
Try this one. It works fine for me. You have to put this script into the script window of the Base "player", which can be found under the "NPC" section.
<pre>ScriptName 000PlayerResurrectScript
short DoOnce
short init
short TimeIsOut
short BaseHealth
short CurrentHealth
short FixHealth
short ReducedHealth
short EnduranceModifier
short BaseFatigue
short Death
float timer
Begin GameMode
;Remember the original Base HitPoints
;and set the Endurance +10 to give the Player an Threshold of 50 extra BASE HitPoints
if (DoOnce != 1)
set BaseHealth to GetBaseActorValue Health
set EnduranceModifier to (GetBaseActorValue Endurance + 10)
SetActorValue Endurance EnduranceModifier
set DoOnce to 1
endif
;Check the PC HitPoints
;if they reach the 50 Points Threshold
;be sure that the HitPoints never fall below 50 Points
if (GetActorValue Health < 51)
set CurrentHealth to GetActorValue Health
if (CurrentHealth != 50)
set FixHealth to (50 - CurrentHealth)
ModActorValue Health FixHealth
endif
;Stop the enemys from attacking the Player
;Then set the Player to some kind of Death state by detracting his Fatigue
if (Death != 1)
StopCombatAlarmOnActor
SetGhost 1
ForceActorValue Fatigue -1000
set Death to 1
endif
;after some Time (here 300 Seconds)
;heal the Player up to 30% from his original Base HitPoints + the 50 Points Threshold 
;and resurrect him by restoring his original Fatigue
if init == 0
set timer to 300.0
set init to 1
else
if timer > 0
set timer to timer - getSecondsPassed
else
SetGhost 0
set ReducedHealth to ((BaseHealth*0.3-CurrentHealth)+50)
ModActorValue Health ReducedHealth
set BaseFatigue to (GetBaseActorValue Fatigue)
ForceActorValue Fatigue BaseFatigue
set init to 0
set Death to 0
        endif
endif
endif
End GameMode</pre> (EDT)
Anonymous user

Navigation menu