Scriptname swordActorReignofFireScript extends Actor Const

import Utility

Weapon Property swordWeaponReignofMissile  Auto Const

Ammo Property swordAmmoMissile  Auto Const

ObjectReference Property Cast01 Auto Const
ObjectReference Property Cast02 Auto Const
ObjectReference Property Cast03 Auto Const

Event OnInit()

	float ftimeStart = GetCurrentRealTime()
	float ftimeEnd = 0.0
	float indexBullet = 3.0

	int index

	While ftimeEnd - ftimeStart < 60.0
		ftimeEnd = GetCurrentRealTime()

		if ftimeEnd - ftimeStart > indexBullet

			index += 1
			index = index % 3

			if index == 0
				Cast01.MoveTo(self, 0, 0, -400, true)
				Cast01.setAngle(RandomInt(75,105), RandomInt(75,105), 0)
				swordWeaponReignofMissile.Fire(Cast01, swordAmmoMissile)
			elseif index == 1
				Cast02.MoveTo(self, 0, 0, -400, true)
				Cast02.setAngle(RandomInt(75,105), RandomInt(75,105), 0)
				swordWeaponReignofMissile.Fire(Cast02, swordAmmoMissile)
			else
				Cast03.MoveTo(self, 0, 0, -400, true)
				Cast03.setAngle(RandomInt(75,105), RandomInt(75,105), 0)
				swordWeaponReignofMissile.Fire(Cast03, swordAmmoMissile)
			endif

			indexBullet += 2.0
		endif
		
	endWhile 

	disable()
	delete()

endEvent
