4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

102 lines
3.4 KiB

Scriptname _00E_A2_DanceOfBladesSC extends activemagiceffect
Import debug
import _00E_TalentLibrary
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnEffectStart(Actor akTarget, Actor akCaster)
Victim = akTarget
EndEvent
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If PlayerREF.HasMagicEffectWithKeyword(MagicDanceOfBlades) && !Victim.IsDead()
If ((akAggressor == PlayerREF) && !abHitBlocked)
If iCounter < 4
_00E_A2_DanceOfBladesHit01M.Play(PlayerREF)
iCounter = (_00E_A2_DanceOfBladesGlobal.GetValueInt() + 1)
_00E_A2_DanceOfBladesGlobal.SetValueInt(iCounter)
ElseIf iCounter == 4
_00E_A2_DanceOfBladesGlobal.SetValue(0)
iCounter = 0
DealALotOfDamage()
PlayerREF.DispelSpell(_00E_A2_DanceOfBladesSP)
Victim.RemoveSpell(_00E_A2_DanceOfBladesMonitorAb)
EndIf
EndIf
Else
Victim.DispelSpell(_00E_A2_DanceOfBladesMonitorAb)
EndIf
EndEvent
;Fix for http://sureai.net:9898/browse/ERB-252
Event OnEffectFinish(Actor akTarget, Actor akCaster)
Victim = akTarget
PlayerREF.DispelSpell(_00E_A2_DanceOfBladesSP)
Victim.RemoveSpell(_00E_A2_DanceOfBladesMonitorAb)
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function DealALotOfDamage()
int iDanceIndex = GetPlayerTalentLevel(_00E_Class_Derwish_P09b_Talent_DanceOfBlades, _00E_Class_Derwish_P09b_Talent_DanceOfBlades2, _00E_Class_Derwish_P09b_Talent_DanceOfBlades3)
float iDamage = _00E_A2_DanceOfBladesSP.GetNthEffectMagnitude(iDanceIndex)
float iStaggerIntensity = _00E_A2_DanceOfBladesSP.GetNthEffectMagnitude(iDanceIndex + 3)
_00E_A2_DanceOfBladesCriticalHitSP.SetNthEffectMagnitude(0, iDamage)
_00E_A2_DanceOfBladesCriticalHitSP.SetNthEffectMagnitude(1, iStaggerIntensity)
_00E_A2_DanceOfBladesCriticalHitSP.RemoteCast(Victim, PlayerREF, Victim)
_00E_A2_DanceOfBladesImpactM.Play(PlayerREF)
If iDanceIndex == 3
PlayerREF.PushActorAway(Victim, 5.0)
EndIf
Game.ShakeCamera(afStrength = 0.2)
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
int iCounter
Actor Victim
Actor Caster
Spell DamageSpell
GlobalVariable Property _00E_A2_DanceOfBladesGlobal Auto
Perk Property _00E_Class_Derwish_P09b_Talent_DanceOfBlades Auto
Perk Property _00E_Class_Derwish_P09b_Talent_DanceOfBlades2 Auto
Perk Property _00E_Class_Derwish_P09b_Talent_DanceOfBlades3 Auto
Keyword Property MagicDanceOfBlades Auto
Sound Property _00E_A2_DanceOfBladesImpactM Auto
Sound Property _00E_A2_DanceOfBladesHit01M Auto
Sound Property _00E_A2_DanceOfBladesHit02M Auto
Sound Property _00E_A2_DanceOfBladesHit03M Auto
Sound Property _00E_A2_DanceOfBladesHit04M Auto
Actor Property PlayerREF Auto
Spell Property _00E_A2_DanceOfBladesSP Auto
Spell Property _00E_A2_DanceOfBladesCriticalHitSP Auto
Spell Property _00E_A2_DanceOfBladesMonitorAb Auto