Fixed FrostSlowFix changing actor value and comparing base actor value afterwards
This commit is contained in:
parent
467d42a300
commit
330f9f1a96
Binary file not shown.
@ -3,35 +3,30 @@ Scriptname FrostSlowFix extends activemagiceffect
|
||||
|
||||
Keyword Property MagicSlowDownTarget Auto
|
||||
|
||||
Actor Target
|
||||
|
||||
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
||||
Target = akTarget
|
||||
|
||||
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)
|
||||
Float fBaseSpeed = akTarget.GetBaseActorValue("Speedmult")
|
||||
|
||||
ForceSpeedMultUpdate()
|
||||
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 Target == None ; version update
|
||||
Target = akTarget
|
||||
EndIf
|
||||
|
||||
If Target.HasMagicEffectWithKeyword(MagicSlowDownTarget) == False
|
||||
Target.SetActorValue("Speedmult", Target.GetBaseActorValue("Fame"))
|
||||
Target.SetActorValue("Fame", 0)
|
||||
If akTarget.HasMagicEffectWithKeyword(MagicSlowDownTarget) == False
|
||||
akTarget.SetActorValue("Speedmult", akTarget.GetActorValue("Fame"))
|
||||
akTarget.SetActorValue("Fame", 0)
|
||||
|
||||
ForceSpeedMultUpdate()
|
||||
ForceSpeedMultUpdate(akTarget)
|
||||
EndIf
|
||||
EndEvent
|
||||
|
||||
Function ForceSpeedMultUpdate()
|
||||
Target.ModActorValue("InventoryWeight", -0.1)
|
||||
Function ForceSpeedMultUpdate(Actor akTarget)
|
||||
akTarget.ModActorValue("InventoryWeight", -0.1)
|
||||
Utility.Wait(0.01)
|
||||
Target.ModActorValue("InventoryWeight", 0.1)
|
||||
akTarget.ModActorValue("InventoryWeight", 0.1)
|
||||
EndFunction
|
||||
|
Loading…
Reference in New Issue
Block a user