Scriptname aHHCreatureSpawnGenTriggerScript extends ObjectReference  

Actor Property playerref Auto ; Least 'costly' way to refer to the player
Objectreference property SpawnMarker1 auto
Objectreference property SpawnMarker2 auto
Objectreference property SpawnMarker3 auto
Objectreference property SpawnMarker4 auto
Objectreference property SpawnMarker5 auto
Objectreference property SpawnTrigger auto
ActorBase property creature auto
Actor property aHHFiendUnderREF auto
 
Event OnTriggerEnter(ObjectReference akActionRef)
	If akActionRef == PlayerREF ; This condition ensures that only the player will trigger this code
		int roll = Utility.RandomInt(1, 5) 
		If roll == 1
			SpawnMarker1.placeatme(creature)
		elseIf roll == 2
			SpawnMarker2.placeatme(creature)
		elseIf roll == 3
			SpawnMarker3.placeatme(creature)
		elseIf roll == 4
			SpawnMarker4.placeatme(creature)
		elseIf roll == 5
			SpawnMarker5.placeatme(creature)
		EndIf
		SpawnTrigger.disable()
		utility.wait(300)
		SpawnTrigger.enable()
	EndIf
EndEvent