ACTION_IF !FILE_EXISTS_IN_GAME j#klsyj.dlg AND
          !FILE_EXISTS_IN_GAME fwketo.dlg
BEGIN
  COMPILE EVALUATE_BUFFER ~questpack/coronet/dialog.d~ USING
          ~%tra_path%/english/coronet.tra~
          ~%tra_path%/%LANGUAGE%/coronet.tra~
END

/*
 * Need to be compiled together due to label references
 */
ACTION_IF FILE_EXISTS_IN_GAME j#klsyj.dlg AND
          FILE_EXISTS_IN_GAME fwketo.dlg
BEGIN
  COMPILE EVALUATE_BUFFER ~questpack/coronet/dialog.d~
          ~questpack/coronet/kelseydialog.d~
          ~questpack/coronet/ketodialog.d~ USING
          ~%tra_path%/english/coronet.tra~
          ~%tra_path%/%LANGUAGE%/coronet.tra~
END

ACTION_IF FILE_EXISTS_IN_GAME j#klsyj.dlg AND
          !FILE_EXISTS_IN_GAME fwketo.dlg
BEGIN
  COMPILE EVALUATE_BUFFER ~questpack/coronet/dialog.d~
          ~questpack/coronet/kelseydialog.d~ USING
          ~%tra_path%/english/coronet.tra~
          ~%tra_path%/%LANGUAGE%/coronet.tra~
END

ACTION_IF !FILE_EXISTS_IN_GAME j#klsyj.dlg AND
          FILE_EXISTS_IN_GAME fwketo.dlg
BEGIN
  COMPILE EVALUATE_BUFFER ~questpack/coronet/dialog.d~
          ~questpack/coronet/ketodialog.d~ USING
          ~%tra_path%/english/coronet.tra~
          ~%tra_path%/%LANGUAGE%/coronet.tra~
END

ADD_JOURNAL @426 @427 @428 @429 @430 @431 @432 @433 @434 @435 @436 @437 @438 @439 @440 @441 @442 @443 @444 @445 USING
            ~%tra_path%/english/coronet.tra~
            ~%tra_path%/%LANGUAGE%/coronet.tra~

COPY ~questpack/coronet/spells/d0ssleep.spl~ ~override~

COPY ~questpack/coronet/spells/d0poori.spl~ ~override~
  LPF ADD_SPELL_EFFECT
    INT_VAR
      opcode = 143 // Create item in slot
      target = 2
      timing = 1
      parameter1 = 0 // SLOT_AMULET
    STR_VAR
      resource = minhp1
  END

COPY ~questpack/coronet/creatures/d0thug2.cre~ ~override~
  ADD_CRE_ITEM blun01 #0 #0 #0 none weapon1 //Do not equip

COPY ~questpack/coronet/creatures/d0thug.cre~ ~override~
     ~questpack/coronet/creatures/d0thug3.cre~ ~override~
     ~questpack/coronet/creatures/d0boy.cre~ ~override~
     ~questpack/coronet/creatures/d0girl.cre~ ~override~
     ~questpack/coronet/creatures/d0drunk.cre~ ~override~

COPY ~questpack/coronet/creatures/d0poor.cre~ ~override~
  SAY NAME1 @118
  SAY NAME2 @118

COPY ~questpack/coronet/creatures/d0lender.cre~ ~override~
  SAY NAME1 @114
  SAY NAME2 @114
  REPLACE_TEXTUALLY "runenemey" "" (8)

COPY ~questpack/coronet/creatures/d0lorick.cre~ ~override~
  SAY NAME1 @121
  SAY NAME2 @121

COPY ~questpack/coronet/creatures/d0debt1.cre~ ~override~
     ~questpack/coronet/creatures/d0debt2.cre~ ~override~
     ~questpack/coronet/creatures/d0debt3.cre~ ~override~
  SAY NAME1 @117
  SAY NAME2 @117

COPY ~questpack/coronet/creatures/d0thug4.cre~ ~override~
  SAY NAME1 @175
  SAY NAME2 @175

COMPILE EVALUATE_BUFFER ~questpack/coronet/scripts/d0beat.baf~
        ~questpack/coronet/scripts/d0beat2.baf~
        ~questpack/coronet/scripts/d0boy.baf~
        ~questpack/coronet/scripts/d0poor.baf~
        ~questpack/coronet/scripts/d0thug.baf~
        ~questpack/coronet/scripts/d0thug2.baf~
        ~questpack/coronet/scripts/d0thug3.baf~
        ~questpack/coronet/scripts/d0lender.baf~
        ~questpack/coronet/scripts/d0debt.baf~
        ~questpack/coronet/scripts/d0thug4.baf~

EXTEND_TOP ~ar0400.bcs~ ~questpack/coronet/scripts/ar0400.baf~ EVALUATE_BUFFER

EXTEND_TOP ~ar0406.bcs~ ~questpack/coronet/scripts/ar0406.baf~ EVALUATE_BUFFER

EXTEND_TOP ar0812.bcs ~questpack/coronet/scripts/ar0812.baf~ EVALUATE_BUFFER USING
                      ~%tra_path%/english/coronet.tra~
                      ~%tra_path%/%LANGUAGE%/coronet.tra~

EXTEND_BOTTOM ~ar1602.bcs~ ~questpack/coronet/scripts/ar1602.baf~ EVALUATE_BUFFER

EXTEND_BOTTOM ~player1d.bcs~ ~questpack/coronet/scripts/player1d.baf~ EVALUATE_BUFFER

EXTEND_TOP ~baldur.bcs~ ~questpack/coronet/scripts/et_spawn.baf~ EVALUATE_BUFFER

COPY_EXISTING ~ar0812.are~ ~override~
  WRITE_ASCII 0x94 "ar0812" #8

COPY_EXISTING ~ar1515.bcs~ ~override~
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~CreateCreature("ppimoen",\[937\.1229\],12)~
                      ~CreateCreature("ppimoen",[937.1229],12)
                       CreateCreature("d0lorick",[771.597],12)~
    REPLACE_TEXTUALLY ~ActionOverride("ppimoen",DestroySelf())~
                      ~ActionOverride("ppimoen",DestroySelf())
                       ActionOverride("d0lorick",DestroySelf())~
  END
BUT_ONLY

COPY_EXISTING ~cut41f.bcs~ ~override~
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~CreateCreature("ppdradee",\[742\.1323\],0)~
                      ~CreateCreature("ppdradee",[742.1323],0)
                       CreateCreature("d0lorick",[771.597],12)~
  END
BUT_ONLY

COPY_EXISTING ~mazzy.bcs~ ~override~
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~See("surly")~ ~See("surly") !Dead("surly")~
  END
BUT_ONLY

EXTEND_TOP ~mazzy.bcs~ ~questpack/coronet/scripts/et_mazzy.baf~ EVALUATE_BUFFER

// Surly returns
COPY_EXISTING ~thumb.cre~ ~override~
  WRITE_ASCII 0x280 "thumb" #32
BUT_ONLY

EXTEND_TOP ~ar0313.bcs~ ~questpack/coronet/scripts/ar0313.baf~ EVALUATE_BUFFER
