enderalse/scripts/source/frostslowfix.psc

44 lines
1.5 KiB
Plaintext

Scriptname FrostSlowFix extends activemagiceffect
{Behebt den Fehler, dass die Verlangsamung von Frostzaubern nicht funktioniert, indem das SpeedMult-Attribut durch kurzzeitige Änderung des InventoryWeight geupdatet wird.}
MagicEffect Property FrostSlowFFAimed Auto
MagicEffect Property FrostSlowConcAimed Auto
MagicEffect Property FrostSlowFFContact Auto
MagicEffect Property FrostSlowFFSelfArea100 Auto
float speed
float basespeed
float slowspeed
Event OnEffectStart(Actor akTarget, Actor akCaster)
If akTarget.GetBaseActorValue("Speedmult") > akTarget.GetBaseActorValue("Fame") ;ensures that the speedmult gets only halved once
basespeed=akTarget.GetBaseActorValue("Speedmult")
akTarget.SetActorValue("Fame", basespeed)
slowspeed=akTarget.GetBaseActorValue("Speedmult")/2
akTarget.SetActorValue("Speedmult", slowspeed)
EndIf
akTarget.ModActorValue("InventoryWeight", -0.1)
Utility.Wait(0.01)
akTarget.ModActorValue("InventoryWeight", 0.1)
Endevent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
If (akTarget.HasMagicEffect(FrostSlowFFAimed)||akTarget.HasMagicEffect(FrostSlowConcAimed)||akTarget.HasMagicEffect(FrostSlowFFContact)||akTarget.HasMagicEffect(FrostSlowFFSelfArea100))==0
basespeed=akTarget.GetBaseActorValue("Fame")
akTarget.SetActorValue("Speedmult", basespeed)
akTarget.SetActorValue("Fame", 0)
EndIf
akTarget.ModActorValue("InventoryWeight", -0.1)
Utility.Wait(0.01)
akTarget.ModActorValue("InventoryWeight", 0.1)
Endevent