Oblivion Game Data

Select game:

Search:

Select a record type:

SE13PlayerFollowerSCRIPT (0x0001ac89)

  • Record Type: SCPT
  • Editor ID: SE13PlayerFollowerSCRIPT
  • Form ID: 0x0001ac89
  • Source File: Oblivion.esm.mod
  • Patch Status: FormID has not been modified.
Parameter Value
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


Database last updated 11/02/2011
SCPT records last updated 10/31/2011