Scriptname VampireSummonCreatureScript extends ActiveMagicEffect  

INT PROPERTY numToPlace AUTO  
;INT PROPERTY inInterior AUTO

Sound Property MAGLightCharge Auto
EffectShader property ReanimateFXShader auto
GlobalVariable Property VampireRank Auto
Objectreference Property CreatureSPawnXmarker Auto

ActorBase Property VampireSummonEncSkeever Auto
ActorBase Property VampireSummonEncWolf Auto
ActorBase Property VampireSummonEncFrostbiteSpider Auto
Actor property PCCombatTarget Auto hidden
Actor Property Creature1 Auto
Actor Property Creature2 Auto
Actor Property Creature3 Auto

Race Property DLC1VampireBeastRace Auto

Static Property CreatureXMarker Auto

Spell Property VampireRankSummonCreatureSpell Auto

PlayerVampireQuestScript Property PlayerVampireQuest  Auto
GlobalVariable Property EnableVampireBloodPoints Auto
GlobalVariable Property RECASTVampireCallCreature Auto
GlobalVariable Property VampireAbilityTimers Auto
GlobalVariable Property VampireCallCreatureToggle Auto
Sound Property NPCDragonPriestCombatIdleSpecial Auto
Idle Property IdleRitualSkull1 Auto

EVENT onEffectStart(Actor akTarget, Actor akSummonCaster)

	Int CallCreatureInThirdPerson = 1

	If VampireCallCreatureToggle.GetValue() == 0
	
		If Game.GetPlayer().IsInCombat() == False	
	
			If Game.GetCameraState() == 0
				CallCreatureInThirdPerson = 0
			EndIf
			
			If CallCreatureInThirdPerson == 0
				Game.ForceThirdPerson()
			EndIf	
			
			Game.DisablePlayerControls(false, true, false, false, false, false)
			Utility.Wait(2.0)
			
			Game.GetPlayer().PlayIdle(IdleRitualSkull1)
			Utility.Wait(0.5)		
			Int instanceID1 = NPCDragonPriestCombatIdleSpecial.Play(Game.GetPlayer())
			Sound.SetInstanceVolume(instanceID1, 2.0)		
			Utility.Wait(2.0)	
			Debug.SendAnimationEvent(Game.GetPlayer(), "IdleForceDefaultState")
			Game.EnablePlayerControls()
			Utility.Wait(1.0)
			Game.SetPlayerAIDriven(False)			
			
		Else	
	
			Int instanceID1 = NPCDragonPriestCombatIdleSpecial.Play(Game.GetPlayer())
			Sound.SetInstanceVolume(instanceID1, 2.0)		
			Utility.Wait(2.0)	

		EndIf		
	
		VampireCallCreatureToggle.SetValue(1)
	
		CreatureSpawnXmarker = Game.GetPlayer().PlaceAtMe(CreatureXmarker)

		If VampireRank.GetValue() == 10000
			numToPlace = 1
		ElseIf VampireRank.GetValue() == 20000
			numToPlace = 1
		ElseIf VampireRank.GetValue() == 30000
			numToPlace = 1
		ElseIf VampireRank.GetValue() == 40000
			numToPlace = 2	
		ElseIf VampireRank.GetValue() == 50000
			numToPlace = 2	
		ElseIf VampireRank.GetValue() >= 60000
			numToPlace = 3
		EndIf
		
		int instanceID = MAGLightCharge.play(game.getPlayer())        
		
		If EnableVampireBloodPoints.GetValue() == 10000 && RECASTVampireCallCreature.GetValue() == 0
			PlayerVampireQuest.VampireBloodPoints(20)
		EndIf
		
		;utility.wait(2.5)	
			
		If Game.GetPlayer().IsInInterior()
		
				Int TypeofIntCreature1 = Utility.RandomInt(1, 3)
				Int TypeofIntCreature2 = Utility.RandomInt(1, 3)
				Int TypeofIntCreature3 = Utility.RandomInt(1, 3)
				
			IF(numToPlace == 1)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else
					If TypeofIntCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)
					ElseIf TypeofIntCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)						
					EndIf
				EndIf	
			
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)
				
			ELSEIF(numToPlace == 2)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else		
					If TypeofIntCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)
					ElseIf TypeofIntCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)						
					EndIf
				EndIf	
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else			
					If TypeofIntCreature2 == 1
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature2 == 2
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)
					ElseIf TypeofIntCreature2 == 3
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)						
					EndIf				
				EndIf
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature2)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature2)		
				Creature2.SetActorValue("Health", PlayerHealth*0.6)
				Creature2.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature2.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)
				Creature2.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
			ELSEIF(numToPlace == 3)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else		
					If TypeofIntCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)
					ElseIf TypeofIntCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)						
					EndIf
				EndIf	
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else
					If TypeofIntCreature2 == 1
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature2 == 2
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)	
					ElseIf TypeofIntCreature2 == 3
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)						
					EndIf
				EndIf	
			
				utility.wait(0.1)
				ReanimateFXShader.play(Creature2)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature2)		
				Creature2.SetActorValue("Health", PlayerHealth*0.6)
				Creature2.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature2.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)
				Creature2.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else			
					If TypeofIntCreature3 == 1
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofIntCreature3 == 2
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)
					ElseIf TypeofIntCreature3 == 3
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)					
					EndIf
				EndIf			
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature3)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature3)		
				Creature3.SetActorValue("Health", PlayerHealth*0.6)
				Creature3.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature3.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Creature3.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
			ENDIF
		
		
		Else

				Int TypeofExtCreature1 = Utility.RandomInt(1, 3)
				Int TypeofExtCreature2 = Utility.RandomInt(1, 3)
				Int TypeofExtCreature3 = Utility.RandomInt(1, 3)
		
			IF(numToPlace == 1)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else		
					If TypeofExtCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)			
					EndIf			
				EndIf	
			
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
				
			ELSEIF(numToPlace == 2)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else				
					If TypeofExtCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)			
					EndIf		
				EndIf
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else				
					If TypeofExtCreature2 == 1
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature2 == 2
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature2 == 3
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)				
					EndIf			
				EndIf
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature2)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature2)		
				Creature2.SetActorValue("Health", PlayerHealth*0.6)
				Creature2.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature2.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Creature2.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
			ELSEIF(numToPlace == 3)

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else					
					If TypeofExtCreature1 == 1
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature1 == 2
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature1 == 3
						Creature1 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)			
					EndIf	
				EndIf			
			
				utility.wait(0.1)
				ReanimateFXShader.play(Creature1)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature1)		
				Float PlayerHealth = Game.GetPlayer().GetBaseActorValue("Health")
				Creature1.SetActorValue("Health", PlayerHealth*0.6)
				Float PlayerDamageResist = Game.GetPlayer().GetActorValue("DamageResist")
				Creature1.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Float PlayerOneHandedDamage = Game.GetPlayer().GetActorValue("OneHanded")
				Creature1.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Float PlayerMeleeDamage = Game.GetPlayer().GetActorValue("MeleeDamage")
				Creature1.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
				
				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else			
					If TypeofExtCreature2 == 1
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature2 == 2
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature2 == 3
						Creature2 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)			
					EndIf
				EndIf	
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature2)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature2)		
				Creature2.SetActorValue("Health", PlayerHealth*0.6)
				Creature2.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature2.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Creature2.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			

				If Game.GetPlayer().GetRace() == DLC1VampireBeastRace
					Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)	
				Else		
					If TypeofExtCreature3 == 1
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncSkeever, 2)
					ElseIf TypeofExtCreature3 == 2
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncFrostbiteSpider, 2)		
					ElseIf TypeofExtCreature3 == 3
						Creature3 = Game.GetPlayer().PlaceActorAtMe(VampireSummonEncWolf, 2)				
					EndIf				
				EndIf
				
				utility.wait(0.1)
				ReanimateFXShader.play(Creature3)
				Sound.SetInstanceVolume(instanceID, 1.0)
				utility.wait(1)
				ReanimateFXShader.stop(Creature3)		
				Creature3.SetActorValue("Health", PlayerHealth*0.6)
				Creature3.ForceActorValue("DamageResist", PlayerDamageResist*0.6)
				Creature3.SetActorValue("OneHanded", PlayerOneHandedDamage*0.6)	
				Creature3.SetActorValue("MeleeDamage", PlayerMeleeDamage*0.6)			
		
			ENDIF
			
		EndIf
		
		If Game.GetPlayer().IsInCombat()
			PCCombatTarget = Game.GetPlayer().GetCombatTarget()
				If PCCombatTarget == Game.GetPlayer()
					If (numToPlace >= 1) && Creature1.GetAV("Health") > 0
						Creature1.StopCombat()
					EndIf	
					If (numToPlace >= 2) && Creature2.GetAV("Health") > 0	
						Creature2.StopCombat()
					EndIf	
					If (numToPlace == 3) && Creature3.GetAV("Health") > 0	
						Creature3.StopCombat()
					EndIf	
				Else
					If (numToPlace >= 1) && Creature1.GetAV("Health") > 0
						Creature1.StartCombat(PCCombatTarget)
					EndIf	
					If (numToPlace >= 2) && Creature2.GetAV("Health") > 0	
						Creature2.StartCombat(PCCombatTarget)
					EndIf	
					If (numToPlace == 3) && Creature3.GetAV("Health") > 0	
						Creature3.StartCombat(PCCombatTarget)
					EndIf	
				EndIf					
		EndIf	

	Else

		If Game.GetPlayer().IsInCombat() == False	
	
			If Game.GetCameraState() == 0
				CallCreatureInThirdPerson = 0
			EndIf
			
			If CallCreatureInThirdPerson == 0
				Game.ForceThirdPerson()
			EndIf	
			
			Game.DisablePlayerControls(false, true, false, false, false, false)
			Utility.Wait(2.0)		
			
			Game.GetPlayer().PlayIdle(IdleRitualSkull1)	
			Utility.Wait(0.5)			
			Int instanceID2 = NPCDragonPriestCombatIdleSpecial.Play(Game.GetPlayer())
			Sound.SetInstanceVolume(instanceID2, 2.0)		
			Utility.Wait(2.0)		
			Debug.SendAnimationEvent(Game.GetPlayer(), "IdleForceDefaultState")
			Game.EnablePlayerControls()
			Utility.Wait(1.0)
			Game.SetPlayerAIDriven(False)			
	
			Game.GetPlayer().DispelSpell(VampireRankSummonCreatureSpell)
			VampireCallCreatureToggle.SetValue(0)
			
		Else	
		
			Game.GetPlayer().DispelSpell(VampireRankSummonCreatureSpell)
			VampireCallCreatureToggle.SetValue(0)

		EndIf		
		
	EndIf	
		
	If CallCreatureInThirdPerson == 0
		;Utility.Wait(1.0)
		Game.ForceFirstPerson()
	EndIf					
		
endEVENT 


EVENT onEffectFinish(Actor akTarget, Actor akCaster) 

	If RECASTVampireCallCreature.GetValue() <= 1
		RECASTVampireCallCreature.SetValue(1)
	EndIf

	If (numToPlace >= 1) && Creature1.GetAV("Health") > 0
		ReanimateFXShader.play(Creature1)
		utility.wait(1)
		Creature1.Disable(True)
		Creature1.Delete()
	EndIf
	
	If (numToPlace >= 2) && Creature2.GetAV("Health") > 0	
		ReanimateFXShader.play(Creature2)
		utility.wait(1)	
		Creature2.Disable(True)
		Creature2.Delete()
	EndIf
	
	If (numToPlace == 3) && Creature3.GetAV("Health") > 0	
		ReanimateFXShader.play(Creature3)
		utility.wait(1)	
		Creature3.Disable(True)
		Creature3.Delete()
	EndIf
	
	CreatureSpawnXmarker.Disable()
	CreatureSpawnXmarker.Delete()
	
	If RECASTVampireCallCreature.GetValue() == 1
	
		RECASTVampireCallCreature.SetValue(2)
		If VampireAbilityTimers.GetValue() == 0	
			Debug.Notification("You need to wait before attempting to call creatures again")	
			Utility.WaitGameTime(5)
			Utility.Wait(0.1)
			If Game.GetPlayer().HasSpell(VampireRankSummonCreatureSpell)
				Debug.Notification("Call Creature is available for use")
			EndIf	
		EndIf	
		RECASTVampireCallCreature.SetValue(0)
		
	EndIf	
	
	VampireCallCreatureToggle.SetValue(0)
	
EndEVENT

