// NPCs should leave forever when kicked out if their happiness is fairly low
// This replaces all checks for Happy < (-290) to Happy < 0
REPLACE_TRIGGER_TEXT _alorap ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _branwp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _ajantp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _yeslip ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _safanp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _kivanp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _imoenp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _tiaxp  ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _quaylp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _viconp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _garrip ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _kagaip ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _edwinp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _xanp   ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _faldop ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _coranp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _shartp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _khalip ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _jaheip ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _minscp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _dynahp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _eldotp ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _Skiep  ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _xzarp  ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~
REPLACE_TRIGGER_TEXT _Montap ~HappinessLT(Myself,-290)~ ~HappinessLT(Myself,0)~

// END MOVIE FIX - 1/2
REPLACE_ACTION_TEXT ~_NARRAT2~
~StartCutSceneMode() AddexperienceParty(15000) ActionOverride(Player1,Kill("sarevok"))~
~StartCutSceneMode() AddexperienceParty(15000) ActionOverride(Player1,Kill("sarevok")) EndCutSceneMode()~

ADD_TRANS_ACTION ~_NARRAT2~ BEGIN 2 END BEGIN 2 END ~EndCutSceneMode()~

EXTEND_BOTTOM ~_Narrat2~ 2
IF ~~ THEN DO ~StartCutSceneMode()
AddexperienceParty(15000)
ActionOverride(Player1,Kill("sarevok"))
EndCutSceneMode()~ EXIT
END

EXTEND_TOP ~_Narrat2~ 2
IF ~~ THEN DO ~StartCutSceneMode()
AddexperienceParty(15000)
ActionOverride(Player1,Kill("sarevok"))
EndCutSceneMode()~ EXIT
END

// QUAYLE DIALOG
REPLACE _QuaylP
IF ~Global("KickedOut","LOCALS",0)~ 4 SAY ~Please don't leave me out here! Do you hear buzzards? I hear buzzards. ~
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",1)~ EXIT
END
END

// IMPORT ITEMS FIX - dialogue
REPLACE_TRIGGER_TEXT _DEGROD  ~"_HELM07"~ ~"HELM07"~
REPLACE_ACTION_TEXT  _DEGROD  ~"_HELM07"~ ~"HELM07"~
REPLACE_ACTION_TEXT  _KOVERA  ~"_RING25"~ ~"RING25"~
REPLACE_TRIGGER_TEXT _ULRAUN  ~"_RING25"~ ~"RING25"~
REPLACE_TRIGGER_TEXT _NOBL9   ~"_MISC47"~ ~"MISC47"~
REPLACE_ACTION_TEXT  _NOBL9   ~"_MISC47"~ ~"MISC47"~
REPLACE_TRIGGER_TEXT _MRSHADE ~"_MISC47"~ ~"MISC47"~
REPLACE_ACTION_TEXT  _MRSHADE ~"_MISC47"~ ~"MISC47"~

// BRUN DIALOG
REPLACE_SAY "_FARMBR" 9 @1403

// GUARD ATTACKING IN CLOAKWOOD
REPLACE_ACTION_TEXT ~_IRON10~ ~CreateCreature("IRONGU",\[140\.1555\])~ ~CreateCreature("IRONGU",[140.1555]) Enemy()~

// ULRAUNT DIALOG
REPLACE_SAY ~_ULRAUN~ 1 @1414

// _delthy fixes
REPLACE_TRIGGER_TEXT ~_delthy~ ~"GLOABL"~ ~"GLOBAL"~
REPLACE_ACTION_TEXT  ~_delthy~ ~"GLOABL"~ ~"GLOBAL"~

// KAGAIN DIALOG
BEGIN ~_KAGAIJ~

IF ~~ THEN BEGIN 0 // from:
  SAY @1404
  IF ~~ THEN REPLY @1405 JOURNAL @1406 GOTO 1
  IF ~~ THEN REPLY @1407 JOURNAL @1406 EXIT
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY @1408
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()~ EXIT
END

IF ~~ THEN BEGIN 2 // from:
  SAY @1409
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()~ EXIT
END

IF ~~ THEN BEGIN 3 // from:
  SAY @1410
  IF ~~ THEN DO ~LeaveParty()
SetDialogue("_KAGAIP")~ EXIT
END

IF ~GlobalTimerExpired("Kagain","GLOBAL")
Global("KagainCaravan","GLOBAL",0)~ THEN BEGIN 4 // from:
  SAY @1411
  IF ~~ THEN DO ~SetGlobalTimer("Kagain","GLOBAL",SEVEN_DAYS)
SetGlobal("KagainCaravan","GLOBAL",1)~ EXIT
END

IF ~GlobalTimerExpired("Kagain","GLOBAL")
Global("KagainCaravan","GLOBAL",1)~ THEN BEGIN 5 // from:
  SAY @1412
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()~ EXIT
END

IF ~Global("KagainCaravan","GLOBAL",2)~ THEN BEGIN 6 // from:
  SAY @1413
  IF ~~ THEN DO ~SetGlobal("KagainCaravan","GLOBAL",3)~ EXIT
END
