enderalse/scripts/source/_00e_a2_eldritchbloodsc.psc

243 lines
7.2 KiB
Plaintext
Raw Normal View History

Scriptname _00E_A2_EldritchBloodSC extends activemagiceffect
Import _00E_TalentLibrary
Import Utility
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
if akSource == _00E_A2_SkyfallBoltSP
if (Victim.GetAV("Health") - _00E_A2_SkyfallBoltSP.GetNthEffectMagnitude(0)) <= - 10
bSynergySkyfallExplosion = True
EndIf
EndIf
EndEvent
Event OnEffectStart(Actor akTarget, Actor akCaster)
Actor PlayerRef = Game.GetPlayer()
TalentLevel = GetPlayerTalentLevel(_00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood, _00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood2, _00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood3)
Game.ShowFirstPersonGeometry()
Victim = akTarget
A2_EldritchBlood_Victim.ForceRefTo(Victim)
_00E_A2_EldritchBloodParticelAttachVFX.Play(Victim)
If Victim.GetCombatTarget() == PlayerRef
Victim.StopCombat()
EndIf
; Strip Victim off all its factions
VictimFactions = Victim.GetFactions(-128, 127)
VictimFactionRanks = CreateIntArray(VictimFactions.Length)
Int i = 0
While i < VictimFactions.Length
If VoiceFactions.HasForm(VictimFactions[i]) ; Skip voice factions
VictimFactions[i] = None
Else
VictimFactionRanks[i] = Victim.GetFactionRank(VictimFactions[i])
Victim.RemoveFromFaction(VictimFactions[i])
EndIf
i += 1
EndWhile
Victim.AddToFaction(PlayerAlliesFaction)
Victim.AddToFaction(EPFaction)
Victim.SetRelationshipRank(PlayerRef, 3)
Victim.SetActorValue("Confidence", 4)
Victim.SetActorValue("Aggression", 2)
Victim.EvaluatePackage()
AdjustAndAddFrenzyPerk()
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
_00E_A2_EldritchBloodMarkedFXS.Stop(Victim)
Victim.RemovePerk(iPerk)
A2_EldritchBlood_Victim.Clear()
A2_EldritchBlood_VictimTarget.Clear()
_00E_A2_EldritchBloodParticelAttachVFX.Stop(Victim)
; Restore old factions of Victim
Victim.RemoveFromFaction(PlayerAlliesFaction)
Victim.RemoveFromFaction(EPFaction)
Int i = 0
While i < VictimFactions.Length
If VictimFactions[i]
Victim.AddToFaction(VictimFactions[i])
If VictimFactionRanks[i] != 0
Victim.SetFactionRank(VictimFactions[i], VictimFactionRanks[i])
EndIf
EndIf
i += 1
EndWhile
Victim.EvaluatePackage()
EndEvent
Event OnDying(Actor akKiller)
Explode()
Self.Dispel()
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function AdjustAndAddFrenzyPerk()
float iDamageMultiplicator = _00E_A2_EldritchBloodSP.GetNthEffectMagnitude(TalentLevel + 2)
If TalentLevel == 1
iPerk = _00E_A2_EldritchBloodPerk01
Elseif TalentLevel == 2
iPerk = _00E_A2_EldritchBloodPerk02
Elseif TalentLevel == 3
iPerk == _00E_A2_EldritchBloodPerk03
EndIf
iPerk.SetNthEntryValue(1, 1, iDamageMultiplicator)
iPerk.SetNthEntryValue(2, 1, iDamageMultiplicator)
EndFunction
Function Explode()
If TalentLevel == 1
iPerk = _00E_A2_EldritchBloodPerk01
Elseif TalentLevel == 2
iPerk = _00E_A2_EldritchBloodPerk02
Elseif TalentLevel == 3
iPerk == _00E_A2_EldritchBloodPerk03
EndIf
Victim.SetCriticalStage(Victim.CritStage_DisintegrateStart)
If bSynergySkyfallExplosion
AtronachUnsummonDeathFXS.Play(Victim)
Else
_00E_A1_DevourSoul_DisintegrateFXS.Play(Victim)
EndIf
Wait(1.5)
Game.ShakeCamera(afStrength = 1.0)
ObjectReference EXPMarker = Victim.PlaceAtMe(XMarker, 1)
EXPMarker.MoveTo(Victim, 0.0, 0.0, 50.0)
If bSynergySkyfallExplosion
bSynergySkyfallExplosion = False
If TalentLevel == 1
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion, 1)
Elseif TalentLevel == 2
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion02, 1)
Elseif TalentLevel == 3
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion03, 1)
EndIf
_00E_A2_SynergyEldritchBloodSkyfallDMGEnch.SetNthEffectMagnitude(0, (_00E_A2_EldritchBloodEnchantment.GetNthEffectMagnitude(0)*1.5))
_00E_MQ16_EchoScreamsM.Play(Victim)
EXPMarker.PlaceAtMe(_00E_A2_SynergyEldritchBloodSkyfallExp, 1)
Victim.AttachAshPile(_00E_NPCOorbayaAshPile)
Victim.KnockAreaEffect(0.5, 256)
If _00E_Synergy_EldritchBloodSkyfall.GetValueInt() == 0
_00E_Synergy_EldritchBloodSkyfall.SetValueInt(1)
Levelsystem.ShowSynergyMessage()
EndIf
Else
If TalentLevel == 1
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion, 1)
Elseif TalentLevel == 2
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion02, 1)
Elseif TalentLevel == 3
EXPMarker.PlaceAtMe(_00E_MAGEldritchShockExplosion03, 1)
EndIf
EXPMarker.PlaceAtMe(_00E_FS_MAGGoreExplosion, 1)
_00E_A2_ShatterSoulExpIMOD.Apply()
Victim.AttachAshPile(_00E_EldritchPile)
EndIf
ObjectReference VictimREF = Victim as ObjectReference
(VictimREF as _00E_EPOnDeath).HasBlameSpell = true
Victim.SetAlpha(0.0, true)
Victim.Kill(Victim)
Victim.SetCriticalStage(Victim.CritStage_DisintegrateEnd)
EXPMarker.Delete()
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
Faction[] VictimFactions
Int[] VictimFactionRanks
FormList Property VoiceFactions Auto
Faction Property PlayerAlliesFaction Auto
Faction Property EPFaction Auto
int TalentLevel
bool bSynergySkyfallExplosion
_00E_QuestFunctions Property Levelsystem Auto
Actor Victim
Perk iPerk
Perk Property _00E_A2_EldritchBloodPerk01 Auto
Perk Property _00E_A2_EldritchBloodPerk02 Auto
Perk Property _00E_A2_EldritchBloodPerk03 Auto
Sound Property _00E_MQ16_EchoScreamsM Auto
Enchantment Property _00E_A2_EldritchBloodEnchantment Auto
Enchantment Property _00E_A2_SynergyEldritchBloodSkyfallDMGEnch Auto
Perk Property _00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood Auto
Perk Property _00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood2 Auto
Perk Property _00E_Class_LifeAndDeath_P09b_Talent_EldritchBlood3 Auto
Static Property XMarker Auto
Activator Property _00E_EldritchPile Auto
Activator Property _00E_NPCOorbayaAshPile Auto
VisualEffect Property _00E_A2_EldritchBloodParticelAttachVFX Auto
Spell Property _00E_A2_EldritchBloodSP Auto
Spell Property _00E_A2_SkyfallBoltSP Auto
GlobalVariable Property _00E_Synergy_EldritchBloodSkyfall Auto
EffectShader Property _00E_A1_DevourSoul_DisintegrateFXS Auto
EffectShader Property _00E_A2_EldritchBloodMarkedFXS Auto
EffectShader Property AtronachUnsummonDeathFXS Auto
ImageSpaceModifier Property _00E_A2_ShatterSoulExpIMOD Auto
ReferenceAlias Property A2_EldritchBlood_Victim Auto
ReferenceAlias Property A2_EldritchBlood_VictimTarget Auto
Explosion Property _00E_MAGEldritchShockExplosion Auto
Explosion Property _00E_MAGEldritchShockExplosion02 Auto
Explosion Property _00E_MAGEldritchShockExplosion03 Auto
Explosion Property _00E_A2_SynergyEldritchBloodSkyfallExp Auto
Explosion Property _00E_FS_MAGGoreExplosion Auto