IF
  RandomNumLT(100,5)
  Race(Player1,VAMPIRE)
  Gender(Player1,FEMALE)
  InParty(Myself)
  Global("VampireWorldRomances","GLOBAL",1)
  Global("DerekRomanceStart","LOCALS",0)
//  !AreaType(OUTDOOR)
THEN
  RESPONSE #100
   SetGlobal("DEREKROMANCE","GLOBAL",2)
   SetGlobal("DerekRomanceStart","LOCALS",1)
END


IF
InParty(Myself)
See(Player1)
!See([ENEMY])
!AreaType(OUTDOOR)
Global("VampireWorldRomances","GLOBAL",1)
Global("DEREKROMANCE","GLOBAL",2)
GlobalLT("DerekRomanceTalk","LOCALS",14)
!GlobalTimerNotExpired("DerekLoveTalksTimer","LOCALS")
THEN 
   RESPONSE #20
  SetGlobal("DerekRomanceTalkInit","LOCALS",1)
  IncrementGlobal("DerekRomanceTalk","LOCALS",1)
  SetGlobalTimer("DerekLoveTalksTimer","LOCALS",EIGHT_HOURS)
  StartDialogueNoSet(Player1)
  SetGlobal("DerekRomanceTalkInit","LOCALS",0)
   RESPONSE #20
  SetGlobal("DerekRomanceTalkInit","LOCALS",1)
  IncrementGlobal("DerekRomanceTalk","LOCALS",1)
  SetGlobalTimer("DerekLoveTalksTimer","LOCALS",SIXTEEN_HOURS)
  StartDialogueNoSet(Player1)
  SetGlobal("DerekRomanceTalkInit","LOCALS",0)
 // Wait(2)
   RESPONSE #20
  SetGlobal("DerekRomanceTalkInit","LOCALS",1)
  IncrementGlobal("DerekRomanceTalk","LOCALS",1)
  SetGlobalTimer("DerekLoveTalksTimer","LOCALS",TEN_HOURS) 		
  StartDialogueNoSet(Player1)
  SetGlobal("DerekRomanceTalkInit","LOCALS",0)
 // Wait(2)
  RESPONSE #20
  SetGlobal("DerekRomanceTalkInit","LOCALS",1)
  IncrementGlobal("DerekRomanceTalk","LOCALS",1)
  SetGlobalTimer("DerekLoveTalksTimer","LOCALS",TWO_DAYS)		
  StartDialogueNoSet(Player1)
  SetGlobal("DerekRomanceTalkInit","LOCALS",0)
 // Wait(2)
  RESPONSE #20
  SetGlobal("DerekRomanceTalkInit","LOCALS",1)
  IncrementGlobal("DerekRomanceTalk","LOCALS",1)
  SetGlobalTimer("DerekLoveTalksTimer","LOCALS",ONE_DAY)			
  StartDialogueNoSet(Player1)
  SetGlobal("DerekRomanceTalkInit","LOCALS",0)
 // Wait(2)
END



IF 
   !Dead("c6bodhi")
   Global("BodhiControlsVampires","GLOBAL",1)
   Global("BodhiHatesPlayer","GLOBAL",1)
   Global("BodhiHatesPlayerInit","LOCALS",0)
THEN 
   RESPONSE #100
   SetGlobal("BodhiHatesPlayerInit","LOCALS",1)
   LeaveParty()
   Enemy()
   DisplayStringHead(Myself,~Bodhi calls me!~)
END   

IF 
   Dead("c6bodhi")
   Global("BodhiControlsVampires","GLOBAL",1)
   Global("BodhiHatesPlayer","GLOBAL",1)
   Global("BodhiHatesPlayerInit","LOCALS",1)
THEN 
   RESPONSE #100
   	ChangeEnemyAlly(Myself,NEUTRAL)
	ClearActions(Myself)
	SetGlobal("BodhiHatesPlayerInit","LOCALS",2)
END   

IF 
StateCheck(Myself,STATE_PANIC)
   InParty("c6bodhi")
   !Dead("c6bodhi")
   Global("BodhiControlsVampires","GLOBAL",1)
THEN 
   RESPONSE #100
		ForceSpell(Myself,CLERIC_REMOVE_FEAR)
END   


IF

	See(Player1)
		!InParty(Myself)
	AreaCheck("BD7410")
	Global("FirstTalk","LOCALS",0)
THEN
	RESPONSE #100

			SetGlobal("FirstTalk","LOCALS",1)
		StartDialogueNoSet(Player1)

END

IF
	InParty(Myself)
	AreaCheck("BD7400")
	Global("MotherTalk","LOCALS",0)
THEN
	RESPONSE #100
			SetGlobal("MotherTalk","LOCALS",1)

		StartDialogueNoSet(Player1)

END

IF
	!InParty(Myself)
	See(Player1)
	Global("DerekResurrected","GLOBAL",1)
THEN
	RESPONSE #100
 
		StartDialogueNoSet(Player1)
		SetGlobal("DerekResurrected","GLOBAL",2)
END


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

IF
!InParty(Myself)
	!HasItemEquiped("ohhcloak",Myself) // Cloak of Dragomir
	!HasItemEquiped("ohhkork",Myself) // Korkorran
	TimeGT(5)
	TimeLT(DUSK_END)
	AreaType(OUTDOOR)
THEN
	RESPONSE #100
		//DropInventory()
		Kill(Myself)
			DestroySelf()
		CreateCreature("GASFORM4",[-1.-1],S)
		ActionOverride("GASFORM4",EscapeArea())
END




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

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

