2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_MQ17_BossFight_GeneratorSC extends Actor
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnInit()
|
|
|
|
|
|
|
|
Self.SetActorValue("HealRate", 0)
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnUpdate()
|
|
|
|
|
|
|
|
bPlayerWasStupid = True
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
|
|
|
|
|
|
|
|
; Empty
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnDying(Actor akKiller)
|
|
|
|
|
|
|
|
MQ17_CombatControllerREF.CollapseGenerator(Self)
|
|
|
|
Self.BlockActivation(True)
|
|
|
|
Self.GetActorBase().SetName("")
|
|
|
|
MQ17_GeneratorDisplay.Kill(PlayerREF)
|
|
|
|
MQ17_GeneratorDisplay.Disable()
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Function CheckForDamage(Form akSource)
|
|
|
|
|
|
|
|
If !bShieldsDown
|
|
|
|
|
|
|
|
If Utility.RandomInt(0, 100) <= 75 && bPlayerWasStupid
|
|
|
|
MQ17_CombatControllerREF.CompanionGeneratorRemark()
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
DamagePlayer(10)
|
|
|
|
|
|
|
|
Else
|
|
|
|
;MQ17_GeneratorDisplay.StartCombat(PlayerREF) ; they don't have AI
|
|
|
|
float fDamageToDeal = GetDealtDamage(akSource)
|
|
|
|
|
|
|
|
_01E_Feuerblitz.RemoteCast(Self, PlayerREF, Self)
|
|
|
|
|
2023-12-08 02:45:53 +00:00
|
|
|
Self.DamageActorValue("Health", fDamageToDeal)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2023-12-08 02:45:53 +00:00
|
|
|
float fCurentHealth = Self.GetActorValue("Health")
|
|
|
|
float fBaseHealth = Self.GetBaseActorValue("Health")
|
2021-10-05 22:15:58 +00:00
|
|
|
If fCurentHealth <= ((fBaseHealth/100)*75) && !bDone75
|
|
|
|
_00E_MQ17_BossFight_GeneratorDamageDisplay.Show(75)
|
|
|
|
bDone75 = true
|
|
|
|
ElseIf fCurentHealth <= ((fBaseHealth/100)*50) && !bDone50
|
|
|
|
_00E_MQ17_BossFight_GeneratorDamageDisplay.Show(50)
|
|
|
|
bDone50 = true
|
|
|
|
ElseIf fCurentHealth <= ((fBaseHealth/100)*25) && !bDone25
|
|
|
|
_00E_MQ17_BossFight_GeneratorDamageDisplay.Show(25)
|
|
|
|
bDone25 = true
|
|
|
|
ElseIf fCurentHealth <= 0 && !bDone0
|
|
|
|
_00E_MQ17_BossFight_GeneratorDamageDisplay.Show(0)
|
|
|
|
bDone0 = true
|
|
|
|
Endif
|
|
|
|
|
|
|
|
If Utility.RandomInt(0, 100) <= 50
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.Say(MQ17_D04_FinalFightPain)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
PlayImpactFX()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function ActivateShield()
|
|
|
|
|
|
|
|
bShieldsDown = False
|
|
|
|
bPlayerWasStupid = False
|
|
|
|
_00E_MQ13c_TurretChargeSoundM.Play(Self)
|
|
|
|
Self.GetActorBase().SetInvulnerable()
|
|
|
|
MS04MemoryFXShader.Play(Self)
|
|
|
|
MQ17_GeneratorDisplay.Enable()
|
|
|
|
RegisterForSingleUpdate(5)
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function DeactivateShield()
|
|
|
|
|
|
|
|
bShieldsDown = True
|
|
|
|
Self.GetActorBase().SetInvulnerable(False)
|
|
|
|
MS04MemoryFXShader.Stop(Self)
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function PlayImpactFX()
|
|
|
|
|
|
|
|
MAGShockImpact.Play(PlayerREF)
|
|
|
|
MAGShockExpImod.Apply()
|
|
|
|
Game.ShakeCamera(afStrength = 0.25)
|
|
|
|
NPCDwarvenCenturionInjuredM.Play(PlayerREF)
|
|
|
|
|
2023-12-08 02:45:53 +00:00
|
|
|
If Self.GetActorValue("Health") <= 5.0
|
2021-10-05 22:15:58 +00:00
|
|
|
Self.Kill(PlayerREF)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function DamagePlayer(float fDamageValue)
|
|
|
|
|
|
|
|
Self.PlayImpactEffect(MAGShock01ImpactSet)
|
|
|
|
Game.ShakeCamera(afStrength = 0.25)
|
|
|
|
MAGShockExpImod.Apply()
|
2023-12-08 02:45:53 +00:00
|
|
|
PlayerREF.DamageActorValue("Health", fDamageValue)
|
2021-10-05 22:15:58 +00:00
|
|
|
MAGShockImpact.Play(PlayerREF)
|
|
|
|
ShockFXShader.Play(PlayerREF)
|
|
|
|
Utility.Wait(1)
|
|
|
|
ShockFXShader.Stop(PlayerREF)
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
float Function GetDealtDamage(Form akDamageSource)
|
|
|
|
|
2024-02-13 09:53:17 +00:00
|
|
|
if ! SKSE.GetVersion()
|
|
|
|
return 55.0
|
|
|
|
endif
|
|
|
|
|
2021-10-05 22:15:58 +00:00
|
|
|
bool bIsSpell
|
|
|
|
bool bIsArrow
|
|
|
|
|
|
|
|
If akDamageSource.GetType() == 22
|
|
|
|
bIsSpell = True
|
|
|
|
ElseIf akDamageSource.GetType() == 64
|
|
|
|
bIsArrow = True
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If bIsArrow
|
|
|
|
|
|
|
|
float fBowBaseDamage = 0
|
|
|
|
|
|
|
|
If PlayerREF.GetEquippedWeapon(false) != None ; check right hand
|
|
|
|
fBowBaseDamage = PlayerREF.GetEquippedWeapon(false).GetBaseDamage()
|
|
|
|
ElseIf PlayerREF.GetEquippedWeapon(true) != None ; check left hand
|
|
|
|
fBowBaseDamage = PlayerREF.GetEquippedWeapon(true).GetBaseDamage()
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If fBowBaseDamage > 0
|
|
|
|
Return fBowBaseDamage*5.0
|
|
|
|
Else
|
|
|
|
Return 55.0
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
ElseIf bIsSpell
|
|
|
|
|
|
|
|
Spell spellHitSpell = akDamageSource as Spell
|
|
|
|
float[] fArrayTotalSpellDamage = spellHitSpell.GetEffectMagnitudes()
|
|
|
|
float fTotalDamage
|
|
|
|
int iArrayIndex = fArrayTotalSpellDamage.Length
|
|
|
|
|
|
|
|
while iArrayIndex >= 0
|
|
|
|
fTotalDamage += fArrayTotalSpellDamage[iArrayIndex]
|
|
|
|
iArrayIndex -= 1
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
If fTotalDamage > 0
|
|
|
|
Return fTotalDamage
|
|
|
|
Else
|
|
|
|
Return 55.0
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
Else
|
|
|
|
Weapon weapHitWeapon = akDamageSource as Weapon
|
|
|
|
|
|
|
|
float fWeaponBaseDamage = weapHitWeapon.GetBaseDamage()
|
|
|
|
|
|
|
|
If fWeaponBaseDamage > 0
|
|
|
|
Return fWeaponBaseDamage*3.5
|
|
|
|
Else
|
|
|
|
Return 55.0
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
bool bPlayerWasStupid
|
|
|
|
bool bDone75 = false
|
|
|
|
bool bDone50 = false
|
|
|
|
bool bDone25 = false
|
|
|
|
bool bDone0 = false
|
|
|
|
|
|
|
|
_00E_TestBossFightSC Property MQ17_CombatControllerREF Auto
|
|
|
|
|
|
|
|
bool bShieldsDown = True
|
|
|
|
|
|
|
|
EffectShader Property ShockFXShader Auto
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
Actor Property MQ17_GeneratorDisplay Auto
|
|
|
|
|
|
|
|
Topic Property MQ17_D04_FinalFightPain Auto
|
|
|
|
|
|
|
|
Spell Property _01E_Feuerblitz Auto
|
|
|
|
|
|
|
|
ImpactDataSet Property MAGShock01ImpactSet Auto
|
|
|
|
|
|
|
|
ObjectReference Property MQ17_SC06_BlackGuardianHeartREF Auto
|
|
|
|
|
|
|
|
Message Property _00E_MQ17_BossFight_GeneratorDamageDisplay Auto
|
|
|
|
|
|
|
|
Sound Property NPCDwarvenCenturionInjuredM Auto
|
|
|
|
Sound Property MAGShockImpact Auto
|
|
|
|
Sound Property _00E_MQ13c_TurretChargeSoundM Auto
|
|
|
|
|
|
|
|
EffectShader Property MS04MemoryFXShader Auto
|
|
|
|
ImageSpaceModifier Property MAGShockExpImod Auto
|