enderalse/source/scripts/_00e_dgintimidateplayerscript.psc

57 lines
1.7 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()
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(200)
endif
endEvent
Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
; if player is hit with any magic effect (not by himself)
if akCaster != GetPlayer()
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(150)
endif
endEvent
Event OnEnterBleedout()
; Debug.Trace("player enters bleedout")
GetPlayer().SetNoBleedoutRecovery(false)
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(180)
Utility.Wait(7)
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(200)
EndEvent
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
2023-12-08 02:57:30 +00:00
if GetPlayer().IsInLocation(Opponent.GetActorReference().GetCurrentLocation()) == False
; Debug.Trace(self + "Player has left opponent's location, shutting down")
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(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
2024-01-10 14:08:24 +00:00
Int curStage = GetOwningQuest().GetCurrentStageID()
If curStage >= 150 && curStage < 200 ; Terminate the quest if it's stuck
2024-01-10 14:08:24 +00:00
GetOwningQuest().SetCurrentStageID(200)
EndIf
EndIf
EndEvent
ReferenceAlias Property Opponent Auto
ReferenceAlias Property OpponentFriend Auto