enderalse/source/scripts/_00e_mq11c_minigameshootingsphere_hit.psc

76 lines
2.9 KiB
Plaintext

Scriptname _00E_MQ11c_MinigameShootingSphere_Hit extends ObjectReference
{Script to register the player's hits on the sphere}
;-------------------------------------------EMPTY STATE EVENTS------------------------------------
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
int GameRunning = _00E_MQ11c_Sphere_GameRunning.GetValueInt()
if akAggressor == PlayerREF && akSource.HasKeyword(WeapTypeBow) && (GameRunning == 1) ;Checks to see whether the player is currently casting "Eye of the storm")
HitsLanded = _00E_MQ11c_Sphere_HitsLanded.GetValueInt()
HitsLandedEOTS = _00E_MQ11c_Sphere_HitsLandedEOTS.GetValueInt()
if !(PlayerREF.HasMagicEffect(_00E_A2_EyeOfTheStormMESelf))
HitsLanded = (_00E_MQ11c_Sphere_HitsLanded.GetValueInt() + 1)
_00E_MQ11c_Sphere_HitsLanded.SetValue(HitsLanded )
_00E_MQ11c_sMinigameShootingSphereHit.Show(HitsLanded)
ElseIf (PlayerREF.HasMagicEffect(_00E_A2_EyeOfTheStormMESelf))
HitsLandedEOTS = (_00E_MQ11c_Sphere_HitsLandedEOTS.GetValueInt() + 1)
_00E_MQ11c_Sphere_HitsLanded.SetValue(HitsLandedEOTS )
_00E_MQ11c_sMinigameShootingSphereHit.Show(HitsLanded)
EndIf
Self.PlayImpactEffect(PHYGenericMetalMediumImpactSet)
Self.PlaceAtMe(_00E_MQ11c_HitSphereExplosion, 1)
NPCDwarvenSphereInjured.Play(Self)
MAGRestorationTurnUndeadProjectile.Play(Self)
IllusionPositiveFXS.Play(Self)
Game.ShakeCamera(afStrength = 0.2)
if Utility.RandomFloat(0,1) < RyneusDialogueChance
Ryneus.GetActorReference().Say(MQ11c_D8_MinigameDialoguesHit)
EndIf
If _00E_MQ11c_Sphere_HitsLanded.GetValueInt() == 10 && !bDone
Steam.UnlockAchievement("END_STARLINGSPHERE_01")
bDone = true
EndIf
Elseif (GameRunning == 0)
_00E_MQ11c_SphereDeflectArrowM.Play(Self)
EndIf
EndEvent
;-------------------------------------------PROPERTIES------------------------------------
bool GameCheck
bool bDone
int HitsLanded
int HitsLandedEOTS
float Property RyneusDialogueChance Auto ; Determines how often Ryneus will make remark on the happenings
Actor Property PlayerREF Auto
Keyword Property WeapTypeBow Auto
Sound Property NPCDwarvenSphereInjured Auto
Sound Property MAGRestorationTurnUndeadProjectile Auto
Sound Property _00E_MQ11c_SphereDeflectArrowM Auto
Message Property _00E_MQ11c_sMinigameShootingSphereHit Auto
GlobalVariable Property _00E_MQ11c_Sphere_GameRunning Auto
GlobalVariable Property _00E_MQ11c_Sphere_HitsLanded Auto
GlobalVariable Property _00E_MQ11c_Sphere_HitsLandedEOTS Auto
ImpactDataSet Property PHYGenericMetalMediumImpactSet Auto ; Extra global for the special ability "Eye of the storm" that slows down time and would thus enable to exploit the EXP mechanic
Explosion Property _00E_MQ11c_HitSphereExplosion Auto
EffectShader Property IllusionPositiveFXS Auto
Topic Property MQ11c_D8_MinigameDialoguesHit Auto
ReferenceAlias Property Ryneus Auto
MagicEffect Property _00E_A2_EyeOfTheStormMESelf Auto