enderalse/scripts/source/_00e_phasmalist_transmute.psc

78 lines
2.4 KiB
Plaintext

Scriptname _00E_Phasmalist_Transmute extends activemagiceffect
Actor Caster
Actor Target
int SoundHandler
_00E_QuestFunctions Property Levelsystem Auto
Actor Property PlayerREF Auto
Perk Property _00E_Class_Phasmalist_P08c_Talent_Transmute Auto
Perk Property _00E_Class_Phasmalist_P08c_Talent_Transmute2 Auto
Perk Property _00E_Class_Phasmalist_P08c_Talent_Transmute3 Auto
Shout Property _00E_Phasmalist_A2_TransmuteShout Auto
Sound Property MAGMystisicmSoulTrapActiveLP Auto
VisualEffect Property _00E_Phasmalist_TransmuteDrainVisual Auto
Explosion Property _00E_Phasmalist_TransmuteExp Auto
Keyword Property actorTypeUndead Auto
Activator Property _00E_Phasmalist_TransmutePile Auto
Ingredient Property undeadLoot Auto
SoulGem Property normalLoot Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
If !akTarget.IsDead()
Levelsystem._00E_Levelsystem_sEnemyHasToBeDead.Show()
(PlayerREF as _00E_Game_TalentControlSC).SetTalentRecoveryTime(_00E_Phasmalist_A2_TransmuteShout, 0)
Return
Else
Target = akTarget
Caster = akCaster
akTarget.ApplyHavokImpulse(0.0, 0.0, 100.0, 10.0)
Self.PlayVictimAndPlayerFX()
Utility.Wait(1.5)
akTarget.SetCriticalStage(akTarget.CritStage_DisintegrateStart)
Self.GetItems()
Utility.Wait(1.5)
Self.ExplodeVictim()
akTarget.SetCriticalStage(akTarget.CritStage_DisintegrateEnd)
EndIf
EndEvent
Function PlayVictimAndPlayerFX()
;TODO: play shaders
SoundHandler = MAGMystisicmSoulTrapActiveLP.Play(Caster)
_00E_Phasmalist_TransmuteDrainVisual.Play(Target, akFacingObject = Caster)
_00E_Phasmalist_TransmuteDrainVisual.Play(Caster, akFacingObject = Target)
EndFunction
Function ExplodeVictim()
Game.ShakeCamera(afStrength = 0.2)
Sound.StopInstance(SoundHandler)
Target.placeAtMe(_00E_Phasmalist_TransmuteExp)
Target.AttachAshPile(_00E_Phasmalist_TransmutePile)
Target.SetAlpha(0.0, true)
;stop shader
_00E_Phasmalist_TransmuteDrainVisual.Stop(Target)
_00E_Phasmalist_TransmuteDrainVisual.Stop(Caster)
Target.InterruptCast()
Target.DispelAllSpells()
Target.Kill(Caster)
EndFunction
Function GetItems()
if Target.HasKeyword(actorTypeUndead)
Caster.AddItem(undeadLoot)
else
Caster.AddItem(normalLoot)
Endif
Endfunction
int Function GetTalentLevel()
return _00E_TalentLibrary.GetPlayerTalentLevel(_00E_Class_Phasmalist_P08c_Talent_Transmute, _00E_Class_Phasmalist_P08c_Talent_Transmute2, _00E_Class_Phasmalist_P08c_Talent_Transmute3)
EndFunction