

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See([PC.0.0.FIGHTER_ALL])
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See(SecondNearest([PC.0.0.FIGHTER_ALL]))
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See([PC.0.0.RANGER_ALL])
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See(SecondNearest([PC.0.0.RANGER_ALL]))
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See([PC.0.0.PALADIN_ALL])
	!Kit(LastSeenBy(Myself),INQUISITOR)
	!Kit(LastSeenBy(Myself),CAVALIER)
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See(SecondNearest([PC.0.0.PALADIN_ALL]))
	!Kit(LastSeenBy(Myself),INQUISITOR)
	!Kit(LastSeenBy(Myself),CAVALIER)
	!Race(LastSeenBy(Myself),ELF)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See([PC])
	!Kit(LastSeenBy(Myself),INQUISITOR)
	!Kit(LastSeenBy(Myself),CAVALIER)
	!Race(LastSeenBy(Myself),ELF)
	!Class(LastSeenBy(Myself),MONK)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See(SecondNearest([PC]))
	!Kit(LastSeenBy(Myself),INQUISITOR)
	!Kit(LastSeenBy(Myself),CAVALIER)
	!Race(LastSeenBy(Myself),ELF)
	!Class(LastSeenBy(Myself),MONK)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END

IF
	!GlobalTimerNotExpired("OH_Dominate","LOCALS")
	See(ThirdNearest([PC]))
	!Kit(LastSeenBy(Myself),INQUISITOR)
	!Kit(LastSeenBy(Myself),CAVALIER)
	!Race(LastSeenBy(Myself),ELF)
	!Class(LastSeenBy(Myself),MONK)
	!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
	!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	CheckStatLT(LastSeenBy(Myself),50,RESISTMAGIC)
	CheckStatGT(LastSeenBy(Myself),-2,SAVEVSSPELL)
	!CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
	!HasItemEquiped("HELM06",LastSeenBy(Myself)) // Helm of Charm Protection
	!HasItemEquiped("NPCHAN",LastSeenBy(Myself)) // Corthala Family Armor
	!HasItemEquiped("SHLD25",LastSeenBy(Myself)) // Shield of Harmony +2
	!HasItemEquipedReal("SW2H14",LastSeenBy(Myself)) // Lilarcor
	!HasItemEquipedReal("SPER07",LastSeenBy(Myself)) // Spear of the Unicorn +2
	!HasItemEquipedReal("SW1H35",LastSeenBy(Myself)) // Adjatha the Drinker +2
	!HasItemEquipedReal("STAF11",LastSeenBy(Myself)) // Staff of the Magi
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
		SetGlobalTimer("OH_Dominate","LOCALS",TWO_ROUNDS)
		ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
		SetInterrupt(TRUE)
END



IF
    !InParty(Myself)
	Die()
THEN
	RESPONSE #100
		DropInventory()
		Kill(Myself)
		DestroySelf()
		CreateCreature("GASFORM4",[-1.-1],S)
		ActionOverride("GASFORM4",EscapeArea())
		//ReallyForceSpellDead(Myself,VAMPIRE_GAS_FORM_CHANGE)
   //     SetGlobalTimer("VampireResurrectTimer","LOCALS",FOUR_HOURS)
END



IF
    !InParty(Myself)
	AttackedBy([GOODCUTOFF],DEFAULT)
	Allegiance(Myself,NEUTRAL)
THEN
	RESPONSE #100
		Enemy()
END

IF
    !InParty(Myself)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		AttackReevaluate(NearestEnemyOf(Myself),30)
END

IF
    !InParty(Myself)
	AttackedBy([ANYONE],DEFAULT)
THEN
	RESPONSE #100
		Attack(LastAttackerOf(Myself))
END

