BEGIN ~CUCHOINJ~

IF ~~ THEN BEGIN 0
  SAY @0
  IF ~~ THEN DO ~LeaveParty()
Enemy()
~ EXIT
END

IF ~Global("CuChoinneachLeaves","GLOBAL",0)
~ THEN BEGIN 1
  SAY @1
  IF ~~ THEN DO ~LeaveParty()
SetDialog("CuChoinP")
~ EXIT
END

IF ~GlobalTimerExpired("CuChoin","GLOBAL")
!Dead("LordVamp")
Global("VampSearch","GLOBAL",0)
~ THEN BEGIN 2
  SAY @2
  IF ~~ THEN DO ~SetGlobalTimer("Cu1st","GLOBAL",TWO_DAYS)
~ EXIT
END

IF ~GlobalTimerExpired("Cu1st","GLOBAL")
!Dead("LordVamp")
Global("VampSearch","GLOBAL",0)
~ THEN BEGIN 3
  SAY @3
  IF ~~ THEN DO ~SetGlobalTimer("Cu2nd","GLOBAL",ONE_DAY)
~ EXIT
END

IF ~GlobalTimerExpired("Cu2nd","GLOBAL")
!Dead("LordVamp")
Global("VampSearch","GLOBAL",0)
~ THEN BEGIN 4
  SAY @4
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF ~Global("CuChoinneachLeaves","GLOBAL",1)
!HasItem("DSMISC06",Myself)
NumInPartyGT(4)
~ THEN BEGIN 5
  SAY @5
  IF ~~ THEN DO ~LeaveParty()
SetGlobal("CuChoinneachLeaves","GLOBAL",2)
GiveItemCreate("DSSCRL02",LastTalkedToBy,0,0,0)
ActionOverride("BUBBA",ChangeEnemyAlly("BUBBA",NEUTRAL))
ActionOverride("BUBBA",EscapeArea())
EscapeArea()
~ EXIT
END

IF ~Global("CuChoinneachLeaves","GLOBAL",1)
HasItem("DSMISC06",Myself)
NumInPartyGT(4)
~ THEN BEGIN 6
  SAY @5
  IF ~~ THEN DO ~LeaveParty()
SetGlobal("CuChoinneachLeaves","GLOBAL",2)
GiveItemCreate("DSSCRL02",LastTalkedToBy,0,0,0)
GiveItem("DSMISC06",LastTalkedToBy)
ActionOverride("BUBBA",ChangeEnemyAlly("BUBBA",NEUTRAL))
ActionOverride("BUBBA",EscapeArea())
EscapeArea()
~ EXIT
END

IF ~Global("CuChoinneachLeaves","GLOBAL",1)
!HasItem("DSMISC06",Myself)
NumInPartyLT(4)
~ THEN BEGIN 7
  SAY @5
  IF ~~ THEN DO ~LeaveParty()
SetGlobal("CuChoinneachLeaves","GLOBAL",2)
GiveItemCreate("DSSCRL04",LastTalkedToBy,0,0,0)
ActionOverride("BUBBA",ChangeEnemyAlly("BUBBA",NEUTRAL))
ActionOverride("BUBBA",EscapeArea())
EscapeArea()
~ EXIT
END

IF ~Global("CuChoinneachLeaves","GLOBAL",1)
HasItem("DSMISC06",Myself)
NumInPartyLT(4)
~ THEN BEGIN 8
  SAY @5
  IF ~~ THEN DO ~LeaveParty()
SetGlobal("CuChoinneachLeaves","GLOBAL",2)
GiveItemCreate("DSSCRL04",LastTalkedToBy,0,0,0)
GiveItem("DSMISC06",LastTalkedToBy)
ActionOverride("BUBBA",ChangeEnemyAlly("BUBBA",NEUTRAL))
ActionOverride("BUBBA",EscapeArea())
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 9
  SAY @6
  IF ~~ THEN EXTERN ~VAMPLORD~ 1
END
