IF
    AreaCheck("AR5003")
    InParty(Myself)
    Global("RukVampireBreakAndFight","GLOBAL",1)
THEN
    RESPONSE #100
        SetGlobal("RukVampireBreakAndFight","GLOBAL",2)
        StartCutSceneMode()
        StartCutScene("rukvbaf1")
END

IF
    Global("RukrakiaSummoned","GLOBAL",1)
    Global("RukTalkToPlayer1","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("RukTalkToPlayer1","LOCALS",1)
        StartDialogueNoSet([PC])
END

IF
    See(Player1)
    InParty(Myself)
    AreaCheck("AR3016")
    Global("Rukrakia_GORCHR_TALK","GLOBAL",1)
THEN
    RESPONSE #100
        StartDialogNoSet(Player1)
END

IF
    Allegiance(Myself,ENEMY)
    !InParty(Myself)
THEN
    RESPONSE #100
        SetGlobal("RukrakiaRomanceActive","GLOBAL",1)
        DisplayStringHead(Myself,@100)
        EscapeArea()
        Continue()
END

IF
    Allegiance(Myself,NEUTRAL)
    AttackedBy([GOODCUTOFF],DEFAULT)
THEN
    RESPONSE #100
        SetGlobal("RukrakiaRomanceActive","GLOBAL",1)
        DisplayStringHead(Myself,@100)
        EscapeArea()
        Continue()
END

IF
    Global("RumasterDeadActive","GLOBAL",1)
    Global("ExpLoveTalk","LOCALS",8)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        RealSetGlobalTimer("RukrakiaRomance","GLOBAL",2400)
END

IF
	InParty(Myself)
	Global("RukrakiaRomanceActive","GLOBAL",5)
	OR(2)
		Global("AerieRomanceActive","GLOBAL",1)
		Global("AerieRomanceActive","GLOBAL",2)
THEN
	RESPONSE #100
		SetGlobal("AerieRomanceActive","GLOBAL",3)
END

IF
	InParty(Myself)
	Global("RukrakiaRomanceActive","GLOBAL",5)
	OR(2)
		Global("JaheiraRomanceActive","GLOBAL",1)
		Global("JaheiraRomanceActive","GLOBAL",2)
THEN
	RESPONSE #100
		SetGlobal("JaheiraRomanceActive","GLOBAL",3)
END

IF
	InParty(Myself)
	Global("RukrakiaRomanceActive","GLOBAL",5)
	OR(2)
		Global("ViconiaRomanceActive","GLOBAL",1)
		Global("ViconiaRomanceActive","GLOBAL",2)
THEN
	RESPONSE #100
		SetGlobal("ViconiaRomanceActive","GLOBAL",3)
END

IF
    Global("RukrakiaRomanceActive","GLOBAL",5)
    Global("ExpLoveTalk","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("ExpLoveTalk","LOCALS",1)
        RealSetGlobalTimer("RukrakiaRomance","GLOBAL",2400)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    !AreaType(DUNGEON)
    Detect(Protagonist)
    CombatCounter(0)
    Global("ExpLoveTalk","LOCALS",7)
    !See([ENEMY])
    !Range([NEUTRAL],10)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        ClearAllActions()
        StartCutSceneMode()
        StartCutScene("rumascom")
END

IF
    InParty(Myself)
    Global("RukrakiaRomanceActive","GLOBAL",5)
    Detect(Protagonist)
    OR(2)
      TimeGT(20)
      TimeLT(4)
    CombatCounter(0)
    !AreaType(DUNGEON)
    Global("ExpLoveTalk","LOCALS",3)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        PlaySong(0)
        Interact(Protagonist)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    PartyRested()
    Detect(Protagonist)
    CombatCounter(0)
    Global("ExpLoveTalk","LOCALS",5)
THEN
    RESPONSE #100
        RealSetGlobalTimer("RukrakiaRomance","GLOBAL",1)
        Continue()
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Detect(Protagonist)
    Global("ExpLoveTalk","LOCALS",5)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        PlaySong(0)
        Interact(Protagonist)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    PartyRested()
    Detect(Protagonist)
    CombatCounter(0)
    OR(7)
        Global("ExpLoveTalk","LOCALS",1)
        Global("ExpLoveTalk","LOCALS",3)
        Global("ExpLoveTalk","LOCALS",7)
        Global("ExpLoveTalk","LOCALS",9)
        Global("ExpLoveTalk","LOCALS",11)
        Global("ExpLoveTalk","LOCALS",13)
        Global("ExpLoveTalk","LOCALS",15)
THEN
    RESPONSE #100
        RealSetGlobalTimer("RukrakiaRomance","GLOBAL",10)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    !AreaType(DUNGEON)
    Detect(Protagonist)
    CombatCounter(0)
    Global("ExpLoveTalk","LOCALS",1)
    !See([ENEMY])
    !Range([NEUTRAL],6)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        PlaySong(0)
        Interact(Protagonist)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    !AreaType(DUNGEON)
    Detect(Protagonist)
    CombatCounter(0)
    OR(4)
        Global("ExpLoveTalk","LOCALS",9)
        Global("ExpLoveTalk","LOCALS",11)
        Global("ExpLoveTalk","LOCALS",13)
        Global("ExpLoveTalk","LOCALS",15)
    !See([ENEMY])
    !Range([NEUTRAL],6)
    Global("RumasterDeadActive","GLOBAL",1)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        PlaySong(0)
        Interact(Protagonist)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    Global("RukrakiaRomanceActive","GLOBAL",5)
    Detect(Protagonist)
    CombatCounter(0)
    Global("ExpLoveTalk","LOCALS",9)
    !See([ENEMY])
    !Range([NEUTRAL],6)
    Global("RumasterDeadActive","GLOBAL",1)
    LevelGT(Myself, 29)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        Interact(Protagonist)
END

IF
    InParty(Myself)
    RealGlobalTimerExpired("RukrakiaRomance","GLOBAL")
    OR(5)
        Global("ExpLoveTalk","LOCALS",2)
        Global("ExpLoveTalk","LOCALS",6)
        Global("ExpLoveTalk","LOCALS",10)
        Global("ExpLoveTalk","LOCALS",12)
        Global("ExpLoveTalk","LOCALS",14)
THEN
    RESPONSE #100
        IncrementGlobal("ExpLoveTalk","LOCALS",1)
        RealSetGlobalTimer("RukrakiaRomance","GLOBAL",2400)
END

IF
    InParty(Myself)
    GlobalGT("RukrakiaRomanceActive","GLOBAL",2)
    OR(8)
      SpellCastOnMe(Player1,CLERIC_RESTORATION)
      SpellCastOnMe(Player1,CLERIC_LESSER_RESTORATION)
      SpellCastOnMe(Player1,CLERIC_CURE_LIGHT_WOUNDS)
      SpellCastOnMe(Player1,CLERIC_CURE_MEDIUM_WOUNDS)
      SpellCastOnMe(Player1,CLERIC_CURE_DISEASE)
      SpellCastOnMe(Player1,CLERIC_CURE_SERIOUS_WOUNDS)
      SpellCastOnMe(Player1,CLERIC_CURE_CRITICAL_WOUNDS)
      SpellCastOnMe(Player1,CLERIC_HEAL)
    !GlobalTimerNotExpired("ThankYou","LOCALS")
THEN
    RESPONSE #100
        SetGlobalTimer("ThankYou","LOCALS",30)
        DisplayStringHead(Myself,@245)
END

IF
        InParty(Myself)
	!Range(NearestEnemyOf(Myself),8)
        See(NearestEnemyOf(Myself))
        Global("RukrakiaTELEPORT","LOCALS",0)
THEN
	RESPONSE #100
		ReallyForceSpell(NearestEnemyOf(Myself),PHASE_SPIDER_TELEPORT)
                SmallWait(30)
END

IF
        InParty(Myself)
        Range(NearestEnemyOf(Myself),8)
        See(NearestEnemyOf(Myself))
        Global("RukrakiaSCRAttack","LOCALS",0)
THEN
	RESPONSE #100
		AttackReevaluate(NearestEnemyOf(Myself),30)
END
