Scriptname swordActivatorLaserTriggerScript extends ObjectReference Const

import Utility

Weapon Property swordWeaponLaserWorks01  Auto Const
;Weapon Property swordWeaponLaserWorks02  Auto Const

Ammo Property swordAmmoLaserWorks01  Auto Const
Ammo Property swordAmmoLaserWorks02  Auto Const

Sound Property swordSEPlasma01  Auto Const
Sound Property swordSEPlasma02  Auto Const

EVENT onActivate(objectReference akActivator)

	Actor PlayerActor =  Game.GetPlayer()

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

	int index = RandomInt(0,1)

	While ftimeEnd - ftimeStart < 10.0
		ftimeEnd = GetCurrentRealTime()

		if ftimeEnd - ftimeStart > indexBullet
			if index == 0
				swordWeaponLaserWorks01.Fire(self, swordAmmoLaserWorks01)
				swordSEPlasma01.Play(self)  
			else
				swordWeaponLaserWorks01.Fire(self, swordAmmoLaserWorks02)
				swordSEPlasma02.Play(self)
			endif

			indexBullet += 1.0
		endif
		
	endWhile 

	disable()
	delete()

endEvent
