enderalse/scripts/source/_00e_dgintimidateplayerscript.psc

57 lines
1.6 KiB
Plaintext
Raw Normal View History

Scriptname _00E_DGIntimidatePlayerScript extends ReferenceAlias
import game
Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
; if the player is hit with any weapon other than hands, or by anyone but the brawlers
if akAggressor != Opponent.GetRef() && akAggressor != OpponentFriend.GetRef()
GetOwningQuest().SetStage(200)
endif
endEvent
Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
; if player is hit with any magic effect (not by himself)
if akCaster != GetPlayer()
GetOwningQuest().SetStage(150)
endif
endEvent
Event OnEnterBleedout()
; Debug.Trace("player enters bleedout")
GetPlayer().SetNoBleedoutRecovery(false)
GetOwningQuest().SetStage(180)
Utility.Wait(7)
GetOwningQuest().SetStage(200)
EndEvent
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
if GetPlayer().IsInLocation(Opponent.GetActorRef().GetCurrentLocation()) == False
; Debug.Trace(self + "Player has left opponent's location, shutting down")
GetOwningQuest().SetStage(200)
endIf
endEvent
; Version update
Int curScriptVersion = 0
Int Property LATEST_SCRIPT_VERSION = 1 AutoReadOnly
Function Setup()
curScriptVersion = LATEST_SCRIPT_VERSION
EndFunction
Event OnPlayerLoadGame()
If curScriptVersion < LATEST_SCRIPT_VERSION
curScriptVersion = LATEST_SCRIPT_VERSION
Int curStage = GetOwningQuest().GetStage()
If curStage >= 150 && curStage < 200 ; Terminate the quest if it's stuck
GetOwningQuest().SetStage(200)
EndIf
EndIf
EndEvent
ReferenceAlias Property Opponent Auto
ReferenceAlias Property OpponentFriend Auto