2021-10-05 22:15:58 +00:00
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.}
2021-10-12 02:10:35 +00:00
Keyword Property MagicSlowDownTarget Auto
2021-10-05 22:15:58 +00:00
2021-10-12 02:10:35 +00:00
Actor Target
2021-10-05 22:15:58 +00:00
2021-10-12 02:10:35 +00:00
Event OnEffectStart(Actor akTarget, Actor akCaster)
Target = akTarget
2021-10-05 22:15:58 +00:00
2021-10-12 02:10:35 +00:00
Float fBaseSpeed = Target.GetBaseActorValue("Speedmult")
If fBaseSpeed > Target.GetBaseActorValue("Fame") ; ensures that the speedmult gets only halved once
Target.SetActorValue("Fame", fBaseSpeed)
Target.SetActorValue("Speedmult", fBaseSpeed * 0.5)
2021-10-05 22:15:58 +00:00
2021-10-12 02:10:35 +00:00
ForceSpeedMultUpdate()
EndIf
EndEvent
2021-10-05 22:15:58 +00:00
Event OnEffectFinish(Actor akTarget, Actor akCaster)
2021-10-12 02:10:35 +00:00
If Target == None ; version update
Target = akTarget
2021-10-05 22:15:58 +00:00
EndIf
2021-10-12 02:10:35 +00:00
If Target.HasMagicEffectWithKeyword(MagicSlowDownTarget) == False
Target.SetActorValue("Speedmult", Target.GetBaseActorValue("Fame"))
Target.SetActorValue("Fame", 0)
ForceSpeedMultUpdate()
EndIf
EndEvent
2021-10-05 22:15:58 +00:00
2021-10-12 02:10:35 +00:00
Function ForceSpeedMultUpdate()
Target.ModActorValue("InventoryWeight", -0.1)
Utility.Wait(0.01)
Target.ModActorValue("InventoryWeight", 0.1)
EndFunction