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