Scriptname VampireBloodWardScript extends ActiveMagicEffect  

PlayerVampireQuestScript Property PlayerVampireQuest  Auto
GlobalVariable Property EnableVampireBloodPoints Auto
GlobalVariable Property VampireBloodPoints Auto
GlobalVariable Property VampireRank Auto

Int Property CurrentBloodPointCost Auto

Event OnEffectStart(Actor Target, Actor Caster)

	Utility.Wait(0.5)

	;If Caster == Game.GetPlayer() && EnableVampireBloodPoints.GetValue() == 10000
		;PlayerVampireQuest.VampireBloodPoints(CurrentBloodPointCost)
	;EndIf	

	RegisterForUpdate(1.0)
		
EndEvent


Event OnUpdate()

	If VampireRank.GetValue() <= 20000
		Game.GetPlayer().DamageActorValue("Health", 2)
	ElseIf VampireRank.GetValue() > 20000 && VampireRank.GetValue() <= 40000
		Game.GetPlayer().DamageActorValue("Health", 2.5)
	ElseIf VampireRank.GetValue() > 40000
		Game.GetPlayer().DamageActorValue("Health", 3)
	EndIf		
		
	If EnableVampireBloodPoints.GetValue() == 10000
		If VampireBloodPoints.GetValue() > 0
			VampireBloodPoints.SetValue(VampireBloodPoints.GetValue() - 2)
		EndIf
	EndIf

EndEvent


Event OnEffectFinish(Actor akTarget, Actor akCaster)

	Utility.Wait(0.5)
		
	UnRegisterForUpdate()
	UnRegisterForUpdate()	
			
EndEvent