Jump to content

Can anyone help me out with a script?


AnubisGrim

Recommended Posts

SCN AnubisCaptiveSCRIPT

Short 	Freed
Short	ThankedPlayer
Short	BeginMedicalServices
Short	BeginAddictionServices
Short 	Button
Short	DoOnce

Float	Timer

BEGIN OnLoad

if ( Freed == 1 )
	disable
else (  Freed == 0 )
	RemoveFromFaction AnubisDocFaction
	addscriptpackage AnubisDocCaptiveCaptured
	; ignore crime so that I won't respond to friendly fire
	IgnoreCrime 1
	; reset restrained state so I can get back into position after load
	set DoOnce to 0
	setRestrained 0
endif

END

BEGIN OnActivate
	if ( GetDead == 0 )
		if ( freed == 0 )
			if ( IsActionRef player == 1 )
				if ( Player.IsInCombat == 0 )
					if ( GetIsSex Male == 1 ) 
						ShowMessage AnubisCaptiveMessageBoxDoctor
					elseif ( GetIsSex Female == 1 )
						ShowMessage AnubisCaptiveMessageBoxDoctor
					endif
				else
					ShowMessage FFSupermutantCaptiveNoActivateMessage
				endif
			endif
	elseIf ( GetDead == 1 )
		Activate
	endif
endif

END

BEGIN GameMode
; restrain me once I'm in position
if ( DoOnce == 0 )
	if ( GetSitting == 3 )
		set DoOnce to 1
		setRestrained 1
	endif
endif

if ( freed == 0 )
	set button to GetButtonPressed

	if ( button == 1 )
		SetRestrained 0
;Disabled 6/30 CES			ModPCMiscStat "Captives Rescued" 1
		RemoveFromFaction AnubisDocFaction
		AddToFaction AnubisDocFaction 1
		setav Variable02 1
		removescriptpackage AnubisDocCaptiveCaptured
		set Freed to 1
		ignoreCrime 0
	endif

if ( getav variable01 == 1 )
	if ( DoOnce== 0 )
		disablePlayerControls
		evp
		sayto player MegDocChurchMedicalChatter
		PlayIdle LooseDoctorHeal
		set Timer to 8
		set DoOnce to 1
	endif

	set Timer to ( Timer - GetSecondsPassed )

	if ( Timer <= 6 ) && ( DoOnce == 1 )
		IMod FadeToBlackISFX
		set DoOnce to 2
	endif

	if ( Timer <= 0 ) && ( IsImagespaceActive FadeToBlackISFX == 0 )
		setstage Doctors 10
		enablePlayerControls
		addScriptPackage DefaultNPCDialogPlayer
	endif
	
endif

;When set to 1, plays medical animations for eight seconds then restarts conversation with the player
if ( getav variable01 == 2 )
	if ( DoOnce== 0 )
		disablePlayerControls
		evp
		PlayIdle LooseDoctorHeal
		set Timer to 8
		set DoOnce to 1
	endif

	set Timer to ( Timer - GetSecondsPassed )

	if ( IsAnimPlaying == 0 )
		PlayIdle LooseDoctorHeal
	endif

	if ( Timer <= 6 ) && ( DoOnce == 1 )
		IMod FadeToBlackISFX
		set DoOnce to 2
	endif

	if ( Timer <= 0 ) && ( IsImagespaceActive FadeToBlackISFX == 0 )
		setstage Doctors 20
		enablePlayerControls
		addScriptPackage DefaultNPCDialogPlayer
	endif
	
endif

; clear DoOnce when variable has been reset
if DoOnce > 0
	if getav variable01 == 0
		set DoOnce to 0
	endif
endif

	set Timer to ( Timer - GetSecondsPassed )

	if ( Timer <= 0 )
		set Timer to 10 

		if ( GetRandomPercent <= 50 )
			say FFSMCaptiveYellForHelp
		endif			
	endif
endif
	
END

 

 

Basically I want a captive, who AFTER you kill all the enemies in the area (Combat over) You free him and then He sticks around and is a Doctor (He already has the Doctor Dialouge) BUT the problem is once he is freed he just stands up does his "patrol" around the room and I can't talk to him in order to test the doctor half of the mod, i have no clue why I can't talk to him. :/

 

Any help would be appreciated... I'm have a couple other scripting problems but this one is the one that needs fixing the most.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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