Scriptname VampireFeedingHotkeyScript2 Extends ActiveMagicEffect  
{allows the vampire to combat bite by pressing a hotkey}

PlayerVampireQuestScript Property PlayerVampireQuest Auto
GlobalVariable Property VampireSneakFeed Auto
Keyword Property Vampire Auto
GlobalVariable Property VampireCustomRace Auto
Race Property DLC1VampireBeastRace Auto
Keyword Property ActorTypeNPC Auto
Keyword Property ActorTypeUndead Auto
Keyword Property ActorTypeGhost Auto
Faction Property DLC1ThrallFaction Auto
MagicEffect Property DLC1VampireMesmerizeMagicEffect Auto
MagicEffect Property PerkMasterMindAggDownFFAimed Auto
MagicEffect Property InfluenceAggDownFFAimed Auto
GlobalVariable Property VampireForceFeed Auto
dlc1vampireturnscript Property DLC1VampireTurn Auto
GlobalVariable Property VampireFeedOffDead Auto
MagicEffect Property ParalysisFFAimedVampireSleep2 Auto
GlobalVariable Property VampireCombatBite Auto
Perk Property VampireAmaranth Auto
GlobalVariable Property VampireRank Auto
Race Property FalmerRace Auto 


Event OnEffectStart(Actor akTarget, Actor akCaster)

	;VampireFeed Perk 7 - Combat Biting

		If (VampireCombatBite.GetValue() == 0 && (Game.GetPlayer().HasKeyword(Vampire) || VampireCustomRace.GetValue() == 10000)) && (akTarget.GetActorValue("variable08") != 9 && (akTarget.HasKeyword(ActorTypeNPC) || akTarget.GetActorBase().GetRace() == FalmerRace) && akTarget.HasKeyword(ActorTypeUndead) == 0 && akTarget.HasKeyword(ActorTypeGhost) == 0 && akTarget.IsGhost() == 0 && akTarget.HasKeyword(Vampire) == 0 && akTarget.IsChild() == 0 && akTarget.IsBleedingOut() == 0 && akTarget.IsDead() == 0 && akTarget.GetSleepState() == 0 && akTarget.IsInFaction(DLC1ThrallFaction) == 0 && akTarget.HasMagicEffect(DLC1VampireMesmerizeMagicEffect) == 0 && akTarget.HasMagicEffect(PerkMasterMindAggDownFFAimed) == 0 && akTarget.HasMagicEffect(InfluenceAggDownFFAimed) == 0)
		
			;Debug.Notification("Biting")
			PlayerVampireQuest.VampireBite(akTarget as actor)
		
		EndIf		
	
; =====================================================================================================================================================
	
	If Game.GetPlayer().HasPerk(VampireAmaranth)
	
	; VampireAmaranth Perk 7 - Combat Biting		
	
		If (VampireRank.GetValue() >= 60000 && VampireCombatBite.GetValue() == 0 && (Game.GetPlayer().HasKeyword(Vampire) || VampireCustomRace.GetValue() == 10000)) && (akTarget.GetActorValue("variable08") != 9 && akTarget.GetActorValue("variable05") != 666 && (akTarget.HasKeyword(ActorTypeNPC) || akTarget.GetActorBase().GetRace() == FalmerRace) && akTarget.HasKeyword(ActorTypeGhost) == 0 && akTarget.IsGhost() == 0 && akTarget.HasKeyword(Vampire) == 1 && akTarget.IsChild() == 0 && akTarget.IsBleedingOut() == 0 && akTarget.IsDead() == 0 && akTarget.GetSleepState() == 0 && akTarget.IsInFaction(DLC1ThrallFaction) == 0 && akTarget.HasMagicEffect(DLC1VampireMesmerizeMagicEffect) == 0 && akTarget.HasMagicEffect(PerkMasterMindAggDownFFAimed) == 0 && akTarget.HasMagicEffect(InfluenceAggDownFFAimed) == 0)

		;Debug.Notification("Biting")
		PlayerVampireQuest.VampireBite(akTarget as actor)

		EndIf	
	
	EndIf	
	
EndEvent
