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
Event OnEffectStart(Actor akTarget, Actor akCaster)
2021-10-05 22:15:58 +00:00
2021-11-25 23:16:01 +00:00
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)
2021-10-05 22:15:58 +00:00
2021-11-25 23:16:01 +00:00
ForceSpeedMultUpdate(akTarget)
2021-10-12 02:10:35 +00:00
EndIf
EndEvent
2021-10-05 22:15:58 +00:00
Event OnEffectFinish(Actor akTarget, Actor akCaster)
2021-11-25 23:16:01 +00:00
If akTarget.HasMagicEffectWithKeyword(MagicSlowDownTarget) == False
akTarget.SetActorValue("Speedmult", akTarget.GetActorValue("Fame"))
akTarget.SetActorValue("Fame", 0)
2021-10-12 02:10:35 +00:00
2021-11-25 23:16:01 +00:00
ForceSpeedMultUpdate(akTarget)
2021-10-12 02:10:35 +00:00
EndIf
EndEvent
2021-10-05 22:15:58 +00:00
2021-11-25 23:16:01 +00:00
Function ForceSpeedMultUpdate(Actor akTarget)
akTarget.ModActorValue("InventoryWeight", -0.1)
2021-10-12 02:10:35 +00:00
Utility.Wait(0.01)
2021-11-25 23:16:01 +00:00
akTarget.ModActorValue("InventoryWeight", 0.1)
2021-10-12 02:10:35 +00:00
EndFunction