IF 
	Global("IsGlobal","LOCALS",0)
THEN 
  RESPONSE #100
  MakeGlobal()
 SetGlobal("IsGlobal","LOCALS",1) 
END


IF
	Global("VynonaSentBlood","GLOBAL",1)
	!GlobalTimerNotExpired("VynonaReturnsToSaradushTavern","GLOBAL")
	Global("VynonaReturnsBlood","GLOBAL",0)
THEN
	RESPONSE #100
		ActionOverride("vvvynona",MoveBetweenAreas("AR5501",[680.223],SE))	
SetGlobal("VynonaReturnsBlood","GLOBAL",1)		
END



IF
See(Player1)
Global("Player1CannibalVampireTalk","LOCALS",0)
Global("Player1CannibalVampire","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("Player1CannibalVampireTalk","LOCALS",1)
StartDialogueNoSet(Player1)
SetGlobal("Player1CannibalVampireTalk","LOCALS",2)
END

IF
See(Player1)
Global("Player1CannibalVampireTalk","LOCALS",2)
GlobalGT("Player1CannibalVampire","GLOBAL",1)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
SetGlobal("Player1CannibalVampireTalk","LOCALS",3)
END



IF
Race(Player1,VAMPIRE)
Global("VampireWorldRomances","GLOBAL",1)
Global("VynonaTeaches","LOCALS",3)	
GlobalGT("VynonaHappiness","LOCALS",500)
!Global("VynonaRomance","LOCALS",3)
Global("VynonaRomanceTalk","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("VynonaRomanceTalk","LOCALS",1)
SetGlobal("VynonaRomance","LOCALS",2)
SetGlobalTimer("VynonaLoveTalksTimer","LOCALS",EIGHT_HOURS)
END

IF
Race(Player1,VAMPIRE)
//Global("VynonaRomance","LOCALS",5)  //stub
Global("VampireWorldRomances","GLOBAL",1)
GlobalGT("VynonaHappiness","LOCALS",500)
InParty(Myself)
See(Player1)
!See([ENEMY])
!AreaType(OUTDOOR)
Global("VynonaRomance","LOCALS",2)
!Global("VynonaRomanceTalk","LOCALS",0)
!GlobalTimerNotExpired("VynonaLoveTalksTimer","LOCALS")
THEN 
   RESPONSE #20
  SetGlobal("VynonaRomanceTalkInit","LOCALS",1)
  StartDialogueNoSet(Player1)
  SetGlobalTimer("VynonaLoveTalksTimer","LOCALS",EIGHT_HOURS)
  SetGlobal("VynonaRomanceTalkInit","LOCALS",2)
  IncrementGlobal("VynonaRomanceTalk","LOCALS",1)
    Wait(2)
   RESPONSE #20
  SetGlobal("VynonaRomanceTalkInit","LOCALS",1)
  StartDialogueNoSet(Player1)
  SetGlobalTimer("VynonaLoveTalksTimer","LOCALS",SIXTEEN_HOURS)
  SetGlobal("VynonaRomanceTalkInit","LOCALS",2)
  IncrementGlobal("VynonaRomanceTalk","LOCALS",1)
  Wait(2)
  RESPONSE #25
  SetGlobal("VynonaRomanceTalkInit","LOCALS",1)
  StartDialogueNoSet(Player1)
  SetGlobalTimer("VynonaLoveTalksTimer","LOCALS",TWO_DAYS)		
  SetGlobal("VynonaRomanceTalkInit","LOCALS",2)
  IncrementGlobal("VynonaRomanceTalk","LOCALS",1)
  Wait(2)
  RESPONSE #25
  SetGlobal("VynonaRomanceTalkInit","LOCALS",1)
  StartDialogueNoSet(Player1)
  SetGlobalTimer("VynonaLoveTalksTimer","LOCALS",ONE_DAY)			
  SetGlobal("VynonaRomanceTalkInit","LOCALS",2)
  IncrementGlobal("VynonaRomanceTalk","LOCALS",1)
  Wait(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
	AreaCheck("BG0123")
	Global("NamiMeeting","LOCALS",0)	
	Global("BG1UCityTalk","LOCALS",0)	
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("BG1UCityTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
END

IF
	Global("PhreyaJoinedPartyInCrypt","GLOBAL",1)	
	!AreaCheck("OH7300")
	InParty("OHHPHREY")
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("PhreyaTalk1","LOCALS",1)
		StartDialogueNoSet(Player1)
END

IF
	GlobalTimerExpired("VynonaReturnsToSaradushTavern","GLOBAL")	
	AreaCheck("AR5501")
	!InParty(Myself)
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("PhreyaTalk3","LOCALS",1)
		StartDialogueNoSet(Player1)
END


IF
	PartyHasItem("VVHSCROL")	
	InParty("OHHPHREY")
	AreaType("OUTDOOR")
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("PhreyaTalk2","LOCALS",1)
		StartDialogueNoSet(Player1)
END

IF
	AreaCheck("BD7000")
	Global("SODTsolakTalk","LOCALS",0)	
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("SODTsolakTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
END

IF
	AreaCheck("BG0123")
	Global("NamiMeeting","LOCALS",0)	
	See(Player1)
    See("vvnami")
THEN
	RESPONSE #100
		StartDialogueNoSet(Player1)
END


IF
	AreaCheck("BG0123")
	Global("NamiMeeting","LOCALS",1)	
  InParty("vvnami")
  InParty(Myself)
THEN
	RESPONSE #100

	Wait(10)
		StartDialogueNoSet(Player1)
				SetGlobal("NamiMeeting","LOCALS",2)
END

IF
	InParty(Myself)
	Global("BG1MissionBriefing","LOCALS",0)	
	GlobalGT("CHAPTER","GLOBAL",6)
	See(Player1)
THEN
	RESPONSE #100
	SetGlobal("BG1MissionBriefing","LOCALS",1)	
		StartDialogueNoSet(Player1)
END

IF
	InParty(Myself)
	Global("VynonaDialogRestored","LOCALS",0)
THEN
	RESPONSE #100
		SetGlobal("VynonaDialogRestored","LOCALS",1)
		SetDialog("VVVYNONA")
		Continue()
END








IF 
  AreaCheck("AR0808")
  !InParty(Myself)
  Global("BodhiStronghold","GLOBAL",2)
  Global("BodhiStrongholdPledged","LOCALS",1)
	!GlobalTimerNotExpired("BD_Move","LOCALS")
	!Allegiance(Myself,ENEMY)
THEN
	RESPONSE #40
		SetGlobalTimer("BD_Move","LOCALS",ONE_ROUND)
		RandomWalk()
	RESPONSE #40
		SetGlobalTimer("BD_Move","LOCALS",ONE_ROUND)
		RandomTurn()
	RESPONSE #20
		SetGlobalTimer("BD_Move","LOCALS",ONE_ROUND)
		NoAction()
END

IF 
  Global("BG1MissionBriefing","LOCALS",0)
  InParty(Myself)
  See(Player1)
  GlobalGT("CHAPTER","GLOBAL",6)
THEN 
  RESPONSE #100
  StartDialogueNoSet(Player1)
  SetGlobal("BG1MissionBriefing","LOCALS",1)
END  
  

IF
	NumberOfTimesTalkedTo(0)
	Detect([PC])
THEN
	RESPONSE #100
		StartDialogueNoSet(LastSeenBy(Myself))
END

IF
InParty(Myself)
!See([ENEMY])
	See(Player1)
	!Global("VynonaTeaches","LOCALS",3)	
	GlobalLT("VynonaTalk","LOCALS",9)
	GlobalTimerExpired("VynonaSpeaksTimer","GLOBAL")
THEN
	RESPONSE #20
		SetGlobal("StartTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
		SetGlobalTimer("VynonaSpeaksTimer","GLOBAL",EIGHT_HOURS)
		SetGlobal("StartTalk","LOCALS",0)
	RESPONSE #20
		SetGlobal("StartTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
		SetGlobalTimer("VynonaSpeaksTimer","GLOBAL",SIXTEEN_HOURS)
		SetGlobal("StartTalk","LOCALS",0)
	RESPONSE #20
		SetGlobal("StartTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
		SetGlobalTimer("VynonaSpeaksTimer","GLOBAL",ONE_DAY)
		SetGlobal("StartTalk","LOCALS",0)
	RESPONSE #20
		SetGlobal("StartTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
		SetGlobalTimer("VynonaSpeaksTimer","GLOBAL",TEN_HOURS)
		SetGlobal("StartTalk","LOCALS",0)
	RESPONSE #20
		SetGlobal("StartTalk","LOCALS",1)
		StartDialogueNoSet(Player1)
		SetGlobalTimer("VynonaSpeaksTimer","GLOBAL",TWO_DAYS)
		SetGlobal("StartTalk","LOCALS",0)
END

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

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

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

