enderalse/source/scripts/frostslowfix.psc

33 lines
1.1 KiB
Plaintext
Raw Normal View History

Scriptname FrostSlowFix extends activemagiceffect
{Behebt den Fehler, dass die Verlangsamung von Frostzaubern nicht funktioniert, indem das SpeedMult-Attribut durch kurzzeitige <20>nderung des InventoryWeight geupdatet wird.}
Keyword Property MagicSlowDownTarget Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
Float fBaseSpeed = akTarget.GetBaseActorValue("Speedmult")
If fBaseSpeed > akTarget.GetActorValue("Fame") ; ensures that the speedmult gets only halved once
akTarget.SetActorValue("Fame", fBaseSpeed)
akTarget.SetActorValue("Speedmult", fBaseSpeed * 0.5)
ForceSpeedMultUpdate(akTarget)
EndIf
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
If akTarget.HasMagicEffectWithKeyword(MagicSlowDownTarget) == False
akTarget.SetActorValue("Speedmult", akTarget.GetActorValue("Fame"))
akTarget.SetActorValue("Fame", 0)
ForceSpeedMultUpdate(akTarget)
EndIf
EndEvent
Function ForceSpeedMultUpdate(Actor akTarget)
akTarget.ModActorValue("InventoryWeight", -0.1)
Utility.Wait(0.01)
akTarget.ModActorValue("InventoryWeight", 0.1)
EndFunction