2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_A2_EldritchBloodPlayerMarkSC extends ReferenceAlias
|
|
|
|
|
|
|
|
Import Utility
|
|
|
|
|
2024-07-31 13:45:26 +00:00
|
|
|
int function _GetScriptVersion() Global
|
|
|
|
return 1
|
|
|
|
endFunction
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Auto State Marking
|
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
Event OnControlUp(string control, float HoldTime)
|
|
|
|
|
|
|
|
Actor rTarget = Game.GetCurrentCrosshairRef() as Actor
|
|
|
|
|
|
|
|
if ! rTarget || rTarget == Game.GetForm(0x14)
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
|
|
|
|
If _00E_A2_EldritchBloodGlobal.GetValueInt() == 1
|
|
|
|
EldritchBloodEffectScript.SelectEnemy(rTarget)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
Event OnCrosshairRefChange(ObjectReference ref)
|
|
|
|
|
|
|
|
if lastTarget != None
|
|
|
|
lastTarget.blockActivation(false)
|
2021-10-05 22:15:58 +00:00
|
|
|
EndIf
|
2024-07-31 13:15:17 +00:00
|
|
|
lastTarget = ref
|
|
|
|
|
|
|
|
if ref
|
|
|
|
ref.blockActivation(true)
|
|
|
|
endif
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
|
|
|
|
|
|
|
|
if(akSource == akSelfRef && asEventName == "weaponSwing")
|
|
|
|
if iAttackCounter == 0
|
|
|
|
iAttackCounter = 1
|
|
|
|
Else
|
|
|
|
; Debug.Notification(sMarkingModeInterrupted)
|
|
|
|
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
|
|
|
|
EldritchBloodEffectScript.abort()
|
|
|
|
UnregisterForAnimationEvent(akSelfRef, "weaponSwing")
|
|
|
|
EndIf
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
Event OnObjectEquipped(Form equippedObject, ObjectReference reference)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
if ! equippedObject as Shout
|
2021-10-05 22:15:58 +00:00
|
|
|
; Debug.Notification(sMarkingModeInterrupted)
|
2024-07-31 13:15:17 +00:00
|
|
|
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
|
2021-10-05 22:15:58 +00:00
|
|
|
EldritchBloodEffectScript.abort()
|
|
|
|
EndIf
|
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
EndEvent
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
Event OnSpellCast(Form akSpell)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
if akSpell != _00E_A2_EldritchBloodSP
|
|
|
|
; Debug.Notification(sMarkingModeInterrupted)
|
|
|
|
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
|
|
|
|
EldritchBloodEffectScript.abort()
|
|
|
|
EndIf
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
; Debug.Notification(sMarkingModeInterrupted)
|
2024-07-31 13:15:17 +00:00
|
|
|
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
|
2021-10-05 22:15:58 +00:00
|
|
|
EldritchBloodEffectScript.abort()
|
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
EndEvent
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
EndState
|
|
|
|
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Function EnterMarkingMode(Float iReach, _00E_A2_EldritchBloodPlayerSC _00E_A2_EldritchBloodMEScript)
|
|
|
|
|
|
|
|
akSelfRef = Self.GetActorReference()
|
|
|
|
RegisterForAnimationEvent(akSelfRef, "weaponSwing")
|
|
|
|
fActivatePickLengthBefore = GetINIFloat("fActivatePickLength:Interface")
|
|
|
|
SetINIFloat("fActivatePickLength:Interface", iReach)
|
|
|
|
EldritchBloodEffectScript = _00E_A2_EldritchBloodMEScript
|
|
|
|
RegisterForCrosshairRef()
|
2024-07-31 13:15:17 +00:00
|
|
|
RegisterForControl("Activate")
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function ExitMarkingMode()
|
|
|
|
|
2024-07-31 13:15:17 +00:00
|
|
|
iAttackCounter = 0
|
|
|
|
UnregisterForAllControls()
|
|
|
|
UnregisterForCrosshairRef()
|
|
|
|
UnregisterForAnimationEvent(akSelfRef, "weaponSwing")
|
|
|
|
|
|
|
|
; Restore activation reach
|
|
|
|
if fActivatePickLengthBefore <= 0
|
|
|
|
fActivatePickLengthBefore = 150.0
|
|
|
|
endif
|
|
|
|
SetINIFloat("fActivatePickLength:Interface", fActivatePickLengthBefore)
|
|
|
|
|
2021-10-05 22:15:58 +00:00
|
|
|
if lastTarget != None
|
|
|
|
lastTarget.blockActivation(false)
|
|
|
|
EndIf
|
|
|
|
lastTarget = None
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
ObjectReference lastTarget ; the last target before the crosshair; used to block and unblock activation
|
|
|
|
|
|
|
|
Actor akSelfRef
|
|
|
|
|
|
|
|
int iAttackCounter
|
|
|
|
|
|
|
|
_00E_A2_EldritchBloodPlayerSC Property EldritchBloodEffectScript Auto Hidden
|
|
|
|
|
|
|
|
float fActivatePickLengthBefore
|
|
|
|
|
|
|
|
;String Property sMarkingModeInterrupted = "Marking interrupted by attacking." Auto
|
|
|
|
|
|
|
|
GlobalVariable Property _00E_A2_EldritchBloodGlobal Auto
|
|
|
|
|
|
|
|
Spell Property _00E_A2_EldritchBloodSP Auto
|
|
|
|
Shout Property _00E_A2_EldritchBlood Auto
|
|
|
|
|
|
|
|
Message Property _00E_MarkingTalents_sMarkingModeInterrupted Auto
|