IF
Global("MyRaceBlood","LOCALS",0)
OR(42)
Race(Myself,SKELETON)
Race(Myself,SPIDER)
Race(Myself,CARRIONCRAWLER)
Race(Myself,OTYUGH)
Race(Myself,BEETLE)
Race(Myself,SHADOW)
Race(Myself,SPECTRE)
Race(Myself,ANKHEG)
Race(Myself,WRAITH)
Race(Myself,MIST)
Race(Myself,WRAITH)
Race(Myself,GOLEM)
Race(Myself,ELEMENTAL)
Race(Myself,GENIE)
Race(Myself,STATUE)
Race(Myself,LICH)
Race(Myself,DEMILICH)
Race(Myself,PLANATAR)
Race(Myself,DARKPLANATAR)
Race(Myself,MYCONID)
Race(Myself,FEYR)
Race(Myself,HOOK_HORROR)
Race(Myself,SIMULACRUM)
Race(Myself,SPECTRAL_UNDEAD)
Race(Myself,SHAMBLING_MOUND)
Race(Myself,WILL-O-WISP)
Race(Myself,TREANT)
Race(Myself,SWORD)
Race(Myself,BOW)
Race(Myself,XBOW)
Race(Myself,STAFF)
Race(Myself,SLING)
Race(Myself,MACE)
Race(Myself,DAGGER)
Race(Myself,SPEAR)
Race(Myself,FIST)
Race(Myself,HAMMER)
Race(Myself,MORNINGSTAR)
Race(Myself,ROBES)
Race(Myself,LEATHER)
Race(Myself,CHAIN)
Race(Myself,PLATE)
THEN
  RESPONSE #100
  SetGlobal("MyRaceBlood","LOCALS",1)
END

IF
Global("MyRaceBlood","LOCALS",0)
OR(5)
Race(Myself,DEMONIC)
Race(Myself,LYCANTHROPE)
Race(Myself,SOLAR)
Race(Myself,ANTISOLAR)
Race(Myself,SOLAR)
Race(Myself,MEPHIT)
Race(Myself,IMP)
THEN 
  RESPONSE #100
  SetGlobal("MyRaceBlood","LOCALS",2)
END

IF
Global("MyRaceBlood","LOCALS",0)
OR(14)
Race(Myself,BASILISK)
Race(Myself,DOPPLEGANGER)
Race(Myself,ETTERCAP)
Race(Myself,GHOUL)
Race(Myself,UMBERHULK)
Race(Myself,SAHUAGIN)
Race(Myself,KUO-TOA)
Race(Myself,ZOMBIE)
Race(Myself,TIEFLING)
Race(Myself,YUANTI)
Race(Myself,LIZARDMAN)
Race(Myself,SALAMANDER)
Race(Myself,REPTILE)
Race(Myself,AASIMAR)  
THEN 
 RESPONSE #100
   SetGlobal("MyRaceBlood","LOCALS",3)
END

IF
Global("MyRaceBlood","LOCALS",0)
Delay(5)
Global("MyRaceBlood","LOCALS",0)
THEN
 RESPONSE #100
    SetGlobal("MyRaceBlood","LOCALS",4)
END
  

IF
	Race(Myself,VAMPIRE)
	!Global("TimerHunger","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobalTimer("BloodlustTimer","LOCALS",ONE_DAY)
		SetGlobal("TimerHunger","LOCALS",1)
		Continue()
END




IF 
   !Global("ActorVampirisedLevel","LOCALS",0)
   Global("MyRaceBlood","LOCALS",2)
THEN
  RESPONSE #100
  SetGlobal("ActorVampirisedLevel","LOCALS",0)
 // Kill(LastTalkedToBy(Myself))
END

IF 
   !Global("ActorVampirisedLevel","LOCALS",0)
   Global("MyRaceBlood","LOCALS",3)
THEN
  RESPONSE #100
  SetGlobal("ActorVampirisedLevel","LOCALS",0)
END


IF 
   !Global("ActorVampirisedLevel","LOCALS",0)
   Global("MyRaceBlood","LOCALS",1)
THEN
  RESPONSE #100
  SetGlobal("ActorVampirisedLevel","LOCALS",0)
END


IF 
   Global("MyRaceBlood","LOCALS",4)
   Global("ActorVampirisedLevel","LOCALS",1)
THEN
  RESPONSE #100
   SetGlobal("ActorVampirisedLevel","LOCALS",0)
   
    CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
		ChangeStat(Myself,USE_ANY_ITEM,1,SET)
		ChangeStat(Myself,PROFICIENCYMACE,1,ADD)
		

		ChangeAlignment(Myself,CHAOTIC_EVIL)
		ChangeRace(Myself,VAMPIRE)
		ChangeGeneral(Myself,UNDEAD)
		
		GiveItemCreate("vampreg1",Myself,1,1,0) // Ring
		GiveItemCreate("DAGG01",Myself,1,1,0) // Dagger		
		GiveItemCreate("VVCASKET",Myself,1,1,0) // Empty Casket
	

		XEquipItem("vampreg1",Myself,SLOT_RING_RIGHT,EQUIP) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger		
		ActionOverride(Myself,TransformItem("DAGG01","VAMT01"))
		
		ChangeStat(Player1,CON,2,ADD)
		ChangeStat(Player1,STR,4,ADD)
		ChangeStat(Player1,WIS,-2,ADD)
		ChangeStat(Player1,INT,-2,ADD)

		ChangeStat(Myself,RESISTCOLD,50,ADD)
		ChangeStat(Myself,RESISTPOISON,100,ADD)
		ChangeStat(Myself,RESISTFIRE,-50,ADD)
		ChangeStat(Myself,USE_ANY_ITEM,0,SET)
		
		SetGlobal("VampireAbilities","LOCALS",0)	
END

IF 
   Global("MyRaceBlood","LOCALS",4)
   Global("ActorVampirisedLevel","LOCALS",2)
THEN
  RESPONSE #100
   SetGlobal("ActorVampirisedLevel","LOCALS",0)
   
    CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
		ChangeStat(Myself,USE_ANY_ITEM,1,SET)
		ChangeStat(Myself,PROFICIENCYMACE,1,ADD)
		

		ChangeAlignment(Myself,CHAOTIC_EVIL)
		ChangeRace(Myself,VAMPIRE)
		ChangeGeneral(Myself,UNDEAD)
		
		GiveItemCreate("vampreg1",Myself,1,1,0) // Ring
		GiveItemCreate("DAGG01",Myself,1,1,0) // Dagger		
		GiveItemCreate("VVCASKET",Myself,1,1,0) // Empty Casket
	

		XEquipItem("vampreg1",Myself,SLOT_RING_RIGHT,EQUIP) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger		
		ActionOverride(Myself,TransformItem("DAGG01","VAMT06"))
		
		ChangeStat(Player1,CON,2,ADD)
		ChangeStat(Player1,STR,4,ADD)
		ChangeStat(Player1,WIS,-2,ADD)
		ChangeStat(Player1,INT,-2,ADD)

		ChangeStat(Myself,RESISTCOLD,50,ADD)
		ChangeStat(Myself,RESISTPOISON,100,ADD)
		ChangeStat(Myself,RESISTFIRE,-50,ADD)
		ChangeStat(Myself,USE_ANY_ITEM,0,SET)
		
		SetGlobal("VampireAbilities","LOCALS",0)	
END

IF 
   Global("MyRaceBlood","LOCALS",4)
   Global("ActorVampirisedLevel","LOCALS",3)
THEN
  RESPONSE #100
   SetGlobal("ActorVampirisedLevel","LOCALS",0)
   
    CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
		ChangeStat(Myself,USE_ANY_ITEM,1,SET)
		ChangeStat(Myself,PROFICIENCYMACE,1,ADD)
		

		ChangeAlignment(Myself,CHAOTIC_EVIL)
		ChangeRace(Myself,VAMPIRE)
		ChangeGeneral(Myself,UNDEAD)
		
		GiveItemCreate("vampreg1",Myself,1,1,0) // Ring
		GiveItemCreate("DAGG01",Myself,1,1,0) // Dagger		
		GiveItemCreate("VVCASKET",Myself,1,1,0) // Empty Casket
	

		XEquipItem("vampreg1",Myself,SLOT_RING_RIGHT,EQUIP) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger		
		ActionOverride(Myself,TransformItem("DAGG01","VAMT08"))
		
		ChangeStat(Player1,CON,2,ADD)
		ChangeStat(Player1,STR,4,ADD)
		ChangeStat(Player1,WIS,-2,ADD)
		ChangeStat(Player1,INT,-2,ADD)

		ChangeStat(Myself,RESISTCOLD,50,ADD)
		ChangeStat(Myself,RESISTPOISON,100,ADD)
		ChangeStat(Myself,RESISTFIRE,-50,ADD)
		ChangeStat(Myself,USE_ANY_ITEM,0,SET)
		
		SetGlobal("VampireAbilities","LOCALS",0)	
END


IF 
   Global("MyRaceBlood","LOCALS",4)
   Global("ActorVampirisedLevel","LOCALS",4)
THEN
  RESPONSE #100
   SetGlobal("ActorVampirisedLevel","LOCALS",0)
   
    CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
		ChangeStat(Myself,USE_ANY_ITEM,1,SET)
		ChangeStat(Myself,PROFICIENCYMACE,1,ADD)
		

		ChangeAlignment(Myself,CHAOTIC_EVIL)
		ChangeRace(Myself,VAMPIRE)
		ChangeGeneral(Myself,UNDEAD)
		
		GiveItemCreate("vampreg1",Myself,1,1,0) // Ring
		GiveItemCreate("DAGG01",Myself,1,1,0) // Dagger		
		GiveItemCreate("VVCASKET",Myself,1,1,0) // Empty Casket
	

		XEquipItem("vampreg1",Myself,SLOT_RING_RIGHT,EQUIP) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger		
		ActionOverride(Myself,TransformItem("DAGG01","VAMT10"))
		
		ChangeStat(Player1,CON,2,ADD)
		ChangeStat(Player1,STR,4,ADD)
		ChangeStat(Player1,WIS,-2,ADD)
		ChangeStat(Player1,INT,-2,ADD)

		ChangeStat(Myself,RESISTCOLD,50,ADD)
		ChangeStat(Myself,RESISTPOISON,100,ADD)
		ChangeStat(Myself,RESISTFIRE,-50,ADD)
		ChangeStat(Myself,USE_ANY_ITEM,0,SET)
		
		SetGlobal("VampireAbilities","LOCALS",0)	
END

IF 
   Global("MyRaceBlood","LOCALS",4)
   Global("ActorVampirisedLevel","LOCALS",5)
THEN
  RESPONSE #100
   SetGlobal("ActorVampirisedLevel","LOCALS",0)
   
    CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
		ChangeStat(Myself,USE_ANY_ITEM,1,SET)
		ChangeStat(Myself,PROFICIENCYMACE,1,ADD)
		

		ChangeAlignment(Myself,CHAOTIC_EVIL)
		ChangeRace(Myself,VAMPIRE)
		ChangeGeneral(Myself,UNDEAD)
		
		GiveItemCreate("vampreg1",Myself,1,1,0) // Ring
		GiveItemCreate("DAGG01",Myself,1,1,0) // Dagger		
		GiveItemCreate("VVCASKET",Myself,1,1,0) // Empty Casket
	

		XEquipItem("vampreg1",Myself,SLOT_RING_RIGHT,EQUIP) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger		
		ActionOverride(Myself,TransformItem("DAGG01","VAMT12"))
		
		ChangeStat(Player1,CON,2,ADD)
		ChangeStat(Player1,STR,4,ADD)
		ChangeStat(Player1,WIS,-2,ADD)
		ChangeStat(Player1,INT,-2,ADD)

		ChangeStat(Myself,RESISTCOLD,50,ADD)
		ChangeStat(Myself,RESISTPOISON,100,ADD)
		ChangeStat(Myself,RESISTFIRE,-50,ADD)
		ChangeStat(Myself,USE_ANY_ITEM,0,SET)
		
		SetGlobal("VampireAbilities","LOCALS",0)	
END


IF
	InParty(Myself)
	Race(Myself,VAMPIRE)
	HasItemEquiped("VAMT01",Myself) // Vampiric Touch
	LevelGT(Myself,5)
THEN
	RESPONSE #100
		ActionOverride(Myself,TransformItem("VAMT01","VAMT06"))
		ChangeStat(Myself,CON,1,ADD)
		ChangeStat(Myself,STR,1,ADD)
		ChangeStat(Myself,RESISTCOLD,10,ADD)
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		Continue()
END

IF
	InParty(Myself)
	Race(Myself,VAMPIRE)
	HasItemEquiped("VAMT06",Myself) // Vampiric Touch
	LevelGT(Myself,15)
THEN
	RESPONSE #100
		ActionOverride(Myself,TransformItem("VAMT06","VAMT08"))
		ChangeStat(Myself,CON,1,ADD)
		ChangeStat(Myself,STR,1,ADD)
		ChangeStat(Myself,RESISTCOLD,10,ADD)
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		ActionOverride(Myself,AddSpecialAbility("SPIN882")) // Vampire Fear
		ActionOverride(Myself,AddSpecialAbility("SPIN883")) // Domination
		Continue()
END

IF
	InParty(Myself)
	Race(Myself,VAMPIRE)
	HasItemEquiped("VAMT08",Myself) // Vampiric Touch
	LevelGT(Myself,20)
THEN
	RESPONSE #100
		ActionOverride(Myself,TransformItem("VAMT08","VAMT10"))
		ChangeStat(Myself,CON,1,ADD)
		ChangeStat(Myself,STR,1,ADD)
		ChangeStat(Myself,RESISTCOLD,10,ADD)
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		ActionOverride(Myself,AddSpecialAbility("SPIN882")) // Vampire Fear
		ActionOverride(Myself,AddSpecialAbility("SPIN883")) // Domination
		Continue()
END

IF
	InParty(Myself)
	Race(Myself,VAMPIRE)
	HasItemEquiped("VAMT10",Myself) // Vampiric Touch
	LevelGT(Myself,30)
THEN
	RESPONSE #100
		ActionOverride(Myself,TransformItem("VAMT10","VAMT12"))
		ChangeStat(Myself,STR,2,ADD)
		ChangeStat(Myself,RESISTCOLD,10,ADD)
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		ActionOverride(Myself,AddSpecialAbility("SPIN882")) // Vampire Fear
		ActionOverride(Myself,AddSpecialAbility("SPIN883")) // Domination
		ActionOverride(Myself,AddSpecialAbility("OHGASFRM")) // Gaseous Form
		Continue()
END

IF
	InParty(Myself)
	Race(Myself,VAMPIRE)
	AreaType(OUTDOOR)
	TimeGT(DAWN_START)
	TimeLT(DUSK_END)
	!HasItemEquiped("ohhcloak",Myself) // Cloak of Dragomir
	!HasItemEquiped("ohhkork",Myself) // Korkorran
//	!HasItemEquiped("miriama1",Myself)
//	!HasItemEquiped("miriama2",Myself)
//	!HasItemEquiped("miriama3",Myself)
//	!HasItemEquiped("miriama4",Myself)
THEN
	RESPONSE #100
		ApplyDamage(Myself,20,FIRE)
		DisplayString(Myself,42935) // Oooh, that burns. 
        SetGlobalTimer("SunBurns","LOCALS","THREE_ROUNDS")
		Wait(1)
		Continue()
END




IF
	Race(Myself,VAMPIRE)
	Delay(3)
	OR(13)
		HasItem("blun12",Myself) // Mace of Disruption +1
		HasItem("blun25",Myself) // Mace of Disruption +2
		HasItem("hamm10",Myself) // Runehammer +4
		HasItem("hamm11",Myself) // Runehammer +5
		HasItem("ax1h10",Myself) // Azuredge +3
		HasItem("sw1h31",Myself) // Daystar +2
		HasItem("sw1h64",Myself) // Purifier +4
		HasItem("sw1h65",Myself) // Purifier +5
		HasItem("npsw03",Myself) // Hallowed Redeemer +2
		HasItem("sw2h10",Myself) // Carsomyr +5
		HasItem("sw2h19",Myself) // Carsomyr +6
		HasItem("miscau",Myself) // Elven Holy Water
		HasItem("brac23",Myself) // Blessed Bracers
THEN
	RESPONSE #100
		ApplyDamage(Myself,20,STUNNING)
		DisplayString(Myself,42935) // Oooh, that burns. 
		DropItem("blun12",[-1.-1]) // Mace of Disruption +1
		DropItem("blun25",[-1.-1]) // Mace of Disruption +2
		DropItem("hamm10",[-1.-1]) // Runehammer +4
		DropItem("hamm11",[-1.-1]) // Runehammer +5
		DropItem("ax1h10",[-1.-1]) // Azuredge +3
		DropItem("sw1h31",[-1.-1]) // Daystar +2
		DropItem("sw1h64",[-1.-1]) // Purifier +4
		DropItem("sw1h65",[-1.-1]) // Purifier +5
		DropItem("npsw03",[-1.-1]) // Hallowed Redeemer +2
		DropItem("sw2h10",[-1.-1]) // Carsomyr +5
		DropItem("sw2h19",[-1.-1]) // Carsomyr +6
		DropItem("miscau",[-1.-1]) // Elven Holy Water
		DropItem("brac23",[-1.-1]) // Blessed Bracers
		Continue()
END


IF
	Global("VampireAbilities","LOCALS",0)
	InParty(Myself)
	Race(Myself,VAMPIRE)
THEN
	RESPONSE #100
		ActionOverride(Myself,AddSpecialAbility("OHGASFRM")) // Gaseous Form
		ActionOverride(Myself,AddSpecialAbility("OHGASFRM")) // Gaseous Form
		ActionOverride(Myself,AddSpecialAbility("SPIN110")) // Shapeshift: Wolf
		ActionOverride(Myself,AddSpecialAbility("SPIN110")) // Shapeshift: Wolf
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		ActionOverride(Myself,AddSpecialAbility("OHHDRAIN")) // Blood Drain
		ActionOverride(Myself,AddSpecialAbility("SPIN882")) // Vampire Fear
		ActionOverride(Myself,AddSpecialAbility("SPIN883")) // Domination
		ActionOverride(Myself,AddSpecialAbility("SPIN150")) // Shapeshift: Natural Form
		ActionOverride(Myself,AddSpecialAbility("SPIN150")) // Shapeshift: Natural Form
		SetGlobal("VampireAbilities","LOCALS",1)
		Continue()
END


IF
InParty(Myself)
	Race(Myself,VAMPIRE)
	OR(2)
		Killed([ANYONE])
		SpellCastInnateRES("OHHDRAIN",[ANYONE]) // Blood Drain
THEN
	RESPONSE #100
		SetGlobalTimer("BloodlustTimer","LOCALS",ONE_DAY)
		SetGlobalTimer("BloodlustDeathTimer","LOCALS",THREE_DAYS)
		
		Wait(1)
END

IF
InParty(Myself)
	Race(Myself,VAMPIRE)
	GlobalTimerExpired("BloodlustTimer","LOCALS")
THEN
	RESPONSE #100
		DisplayStringHead(Myself,25758) // No such index
		Continue()
END

IF
InParty(Myself)
	Race(Myself,VAMPIRE)
	GlobalTimerExpired("BloodlustDeathTimer","LOCALS")
THEN
	RESPONSE #100
		DisplayStringHead(Myself,5221) // No such index
		Wait(5)
		Kill(Myself)
END

IF
InParty(Myself)
	Race(Myself,VAMPIRE)
	GlobalTimerExpired("BloodlustTimer","LOCALS")
	See([ANYONE])
	!Race(LastSeenBy(Myself),VAMPIRE)
	OR(2)
		Gender(LastSeenBy(Myself),MALE)
		Gender(LastSeenBy(Myself),FEMALE)
	HaveSpellRES("OHHDRAIN") // Blood Drain
THEN
	RESPONSE #100
		MoveToObject(LastSeenBy(Myself))
		SpellNoDecRES("OHHDRAIN",LastSeenBy(Myself)) // Blood Drain
//		Continue()
END

IF
InParty(Myself)
	Race(Myself,VAMPIRE)
	GlobalTimerExpired("BloodlustTimer","LOCALS")
	See([ANYONE])
	!Race(LastSeenBy(Myself),VAMPIRE)
	OR(2)
		Gender(LastSeenBy(Myself),MALE)
		Gender(LastSeenBy(Myself),FEMALE)
	!HaveSpellRES("OHHDRAIN") // Blood Drain
THEN
	RESPONSE #100
		MoveToObject(LastSeenBy(Myself))
		SpellNoDecRES("OHHDRAIN",LastSeenBy(Myself)) // Blood Drain
	//		Attack(LastSeenBy(Myself))
//		Berserk()
//		Continue()
END

