Scriptname VampireLordDrainAddition Extends ActiveMagicEffect  
  
  
GlobalVariable Property VampireDrainExperienceGained Auto
GlobalVariable Property EnableVampireBloodPoints Auto
GlobalVariable Property VampireDrainBloodPointsGained Auto
GlobalVariable Property VampireBloodPoints Auto
GlobalVariable Property VampireDynamicStages Auto
GlobalVariable Property VampireStageGlobal Auto
GlobalVariable Property AdjustingVampireSatiation Auto

Keyword Property ActorTypeDwarven Auto

PlayerVampireQuestScript Property PlayerVampireQuest  Auto



Event OnEffectStart(Actor Target, Actor Caster)

	If Caster == Game.GetPlayer()
	
		If Game.GetPlayer().GetCombatTarget().HasKeyword(ActorTypeDwarven)
		
		Else
		
			Float ExperienceGained = ((VampireDrainExperienceGained.GetValue()*4) + (VampireDrainExperienceGained.GetValue()*(Game.GetPlayer().GetActorValue("Destruction")/25)))
			Game.AdvanceSkill("Destruction",ExperienceGained)
			
			If EnableVampireBloodPoints.GetValue() <= 10000 && VampireDrainBloodPointsGained.GetValue() == 10000
			
				Float AddingBP = (VampireBloodPoints.GetValue() +10)
				
				If VampireDynamicStages.GetValue() == 20000 && VampireBloodPoints.GetValue() < 100
					VampireBloodPoints.SetValue(AddingBP)
					If VampireBloodPoints.GetValue() >= 99
						VampireBloodPoints.SetValue(100)
					EndIf	
				EndIf
				
				If VampireDynamicStages.GetValue() <= 10000 && VampireBloodPoints.GetValue() < 300
					VampireBloodPoints.SetValue(AddingBP)
					If VampireBloodPoints.GetValue() >= 299
						VampireBloodPoints.SetValue(300)
					EndIf				
				EndIf
				
			EndIf	
			
		EndIf	
			
	EndIf	
		
EndEvent



Event OnEffectFinish(Actor Target, Actor Caster)


		If Caster == Game.GetPlayer()

			If AdjustingVampireSatiation.GetValue() == 0
			
				While Game.GetPlayer().IsInCombat()
					AdjustingVampireSatiation.SetValue(1)
				EndWhile
		  
				Utility.Wait(3.0)		  
		  
				If EnableVampireBloodPoints.GetValue() <= 10000 && VampireDrainBloodPointsGained.GetValue() == 10000  
		  
					If VampireDynamicStages.GetValue() == 20000 && VampireStageGlobal.GetValue() >= 4 && VampireBloodPoints.GetValue() > 0 && EnableVampireBloodPoints.GetValue() == 10000
					
						PlayerVampireQuest.SetVampireSatiation()
						
					ElseIf VampireDynamicStages.GetValue() == 20000 && VampireStageGlobal.GetValue() >= 4 && VampireBloodPoints.GetValue() > 20 && EnableVampireBloodPoints.GetValue() == 0
					
						PlayerVampireQuest.SetVampireSatiation()	
						
					;--------------------------------------------	
						
					ElseIf VampireDynamicStages.GetValue() == 10000 && VampireStageGlobal.GetValue() >= 4 && VampireBloodPoints.GetValue() >= 0 && VampireBloodPoints.GetValue() < 100
		  
						PlayerVampireQuest.SetVampireSatiation()
		  
					ElseIf VampireDynamicStages.GetValue() == 10000 && VampireStageGlobal.GetValue() >= 3 && VampireBloodPoints.GetValue() >= 100 && VampireBloodPoints.GetValue() < 200
		  
						PlayerVampireQuest.SetVampireSatiation()

					ElseIf VampireDynamicStages.GetValue() == 10000 && VampireStageGlobal.GetValue() >= 2 && VampireBloodPoints.GetValue() >= 200 && VampireBloodPoints.GetValue() < 300
		  
						PlayerVampireQuest.SetVampireSatiation()
			
					ElseIf VampireDynamicStages.GetValue() == 10000 && VampireStageGlobal.GetValue() >= 2 && VampireBloodPoints.GetValue() >= 300
		  
						PlayerVampireQuest.SetVampireSatiation()
						
					;--------------------------------------------		
						
					ElseIf VampireDynamicStages.GetValue() == 0 && VampireStageGlobal.GetValue() >= 4 && VampireBloodPoints.GetValue() >= 0 && VampireBloodPoints.GetValue() < 100
		  
						PlayerVampireQuest.SetVampireSatiation()
		  
					ElseIf VampireDynamicStages.GetValue() == 0 && VampireStageGlobal.GetValue() >= 3 && VampireBloodPoints.GetValue() >= 100 && VampireBloodPoints.GetValue() < 200
		  
						PlayerVampireQuest.SetVampireSatiation()

					ElseIf VampireDynamicStages.GetValue() == 0 && VampireStageGlobal.GetValue() >= 2 && VampireBloodPoints.GetValue() >= 200 && VampireBloodPoints.GetValue() < 300
		  
						PlayerVampireQuest.SetVampireSatiation()
			
					ElseIf VampireDynamicStages.GetValue() == 0 && VampireStageGlobal.GetValue() >= 2 && VampireBloodPoints.GetValue() >= 300
		  
						PlayerVampireQuest.SetVampireSatiation()	
					
					EndIf
				
					Utility.Wait(5.0)
					AdjustingVampireSatiation.SetValue(0)
				
				EndIf	
				
			EndIf

		EndIf			
  
EndEvent