2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_TestBossFightSC extends ObjectReference Conditional
|
|
|
|
|
|
|
|
; Despite its name, this is NOT a test script. It is the main script
|
|
|
|
; controlling the fight against the Black Guardian in MQ17. It is
|
|
|
|
; placed on reference MQ17_CombatControllerREF in int cell
|
|
|
|
; MQ17BlackGuardian.
|
|
|
|
|
|
|
|
Import Utility
|
|
|
|
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; STATES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
State defaultState
|
|
|
|
|
|
|
|
Event OnBeginState()
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnUpdate()
|
|
|
|
|
|
|
|
If !bAllGeneratorsDown && !bShieldsDown
|
|
|
|
|
|
|
|
If !AllLemmingsDead()
|
|
|
|
|
|
|
|
If fSpecialAttackTimer == 0 && !bSpecialAttackInAction
|
|
|
|
|
|
|
|
int iAttackType = RandomInt(0, 100)
|
|
|
|
|
|
|
|
If iAttackType < 33
|
|
|
|
SpecialAttack_CallLightning()
|
|
|
|
ElseIf (iAttackType >= 33) && (iAttackType < 66)
|
|
|
|
SpecialAttack_PossessLemming()
|
|
|
|
Else
|
|
|
|
SpecialAttack_FireBreath()
|
|
|
|
EndIf
|
|
|
|
Else
|
|
|
|
fSpecialAttackTimer -= 1
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
Else
|
|
|
|
BootDownPhase()
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If !bAllGeneratorsDown
|
|
|
|
RegisterForSingleUpdate(1)
|
|
|
|
EndIf
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
EndState
|
|
|
|
|
|
|
|
State Lemming_Suicide
|
|
|
|
|
|
|
|
Event OnBeginState()
|
|
|
|
|
|
|
|
RegisterForSingleUpdate(0.5)
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnUpdate()
|
|
|
|
|
|
|
|
if (akSuicideLemming.GetDistance(PlayerREF) <= 150.0) || (fLemmingDetonationTime == 0)
|
|
|
|
SpecialAttack_PossessLemming_DetonateLemming()
|
|
|
|
Else
|
|
|
|
akSuicideLemming.PathToReference(PlayerREF, 1)
|
|
|
|
fLemmingDetonationTime -= 1
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
RegisterForSingleUpdate(0.5)
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
endState
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
Function InitializeFight()
|
|
|
|
|
|
|
|
MQ17_SC07_BarrierREF.Enable()
|
|
|
|
Game.RequestAutoSave()
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_Fight_Start)
|
|
|
|
EndIf
|
|
|
|
|
2024-01-10 14:08:24 +00:00
|
|
|
MQ17.SetCurrentStageID(5)
|
2021-10-05 22:15:58 +00:00
|
|
|
MQ17.SetObjectiveDisplayed(15)
|
|
|
|
MQ17_Generator_Right_REF003.ActivateShield()
|
|
|
|
MQ17_Generator_Left_REF003.ActivateShield()
|
|
|
|
_00E_MQ17_SC07_LemmingExpEnch.SetNthEffectMagnitude(0, __Config_fLemmingDetonationDamage)
|
|
|
|
_00E_MQ17_SC07_BlackGuardianLightningSP.SetNthEffectMagnitude(0, __Config_fGuardianLightningDamage)
|
|
|
|
fSpecialAttackTimer = 10
|
|
|
|
bSpecialAttackInAction = False
|
|
|
|
SpawnLemmings()
|
|
|
|
GoToState("defaultState")
|
|
|
|
RegisterForSingleUpdate(1)
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function StopFight()
|
|
|
|
|
|
|
|
MQ17_SC07_BarrierREF.PlayAnimation("playanim01")
|
|
|
|
UnregisterForUpdate()
|
|
|
|
_00E_Music_Combat_Epic.Remove()
|
2024-01-10 14:08:24 +00:00
|
|
|
MQ17.SetCurrentStageID(85)
|
2021-10-05 22:15:58 +00:00
|
|
|
MQ17.SetObjectiveCompleted(15)
|
|
|
|
bSpecialAttackInAction = True
|
|
|
|
|
|
|
|
If !AllLemmingsDead()
|
|
|
|
|
|
|
|
int iLemmingIndex = arrayLemmings.Length
|
|
|
|
|
|
|
|
while iLemmingIndex > 0
|
|
|
|
arrayLemmings[iLemmingIndex].Kill(PlayerREF)
|
|
|
|
iLemmingIndex -= 1
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================SHIELDS DOWN=============================
|
|
|
|
|
|
|
|
Function BootDownPhase()
|
|
|
|
|
|
|
|
TRPDwemerPistonResetM.Play(MQ17_SC06_BlackGuardianHeartREF)
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_ShieldsDown)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
DeactivateGeneratorShields()
|
|
|
|
|
|
|
|
Utility.Wait(15)
|
|
|
|
|
|
|
|
If !bAllGeneratorsDown
|
|
|
|
ReactivateGeneratorShields()
|
|
|
|
SpawnLemmings()
|
|
|
|
fSpecialAttackTimer = 10.0
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
GoToState("defaultState")
|
|
|
|
RegisterForSingleUpdate(1)
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================GENERATOR================================
|
|
|
|
|
|
|
|
Function DeactivateGeneratorShields()
|
|
|
|
|
|
|
|
If !MQ17_Generator_Right_REF003.IsDead()
|
|
|
|
|
|
|
|
MQ17_Generator_Right_REF003.DeactivateShield()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If !MQ17_Generator_Left_REF003.IsDead()
|
|
|
|
|
|
|
|
MQ17_Generator_Left_REF003.DeactivateShield()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
|
|
|
|
If !MQ17_Generator_Left_REF003.IsDead() && !MQ17_Generator_Right_REF003.IsDead()
|
|
|
|
|
|
|
|
if Utility.RandomInt(0, 10) >= 5
|
|
|
|
MQ17_GeneratorToAttack.ForceRefTo(MQ17_Generator_Left_REF003)
|
|
|
|
Else
|
|
|
|
MQ17_GeneratorToAttack.ForceRefTo(MQ17_Generator_Right_REF003)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
ElseIf MQ17_Generator_Left_REF003.IsDead()
|
|
|
|
MQ17_GeneratorToAttack.ForceRefTo(MQ17_Generator_Right_REF003)
|
|
|
|
ElseIf MQ17_Generator_Right_REF003.IsDead()
|
|
|
|
MQ17_GeneratorToAttack.ForceRefTo(MQ17_Generator_Left_REF003)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
bShieldsDown = True
|
|
|
|
MQ17.akCompanion.EvaluatePackage()
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function ReactivateGeneratorShields()
|
|
|
|
|
|
|
|
CompanionIsTalking.SetValueInt(0)
|
|
|
|
|
|
|
|
If !MQ17_Generator_Right_REF003.IsDead()
|
|
|
|
|
|
|
|
MQ17_Generator_Right_REF003.ActivateShield()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If !MQ17_Generator_Left_REF003.IsDead()
|
|
|
|
|
|
|
|
MQ17_Generator_Left_REF003.ActivateShield()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
bShieldsDown = False
|
|
|
|
|
|
|
|
MQ17.akCompanion.EvaluatePackage()
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function CompanionGeneratorRemark()
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_PlayerHitGenerators)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function CollapseGenerator(ObjectReference akSelf)
|
|
|
|
|
|
|
|
bool bIsRightGenerator = False
|
|
|
|
|
|
|
|
if akself == MQ17_Generator_Right_REF003
|
|
|
|
bIsRightGenerator = True
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
if bIsRightGenerator
|
|
|
|
MQ17_Generator_Right_REF003.SetMotionType(4)
|
|
|
|
MQ17_Generator_Right_REF003.EnableAI(True)
|
|
|
|
MAGFireBallExpImod.Apply()
|
|
|
|
MQ17_Generator_Right_ExplosionMarker_004.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
Wait(0.75)
|
|
|
|
MQ17_Generator_Right_ExplosionMarker_005.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
Wait(0.5)
|
|
|
|
MQ17_Generator_Right_ExplosionMarker_006.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
MQ17_Generator_Right_ExplosionMarker_006.PlaceAtMe(_00E_MQ17_SC09_PlaceRuneExplosion)
|
|
|
|
MQ17_Generator_Right_SmokeREF.Enable()
|
|
|
|
Game.ShakeCamera()
|
|
|
|
MAGFireBallExpImod.Apply()
|
|
|
|
Else
|
|
|
|
MQ17_Generator_Left_REF003.SetMotionType(4)
|
|
|
|
MQ17_Generator_Left_REF003.EnableAI(True)
|
|
|
|
MAGFireBallExpImod.Apply()
|
|
|
|
MQ17_Generator_Left_ExplosionMarker_004.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
Wait(0.75)
|
|
|
|
MQ17_Generator_Left_ExplosionMarker_005.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
Wait(0.5)
|
|
|
|
MQ17_Generator_Left_ExplosionMarker_006.PlaceAtMe(_00E_FireballExpSmallHarmless)
|
|
|
|
MQ17_Generator_Left_ExplosionMarker_006.PlaceAtMe(_00E_MQ17_SC09_PlaceRuneExplosion)
|
|
|
|
MQ17_Generator_Left_Smoke_REF.Enable()
|
|
|
|
Game.ShakeCamera()
|
|
|
|
MAGFireBallExpImod.Apply()
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If MQ17_Generator_Right_REF003.IsDead() && MQ17_Generator_Left_REF003.IsDead()
|
|
|
|
UnregisterForUpdate()
|
|
|
|
StopFight()
|
|
|
|
bAllGeneratorsDown = True
|
|
|
|
Else
|
|
|
|
|
|
|
|
If MQ17_BlackGuardianIsTalking.GetValueInt() == 0
|
|
|
|
MQ17_BlackGuardianIsTalking.SetValueInt(1)
|
|
|
|
MQ17_SC07_BlackGuardianVoice.Say(MQ17_D04_FinalFightPain)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================LEMMINGS================================
|
|
|
|
|
|
|
|
Function ClearLemmingFromArray(Actor akLemmingRemove)
|
|
|
|
|
|
|
|
int iClearIndex = arrayLemmings.Find(akLemmingRemove)
|
|
|
|
arrayLemmings[iClearIndex] == None
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
bool Function AllLemmingsDead()
|
|
|
|
|
|
|
|
int iArrayIndex = arrayLemmings.Length
|
|
|
|
|
|
|
|
while iArrayIndex > 0
|
|
|
|
iArrayIndex -= 1
|
|
|
|
If (arrayLemmings[iArrayIndex] != None) && !(arrayLemmings[iArrayIndex].IsDead())
|
|
|
|
Return False
|
|
|
|
EndIf
|
|
|
|
EndWhile
|
|
|
|
|
|
|
|
Return True
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SpawnLemmings()
|
|
|
|
|
|
|
|
int iAttackCompanionLemmings = 2
|
|
|
|
|
|
|
|
int iLemmingIndex = 0
|
|
|
|
arrayLemmings = new Actor[6]
|
|
|
|
|
|
|
|
int iIndex = MQ17_SC07_PodFRMLST.GetSize()
|
|
|
|
|
|
|
|
While iIndex > 0
|
|
|
|
|
|
|
|
iIndex -= 1
|
|
|
|
|
|
|
|
_00E_MQ17_SC07_BroodingPotSC objPodToOccupy = MQ17_SC07_PodFRMLST.GetAt(iIndex) as _00E_MQ17_SC07_BroodingPotSC
|
|
|
|
|
|
|
|
If (objPodToOccupy.GetOpenState() == 3)
|
|
|
|
Actor akSpawnedLemming
|
|
|
|
SC07_TemporaryPodREF.ForceRefTo(objPodToOccupy)
|
|
|
|
akSpawnedLemming = objPodToOccupy.PlaceActorAtMe(_00E_MQ17_FinalFight_FleshCreature_Simple)
|
|
|
|
objPodToOccupy.SetChild(akSpawnedLemming)
|
|
|
|
arrayLemmings[iLemmingIndex] = akSpawnedLemming
|
|
|
|
iLemmingIndex += 1
|
|
|
|
objPodToOccupy.PlaceAtMe(_00E_MQ17_SC07_SpawnLemmingExplosion)
|
|
|
|
NPCFalmerAttackPower.Play(objPodToOccupy)
|
|
|
|
Game.ShakeCamera(afStrength = 0.25)
|
|
|
|
Weapon weapEquipWeapon = MQ17_SC07_ConstructWeaponsArray.GetAt(RandomInt(0, 2)) as Weapon
|
|
|
|
|
|
|
|
akSpawnedLemming.AddItem(weapEquipWeapon, 1)
|
|
|
|
akSpawnedLemming.EquipItem(weapEquipWeapon)
|
|
|
|
|
|
|
|
If weapEquipWeapon == FalmerBow
|
|
|
|
akSpawnedLemming.AddItem(_25E_Wegestreuenpfeil, 30)
|
|
|
|
akSpawnedLemming.SetActorValue("Marksman", 75)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
objPodToOccupy.OpenAndClose()
|
|
|
|
|
|
|
|
If iAttackCompanionLemmings > 0
|
|
|
|
akSpawnedLemming.StartCombat(MQ17.akCompanion)
|
|
|
|
iAttackCompanionLemmings -= 1
|
|
|
|
ElseIf PlayerREF.IsDead() == false
|
|
|
|
akSpawnedLemming.StartCombat(PlayerREF)
|
|
|
|
EndIf
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function KillAllLemmings()
|
|
|
|
|
|
|
|
int iArrayIndex = arrayLemmings.Length
|
|
|
|
|
|
|
|
while iArrayIndex > 0
|
|
|
|
iArrayIndex -= 1
|
|
|
|
Actor akLemmingToKill = arrayLemmings[iArrayIndex] as Actor
|
|
|
|
If akLemmingToKill != None
|
|
|
|
akLemmingToKill.Kill(PlayerREF)
|
|
|
|
EndIf
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================SPECIAL ATTACK: FIRE BREATH===================================
|
|
|
|
|
|
|
|
Function SpecialAttack_FireBreath()
|
|
|
|
|
|
|
|
If MQ17_BlackGuardianIsTalking.GetValueInt() == 0
|
|
|
|
MQ17_BlackGuardianIsTalking.SetValueInt(1)
|
|
|
|
MQ17_SC07_BlackGuardianVoice.Say(MQ17_D04_FinalFight_BlackGuardianTopic)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
bSpecialAttackInAction = True
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayAnimation("playAnim01")
|
|
|
|
Wait(1)
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_FireBreath)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
MQ17_SC07_BlackGuardianJaw_Origin001.SetPosition(MQ17_SC07_BlackGuardianJaw_REF002.GetPositionX(), MQ17_SC07_BlackGuardianJaw_REF002.GetPositionY(), MQ17_SC07_BlackGuardianJaw_REF002.GetPositionZ())
|
|
|
|
MQ17_SC07_BlackGuardianJaw_Origin001.SetAngle(MQ17_SC07_BlackGuardianJaw_REF002.GetAngleX(), MQ17_SC07_BlackGuardianJaw_REF002.GetAngleY(), MQ17_SC07_BlackGuardianJaw_REF002.GetAngleZ())
|
|
|
|
|
|
|
|
MQ17_SC07_BlackGuardianJaw_REF002.TranslateToREF(MQ17_SC07_BlackGuardianJaw_Open001, 25.0, 25.0)
|
|
|
|
OBJDwemerRepositorySlideM.Play(PlayerREF)
|
|
|
|
_00E_A2_ChaosruneImplosionSoundM.Play(MQ17_SC07_BlackGuardianJaw_REF002)
|
|
|
|
MQ17_SC07_MouthLightREF001.EnableNoWait(True)
|
|
|
|
|
|
|
|
if MQ17_SC07_FireFXREF003 != None
|
|
|
|
|
|
|
|
while MQ17_SC07_FireFXREF003.GetScale() < 5.53
|
|
|
|
MQ17_SC07_FireFXREF003.SetScale(MQ17_SC07_FireFXREF003.GetScale() + 0.1)
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
Wait(2)
|
|
|
|
VoiceFireBreath3.Cast(MQ17_SC07_BlackGuardianJaw_Cast001, PlayerREF)
|
|
|
|
_00E_MQ17_BlackGuardianBreathSP.Cast(MQ17_SC07_BlackGuardianJaw_Cast001, PlayerREF)
|
|
|
|
Game.ShakeCamera(afStrength = 0.15, afDuration = 3)
|
|
|
|
Wait(3)
|
|
|
|
|
|
|
|
OBJDwemerRepositorySlideM.Play(PlayerREF)
|
|
|
|
MQ17_SC07_BlackGuardianJaw_Cast001.InterruptCast()
|
|
|
|
MQ17_SC07_BlackGuardianJaw_REF002.TranslateToREF(MQ17_SC07_BlackGuardianJaw_Origin001, 25.0, 25.0)
|
|
|
|
|
|
|
|
if MQ17_SC07_FireFXREF003 != None
|
|
|
|
|
|
|
|
while MQ17_SC07_FireFXREF003.GetScale() > 2.2000
|
|
|
|
MQ17_SC07_FireFXREF003.SetScale(MQ17_SC07_FireFXREF003.GetScale() - 0.1)
|
|
|
|
Wait(0.1)
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
Endif
|
|
|
|
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayGamebryoAnimation("AnimTrans02")
|
|
|
|
bSpecialAttackInAction = False
|
|
|
|
fSpecialAttackTimer = __Config_fTimeBetweenSpecialAttacks
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================SPECIAL ATTACK: CALL LIGHTNING================================
|
|
|
|
|
|
|
|
Function SpecialAttack_CallLightning()
|
|
|
|
|
|
|
|
If MQ17_BlackGuardianIsTalking.GetValueInt() == 0
|
|
|
|
MQ17_BlackGuardianIsTalking.SetValueInt(1)
|
|
|
|
MQ17_SC07_BlackGuardianVoice.Say(MQ17_D04_FinalFight_BlackGuardianTopic)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
_00E_A2_ChaosruneImplosionSoundM.Play(MQ17_SC06_BlackGuardianHeartREF)
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayAnimation("playAnim01")
|
|
|
|
bSpecialAttackInAction = True
|
|
|
|
SpecialAttack_CallLightning_PlaceRunes()
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_Fight_Lightning)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
Wait(__Config_fLightningWaitTime)
|
|
|
|
SpecialAttack_CallLightning_Fire()
|
|
|
|
bSpecialAttackInAction = False
|
|
|
|
fSpecialAttackTimer = __Config_fTimeBetweenSpecialAttacks
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayGamebryoAnimation("AnimTrans02")
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SpecialAttack_CallLightning_PlaceRunes()
|
|
|
|
|
|
|
|
int iNumberOfPlaces = MQ17_SC07_BossFightRuneFRMLST.GetSize()
|
|
|
|
; This is 29 at the time of writing.
|
|
|
|
|
|
|
|
int iRunesToPlace = __Config_iRuneSlotsToFill
|
|
|
|
; This is 16 at the time of writing (reduced to 13 later on). This must be
|
|
|
|
; <= iNumberOfPlaces.
|
|
|
|
|
|
|
|
; We are going to place iRunesToPlace runes in the iNumberOfPlaces
|
|
|
|
; spots on the formlist MQ17_SC07_BossFightRuneFRMLST. To do so,
|
|
|
|
; we randomly sample a combination without replacement.
|
|
|
|
|
|
|
|
int iCurrentStep = 0
|
|
|
|
|
|
|
|
int[] ixPlacesFilled = new int[40]
|
|
|
|
|
|
|
|
while iRunesToPlace >= 0
|
|
|
|
|
|
|
|
; Sampling a random place not used yet.
|
|
|
|
iCurrentStep += 1
|
|
|
|
int iPlaceR = RandomInt(0, iNumberOfPlaces - iCurrentStep)
|
|
|
|
int iPlace = 0
|
|
|
|
while iPlaceR > 0
|
|
|
|
iPlaceR -= 1
|
|
|
|
iPlace += 1
|
|
|
|
while ixPlacesFilled[iPlace] == 1
|
|
|
|
iPlace += 1
|
|
|
|
endwhile
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
ixPlacesFilled[iPlace] = 1
|
|
|
|
|
|
|
|
ObjectReference objRuneSpot = MQ17_SC07_BossFightRuneFRMLST.GetAt(iPlace) as ObjectReference
|
|
|
|
objRuneSpot.Enable()
|
|
|
|
;_00E_LightningImpactAllM.Play(objRuneSpot)
|
|
|
|
objRuneSpot.PlaceAtMe(_00E_MQ17_SC09_PlaceRuneExplosion)
|
|
|
|
iRunesToPlace -= 1
|
|
|
|
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SpecialAttack_CallLightning_Fire()
|
|
|
|
|
|
|
|
int iIndex = MQ17_SC07_BossFightRuneFRMLST.GetSize() - 1
|
|
|
|
|
|
|
|
while iIndex >= 0
|
|
|
|
|
|
|
|
ObjectReference objRuneToFire = MQ17_SC07_BossFightRuneFRMLST.GetAt(iIndex) as ObjectReference
|
|
|
|
|
|
|
|
if objRuneToFire.IsEnabled()
|
|
|
|
ObjectReference objCastMarker = objRuneToFire.PlaceAtMe(XMarker, 1)
|
|
|
|
objCastMarker.SetPosition(objRuneToFire.GetPositionX(), objRuneToFire.GetPositionY(), (objRuneToFire.GetPositionZ() + 400.0))
|
|
|
|
_00E_MQ17_SC07_BlackGuardianLightningSP.Cast(objCastMarker, objRuneToFire)
|
|
|
|
Game.ShakeCamera(afStrength = 0.15)
|
|
|
|
objRuneToFire.KnockAreaEffect(0.5, 256)
|
|
|
|
objCastMarker.Delete()
|
|
|
|
Wait(0.1)
|
|
|
|
EndIf
|
|
|
|
iIndex -= 1
|
|
|
|
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
iIndex = MQ17_SC07_BossFightRuneFRMLST.GetSize() - 1
|
|
|
|
|
|
|
|
while iIndex >= 0
|
|
|
|
|
|
|
|
ObjectReference objRuneToFire = MQ17_SC07_BossFightRuneFRMLST.GetAt(iIndex) as ObjectReference
|
|
|
|
|
|
|
|
if objRuneToFire.IsEnabled()
|
|
|
|
objRuneToFire.Disable()
|
|
|
|
EndIf
|
|
|
|
iIndex -= 1
|
|
|
|
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=======================================SPECIAL ATTACK: POSSESS LEMMING================================
|
|
|
|
|
|
|
|
Function SpecialAttack_PossessLemming()
|
|
|
|
|
|
|
|
If MQ17_BlackGuardianIsTalking.GetValueInt() == 0
|
|
|
|
MQ17_BlackGuardianIsTalking.SetValueInt(1)
|
|
|
|
MQ17_SC07_BlackGuardianVoice.Say(MQ17_D04_FinalFight_BlackGuardianTopic)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
bSpecialAttackLemming = True
|
|
|
|
_00E_A2_ChaosruneImplosionSoundM.Play(MQ17_SC06_BlackGuardianHeartREF)
|
|
|
|
bSpecialAttackInAction = True
|
|
|
|
SpecialAttack_PossessLemming_FindLemming()
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayAnimation("playAnim01")
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SpecialAttack_PossessLemming_FindLemming()
|
|
|
|
|
|
|
|
|
|
|
|
int iArrayIndex = (arrayLemmings.Length - 1)
|
|
|
|
|
|
|
|
akSuicideLemming = arrayLemmings[Utility.RandomInt(0, iArrayIndex)]
|
|
|
|
|
|
|
|
while (akSuicideLemming == None) || (akSuicideLemming.IsDead())
|
|
|
|
akSuicideLemming = arrayLemmings[Utility.RandomInt(0, iArrayIndex)]
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
If !AllLemmingsDead()
|
|
|
|
|
|
|
|
If CompanionIsTalking.GetValueInt() == 0
|
|
|
|
CompanionIsTalking.SetValueInt(1)
|
|
|
|
MQ17.akCompanion.Say(MQ17_D04_Fight_Lemming_Attack)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
SC07_KillerLemming.ForceRefTo(akSuicideLemming)
|
|
|
|
_00E_MQ17_SC07_BlackGuardianFXS.Play(akSuicideLemming)
|
|
|
|
MAGConjureFire.Play(akSuicideLemming)
|
|
|
|
akSuicideLemming.SetActorValue("speedMult", 180.0)
|
|
|
|
FXAtronachStormCloakEffect.Play(akSuicideLemming)
|
|
|
|
_00E_MQ17_SC07_ControlBeam.Cast(MQ17_SC06_BlackGuardianHeartREF, akSuicideLemming)
|
|
|
|
_00E_A2_Ghostwalk_TeleportSound.Play(PlayerREF)
|
|
|
|
iPosessedLemmingSound = MAGCloakShockLP.Play(akSuicideLemming)
|
|
|
|
fLemmingDetonationTime = __Config_fLemmingDetonationTime
|
|
|
|
akSuicideLemming.EvaluatePackage()
|
|
|
|
Wait(0.5)
|
|
|
|
GoToState("Lemming_Suicide")
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.InterruptCast()
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
bSpecialAttackInAction = False
|
|
|
|
fSpecialAttackTimer = __Config_fTimeBetweenSpecialAttacks
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayGamebryoAnimation("AnimTrans02")
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SpecialAttack_PossessLemming_DetonateLemming()
|
|
|
|
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.InterruptCast()
|
|
|
|
akSuicideLemming.PlaceAtMe(_00E_MQ17_SC07_SpawnLemmingExplosion)
|
|
|
|
akSuicideLemming.PlaceAtMe(_00E_MQ17_SC07_LemmingExp)
|
|
|
|
Game.ShakeCamera(afStrength = 0.25)
|
|
|
|
akSuicideLemming.KnockAreaEffect(1, 256)
|
|
|
|
|
|
|
|
Int iDifficulty = GetINIInt("iDifficulty:GamePlay")
|
|
|
|
Float fMaxHealth = PlayerREF.GetBaseActorValue("Health")
|
|
|
|
If iDifficulty < 4 && (akSuicideLemming.GetDistance(PlayerREF) <= 150.0)
|
|
|
|
PlayerREF.DamageActorValue("Health", fMaxHealth*0.25)
|
|
|
|
ElseIf iDifficulty >= 4 && (akSuicideLemming.GetDistance(PlayerREF) <= 150.0)
|
|
|
|
PlayerREF.DamageActorValue("Health", fMaxHealth*0.5)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
akSuicideLemming.Kill(PlayerREF)
|
|
|
|
|
|
|
|
FXAtronachStormCloakEffect.Stop(akSuicideLemming)
|
|
|
|
_00E_MQ17_SC07_BlackGuardianFXS.Stop(akSuicideLemming)
|
|
|
|
bSpecialAttackInAction = False
|
|
|
|
fSpecialAttackTimer = __Config_fTimeBetweenSpecialAttacks
|
|
|
|
MQ17_SC06_BlackGuardianHeartREF.PlayGamebryoAnimation("AnimTrans02")
|
|
|
|
SC07_KillerLemming.Clear()
|
|
|
|
bSpecialAttackLemming = False
|
|
|
|
GoToState("defaultState")
|
|
|
|
If !PlayerREF.IsDead()
|
|
|
|
RegisterForSingleUpdate(1)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
int iPosessedLemmingSound
|
|
|
|
int iRemarkCounter
|
|
|
|
|
|
|
|
float fLemmingDetonationTime
|
|
|
|
float fSpecialAttackTimer
|
|
|
|
|
|
|
|
bool bSpecialAttackInAction
|
|
|
|
bool bAllGeneratorsDown
|
|
|
|
|
|
|
|
bool Property bShieldsDown Auto Conditional Hidden
|
|
|
|
bool Property bSpecialAttackLemming Auto Conditional Hidden
|
|
|
|
bool Property bSpecialAttackCallLightning Auto Conditional Hidden
|
|
|
|
bool Property bSpecialAttackFireBreath Auto Conditional Hidden
|
|
|
|
bool Property bSpecialAttackLemmingsSpawn Auto Conditional Hidden
|
|
|
|
|
|
|
|
int Property __Config_iRuneSlotsToFill = 5 Auto
|
|
|
|
{How many runes should be activated each time the "lightning" attack is spawned.}
|
|
|
|
|
|
|
|
float Property __Config_fLightningWaitTime = 3.0 Auto
|
|
|
|
{How long to wait for the lightnings to fire after the warning runes have been placed.}
|
|
|
|
float Property __Config_fLemmingDetonationTime = 15.0 Auto
|
|
|
|
{How long a posessed lemming will chase the player until it detonates by itself.}
|
|
|
|
float Property __Config_fLemmingDetonationDamage = 125.0 Auto
|
|
|
|
{How much damage the lemming detonation does.}
|
|
|
|
float Property __Config_fGuardianLightningDamage = 75.0 Auto
|
|
|
|
{How much damage the lemming detonation does.}
|
|
|
|
float Property __Config_fTimeBetweenSpecialAttacks = 20.0 Auto
|
|
|
|
{How long it takes after the Black Guardian has done who special attack until he does another.}
|
|
|
|
|
|
|
|
_00E_MQ17_Functions Property MQ17 Auto
|
|
|
|
|
|
|
|
Actor Property akSuicideLemming Auto Hidden
|
|
|
|
|
|
|
|
Actor[] Property arrayLemmings Auto Hidden
|
|
|
|
|
|
|
|
ActorBase Property _00E_MQ17_FinalFight_FleshCreature_Simple Auto
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
|
|
|
|
Topic Property MQ17_D04_Fight_Lemming_Attack Auto
|
|
|
|
Topic Property MQ17_D04_Fight_Start Auto
|
|
|
|
Topic Property MQ17_D04_Fight_Lightning Auto
|
|
|
|
Topic Property MQ17_D04_ShieldsDown Auto
|
|
|
|
Topic Property MQ17_D04_FireBreath Auto
|
|
|
|
Topic Property MQ17_D04_PlayerHitGenerators Auto
|
|
|
|
Topic Property MQ17_D04_FinalFight_BlackGuardianTopic Auto
|
|
|
|
Topic Property MQ17_D04_FinalFightPain Auto
|
|
|
|
|
|
|
|
ReferenceAlias Property MQ17_GeneratorToAttack Auto
|
|
|
|
|
|
|
|
MusicType Property _00E_Music_Combat_Epic Auto
|
|
|
|
|
|
|
|
Formlist Property MQ17_SC07_BossFightRuneFRMLST Auto
|
|
|
|
Formlist Property MQ17_SC07_PodFRMLST Auto
|
|
|
|
Formlist Property MQ17_SC07_ConstructWeaponsArray Auto
|
|
|
|
|
|
|
|
Explosion Property _00E_FireballExpSmallHarmless Auto
|
|
|
|
Explosion Property _00E_MQ17_SC07_SpawnLemmingExplosion Auto
|
|
|
|
Explosion Property _00E_MQ17_SC07_LemmingExp Auto
|
|
|
|
Explosion Property _00E_MQ17_SC09_PlaceRuneExplosion Auto
|
|
|
|
|
|
|
|
EffectShader Property _00E_MQ17_SC07_BlackGuardianFXS Auto
|
|
|
|
|
|
|
|
GlobalVariable Property CompanionIsTalking Auto
|
|
|
|
GlobalVariable Property MQ17_BlackGuardianIsTalking Auto
|
|
|
|
|
|
|
|
Enchantment Property _00E_MQ17_SC07_LemmingExpEnch Auto
|
|
|
|
|
|
|
|
Sound Property _00E_LightningImpactAllM Auto
|
|
|
|
Sound Property MAGConjureFire Auto
|
|
|
|
Sound Property MAGCloakShockLP Auto
|
|
|
|
Sound Property NPCFalmerAttackPower Auto
|
|
|
|
Sound Property _00E_A2_ChaosruneImplosionSoundM Auto
|
|
|
|
Sound Property _00E_A2_Ghostwalk_TeleportSound Auto
|
|
|
|
Sound Property OBJDwemerRepositorySlideM Auto
|
|
|
|
Sound Property TRPDwemerPistonResetM Auto
|
|
|
|
|
|
|
|
Weapon Property FalmerBow Auto
|
|
|
|
Ammo Property _25E_Wegestreuenpfeil Auto
|
|
|
|
|
|
|
|
ObjectReference Property MQ17_SC07_BlackGuardianJaw_REF002 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_BlackGuardianJaw_Origin001 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_BlackGuardianJaw_Open001 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_BlackGuardianJaw_Cast001 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_MouthLightREF001 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_FireFXREF003 Auto
|
|
|
|
ObjectReference Property MQ17_SC06_BlackGuardianHeartREF Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Right_ExplosionMarker_004 Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Right_ExplosionMarker_005 Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Right_ExplosionMarker_006 Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Left_ExplosionMarker_004 Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Left_ExplosionMarker_005 Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Left_ExplosionMarker_006 Auto
|
|
|
|
ObjectReference Property MQ17_SC07_BlackGuardianVoice Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Right_SmokeREF Auto
|
|
|
|
ObjectReference Property MQ17_Generator_Left_Smoke_REF Auto
|
|
|
|
ObjectReference Property MQ17_SC07_BarrierREF Auto
|
|
|
|
|
|
|
|
VisualEffect Property FXAtronachStormCloakEffect Auto
|
|
|
|
|
|
|
|
ReferenceAlias Property SC07_KillerLemming Auto
|
|
|
|
ReferenceAlias Property SC07_TemporaryPodREF Auto
|
|
|
|
|
|
|
|
Spell Property _00E_MQ17_SC07_BlackGuardianLightningSP Auto
|
|
|
|
Spell Property _00E_MQ17_SC07_ControlBeam Auto
|
|
|
|
Spell Property _00E_MQ17_BlackGuardianBreathSP Auto
|
|
|
|
Spell Property VoiceFireBreath3 Auto
|
|
|
|
|
|
|
|
Static Property XMarker Auto
|
|
|
|
|
|
|
|
ImageSpaceModifier Property MAGFireBallExpImod Auto
|
|
|
|
|
|
|
|
_00E_MQ17_BossFight_GeneratorSC Property MQ17_Generator_Right_REF003 Auto
|
|
|
|
_00E_MQ17_BossFight_GeneratorSC Property MQ17_Generator_Left_REF003 Auto
|