SCTX |
scn SE13PlayerFollowerSCRIPT
; this script is on the DS/GS "bodyguard"
short dying
float timer
ref tempRef ; used for death blow
ref mySelf
short looking ; do once variable for look
begin OnLoad
set mySelf to getSelf
set SE13.bodyguardRef to getSelf
; disable me if battle is over and player isn't around
if getstage SE13 >= 100
disable
else
setignorefriendlyhits 1
endif
end
begin OnDeath
set SE13.deadAllies to SE13.deadAllies + 1 ; increment dead count (for reinforcement tracking)
; when I die, spawn a new me at the palace door
if getstage SE13 < 35
; messagebox "TEMP: Spawning new player bodyguard"
if getIsID SE13DarkSeducerPlayer == 1
; messagebox "TEMP: Spawning new player bodyguard"
set SE13.bodyguardRef to SE13BodyguardRespawnMarkerNEW.placeatme SE13DarkSeducerPlayer
else
set SE13.bodyguardRef to SE13BodyguardRespawnMarkerNEW.placeatme SE13GoldenSaintPlayer
endif
endif
end
Begin GameMode
; don't run this script if I'm disabled or dead
if GetDisabled == 1 || getDead == 1
return
endif
if getStageDone SE13 35 == 1 && looking == 0
set looking to 1
stopcombat
setalert 1
modav aggression -100
evp
look SE13JygaFXCloudSwirlREF
endif
if getStageDone SE13 38 == 1 && dying == 0
; run a timer (randomized) to blow myself up
set dying to 1
; unfreeze me in case I was hit by Staff
setactorsai 1
; use distance from boss marker to determine timer
set timer to GetDistance SE13BossMarker ; 3300 is about the max
set timer to timer/3300
endif
if dying == 1 || dying == 2
if timer > 0
set timer to timer - getSecondsPassed
elseif dying == 1
set dying to 2
set timer to 1
set tempRef to SE13.bossRef
tempRef.PushActorAway mySelf 30
elseif dying == 2
set dying to 3
kill
endif
endif
End
|