ScriptName aaaKimachuuOnslaughtPod Extends ActiveMagicEffect

Actor Property PlayerRef Auto
GlobalVariable Property aaaKimachuuOnslaughtGlo Auto

Actor actCaster

Event OnEffectStart(Actor akTarget, Actor akCaster)
	actCaster = akTarget
	RegisterForUpdate(5.0)
EndEvent

Event OnUpdate()
	If aaaKimachuuOnslaughtGlo.GetValueInt() == 1
		Float fXpod = actCaster.GetPositionX()
		Float fYpod = actCaster.GetPositionY()
		Float fZpod = actCaster.GetPositionZ()
		Float fZPlayer = PlayerRef.GetPositionZ()

		If (fZpod >= PlayerRef.GetPositionZ() + 3.0) || (fZpod <= PlayerRef.GetPositionZ() - 3.0) 
			actCaster.SetPosition(fXpod, fYpod, fZPlayer + 25.0)
		EndIf

		Return
	EndIf

	deathFunction(actCaster)
EndEvent

Function deathFunction(Actor act01)
	act01.SetPlayerTeammate(False)
	act01.Kill()
	act01.Disable()
	act01.Delete()
	actCaster = None
EndFunction