BACKUP ~questpack/backup~
AUTHOR ~SimDing0 (http://forums.pocketplane.net/index.php/board,21.0.html)~

VERSION ~v3.5~
README ~questpack/readme_%LANGUAGE%.html~ ~questpack/readme.html~

// SPECIFICS USED:
// 133
// 134
// 240
// 241
// 242
// 243

// SHOUTS USED:
// 254

ALLOW_MISSING ~jahei14.cre~
              ~FSMUMM.CRE~
              ~FSMUMM2.CRE~
              ~FSMUMM3.CRE~
              ~SPJA01.SPL~
              ~SPWISH10.SPL~
              ~BHAAL4A.SPL~
              ~SPPR999.SPL~
              ~SPPR729.SPL~
              ~SPPR504.SPL~
              ~SPPR712.SPL~
              ~melsum06.cre~
              ~melsum03.cre~
              ~gorwom05.cre~
              ~behhiv01.cre~
              ~TELWRAI.CRE~
              ~UMBHUL02.CRE~
              ~SEWSHA01.CRE~
              ~SEWSHA02.CRE~
              ~SEWSHA03.CRE~
              ~SLAYSH01.CRE~
              ~HGMAG01.CRE~
              ~HGMAG02.CRE~
              ~HGWAR02.CRE~
              ~chtaz01.CRE~
// ToB spells (Detectable Spells)
              ~BALSHLD.SPL~
              ~BHAAL1b.SPL~
              ~bhaal2a.spl~
              ~dgarchon.spl~
              ~dgfaith.spl~
              ~dgright.spl~
              ~melis02.spl~
              ~spcl900.spl~
              ~spcl901.spl~
              ~spcl902.spl~
              ~spcl903.spl~
              ~spcl905.spl~
              ~spcl906.spl~
              ~spcl909.spl~
              ~spcl910.spl~ ////
              ~spcl911.spl~   // All these are
              ~spcl912.spl~   // scriptable spells
              ~spcl923.spl~ ////
              ~spcl916.spl~
              ~spin571.spl~
              ~spinhum.spl~
              ~sppr725.spl~
              ~sppr730.spl~
              ~spwi921.spl~
              ~spwish07.spl~

//////////////////////////////////////////////////////////////////////

ALWAYS
  ACTION_IF GAME_IS ~eet~ BEGIN
    OUTER_SET bg2_chapter = 12
  END ELSE BEGIN
    OUTER_SET bg2_chapter = 0
  END
  OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
    OUTER_SET bg2_chapter = bg2_chapter + 1
    OUTER_SPRINT name_source ~bg2_chapter_%i%~
    OUTER_SET EVAL ~%name_source%~ = bg2_chapter
  END

  UNINSTALL setup-d0quest.tp2 0
  UNINSTALL setup-d0quest.tp2 1
  UNINSTALL setup-d0quest.tp2 2
  UNINSTALL setup-d0quest.tp2 3
  UNINSTALL setup-d0quest.tp2 4

  // UNINSTALL Setup-GbG.tp2 1

  INCLUDE ~questpack/tp2/lib.tpa~

  OUTER_SPRINT tra_path ~questpack/translations~

  /* QP has a few strings which differ between regular and EE BG2 */
  ACTION_IF ENGINE_IS ~bg2ee~ BEGIN
    LOAD_TRA ~%tra_path%/ee/english/d0quest.tra~
    ACTION_IF ~%LANGUAGE%~ STRING_COMPARE_CASE "english" AND
              FILE_EXISTS ~%tra_path%/ee/%LANGUAGE%/d0quest.tra~
    BEGIN
      LOAD_TRA ~%tra_path%/ee/%LANGUAGE%/d0quest.tra~
    END
  END

  ACTION_DEFINE_ARRAY fl#noconvert BEGIN setup setup-unix setup-osx setup-win32 END
  ACTION_DEFINE_ARRAY fl#reload BEGIN d0quest END

  LAF HANDLE_CHARSETS
    INT_VAR
      infer_charsets = 1
    STR_VAR
      tra_path = EVAL ~%MOD_FOLDER%/translations~
      noconvert_array = fl#noconvert
      reload_array = fl#reload
      default_language = english
  END

  // We only perform this patch once per install.
  ACTION_IF !FILE_EXISTS_IN_GAME fl#qp_standardpatch.mrk BEGIN
    INCLUDE ~questpack/tp2/standardpatch.tph~
    COPY_EXISTING sw1h01.itm "override/fl#qp_standardpatch.mrk"
  END
END

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

LANGUAGE ~English~
         ~english~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
LANGUAGE ~Spanish~
         ~spanish~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
         ~questpack/translations/spanish/d0quest.tra~
         ~questpack/translations/spanish/setup-%WEIDU_OS%.tra~
LANGUAGE ~German~
         ~german~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
         ~questpack/translations/german/d0quest.tra~
         ~questpack/translations/german/setup-%WEIDU_OS%.tra~
LANGUAGE ~French~
         ~french~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
         ~questpack/translations/french/d0quest.tra~
         ~questpack/translations/french/setup-%WEIDU_OS%.tra~
LANGUAGE ~Italian~
         ~italian~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
         ~questpack/translations/italian/d0quest.tra~
         ~questpack/translations/italian/setup-%WEIDU_OS%.tra~
LANGUAGE ~Russian~
         ~russian~
         ~questpack/translations/english/d0quest.tra~
         ~questpack/translations/english/setup.tra~
         ~questpack/translations/russian/d0quest.tra~
         ~questpack/translations/russian/setup-%WEIDU_OS%.tra~


//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////// COMPONENTS BEGIN HERE ////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
// AI IMPROVEMENTS
//////////////////////////////////////////////////////////////////////

BEGIN @14 // General AI Improvements
DESIGNATED 0
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/tactical/AI_core.tph~

//////////////////////////////////////////////////////////////////////
// CREATURE ENHANCEMENTS
//////////////////////////////////////////////////////////////////////

BEGIN @36 // All Creature & Area Improvements
DESIGNATED 1
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98
SUBCOMPONENT @34 // Creature & Area Improvements

INCLUDE ~questpack/tp2/tactical/tactical_boss.tph~
INCLUDE ~questpack/tp2/tactical/tactical_creature.tph~
INCLUDE ~questpack/tp2/tactical/tactical_area.tph~

BEGIN @35 // All Creature Improvements
DESIGNATED 2
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98
SUBCOMPONENT @34 // Creature & Area Improvements

INCLUDE ~questpack/tp2/tactical/tactical_boss.tph~
INCLUDE ~questpack/tp2/tactical/tactical_creature.tph~

BEGIN @32 // Boss Improvements Only
DESIGNATED 3
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98
SUBCOMPONENT @34 // Creature & Area Improvements

INCLUDE ~questpack/tp2/tactical/tactical_boss.tph~

//////////////////////////////////////////////////////////////////////
// MISCELLANEOUS ENHANCEMENTS
//////////////////////////////////////////////////////////////////////

BEGIN @39 // With Additional Random Encounters
SUBCOMPONENT @6 // Miscellaneous Enhancements
DESIGNATED 4
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL Setup-BonsKiss.tp2 0
UNINSTALL Setup-BonsSorry.tp2 0
UNINSTALL Setup-LMA.tp2 0

OUTER_SET fl#ADDITIONAL_RANDOM_ENCOUNTERS = 1

INCLUDE ~questpack/tp2/quest/miscellaneous.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/encounters/audio~
END

//////////////////////////////////////////////////////////////////////

BEGIN @40 // Without Additional Random Encounters
SUBCOMPONENT @6 // Miscellaneous Enhancements
DESIGNATED 401
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL Setup-BonsKiss.tp2 0
UNINSTALL Setup-BonsSorry.tp2 0
UNINSTALL Setup-LMA.tp2 0

OUTER_SET fl#ADDITIONAL_RANDOM_ENCOUNTERS = 0

INCLUDE ~questpack/tp2/quest/miscellaneous.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/encounters/audio~
END

//////////////////////////////////////////////////////////////////////
// SHADOW THIEVES
//////////////////////////////////////////////////////////////////////

BEGIN @1 // Additional Shadow Thieves Content
DESIGNATED 5
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL setup-ghreyim8.tp2 0

INCLUDE ~questpack/tp2/quest/thieves.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/thieves/audio~
END

//////////////////////////////////////////////////////////////////////
// HARPERS
//////////////////////////////////////////////////////////////////////

BEGIN @2 // Alternative Harper/Xzar Plot
DESIGNATED 6
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/harpers.tph~

//////////////////////////////////////////////////////////////////////
// FALLEN PALADINS
//////////////////////////////////////////////////////////////////////

BEGIN @3 // Extended Reynald Sequence
DESIGNATED 7
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/paladins.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/reynald/audio~
END

//////////////////////////////////////////////////////////////////////
// COPPER CORONET
//////////////////////////////////////////////////////////////////////

BEGIN @4 // Intrigue In The Copper Coronet
DESIGNATED 8
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/coronet.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/coronet/audio~
END

//////////////////////////////////////////////////////////////////////
// POTION QUEST
//////////////////////////////////////////////////////////////////////

BEGIN @8 // Rahul Kanakia's Potion Quest
DESIGNATED 9
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL ~setup-potionquest.tp2~ 0

INCLUDE ~questpack/tp2/quest/potion.tph~

//////////////////////////////////////////////////////////////////////
// HELL TRIALS
//////////////////////////////////////////////////////////////////////

BEGIN @10 // Revised Hell Trials
DESIGNATED 10
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL ~setup-hell.tp2~ 0

INCLUDE ~questpack/tp2/quest/helltest.tph~

//////////////////////////////////////////////////////////////////////
// IMPROVED OASIS
//////////////////////////////////////////////////////////////////////

BEGIN @11 // IO2 Dialogue & Combat Enhancement
DESIGNATED 11
REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee eet~ @100
SUBCOMPONENT @13 // Improved Oasis II

UNINSTALL ~setup-oasis.tp2~ 0
UNINSTALL ~setup-oasis.tp2~ 1

INCLUDE ~questpack/tp2/quest/oasis_dlg.tph~
INCLUDE ~questpack/tp2/quest/oasis_combat.tph~

BEGIN @12 // IO2 Dialogue Enhancement Only
DESIGNATED 12
REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee eet~ @100
SUBCOMPONENT @13 // Improved Oasis II

UNINSTALL ~setup-oasis.tp2~ 0
UNINSTALL ~setup-oasis.tp2~ 1

INCLUDE ~questpack/tp2/quest/oasis_dlg.tph~

//////////////////////////////////////////////////////////////////////
// SANIK
//////////////////////////////////////////////////////////////////////

BEGIN @17 // Saving Sanik In Brynnlaw
DESIGNATED 13
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/sanik.tph~

//////////////////////////////////////////////////////////////////////
// GALOOMP
//////////////////////////////////////////////////////////////////////

BEGIN @18 // Burglary Of The Bookkeeper
DESIGNATED 14
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL Setup-AndyrIM5.tp2 0

INCLUDE ~questpack/tp2/quest/galoomp.tph~

//////////////////////////////////////////////////////////////////////
// PHLUAFAE
//////////////////////////////////////////////////////////////////////

BEGIN @19 // New Fate For The Dryads' Acorns
DESIGNATED 15
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL Setup-BonsPromise.tp2 0

INCLUDE ~questpack/tp2/quest/phluafae.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/phluafae/audio~
END

//////////////////////////////////////////////////////////////////////
// BESAMEN
//////////////////////////////////////////////////////////////////////

BEGIN @20 // The Tragedy Of Besamen
DESIGNATED 16
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

UNINSTALL setup-icekiss.tp2 0

INCLUDE ~questpack/tp2/quest/besamen.tph~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/besamen/audio~
END

//////////////////////////////////////////////////////////////////////
// SLAVER STUFF
//////////////////////////////////////////////////////////////////////

BEGIN @21 // Further Slaver Involvement
DESIGNATED 17
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/slavers.tph~

//////////////////////////////////////////////////////////////////////
// SOLAMNIC KNIGHTS
//////////////////////////////////////////////////////////////////////

BEGIN @22 // Sending The Solamnic Knights Home
DESIGNATED 18
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/solamnic.tph~

//////////////////////////////////////////////////////////////////////
// NAZARIEL
//////////////////////////////////////////////////////////////////////

BEGIN @23 // Nazariel The Lich
DESIGNATED 19
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/nazariel.tph~

COPY ~questpack/lich/areas~ ~override~

LAF questpack_tilesets
  STR_VAR
    tiz_path = ~questpack/lich/tiz~
END

//////////////////////////////////////////////////////////////////////
// REWARD NEGOTIATION
//////////////////////////////////////////////////////////////////////

BEGIN @33 // Reward Negotiation
DESIGNATED 20
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/negotiate.tph~

//////////////////////////////////////////////////////////////////////
// WILBUR
//////////////////////////////////////////////////////////////////////

BEGIN @30 // Infernal Thievery
DESIGNATED 21
REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee eet~ @100

INCLUDE ~questpack/tp2/quest/wilbur.tph~

//////////////////////////////////////////////////////////////////////
// ORMAND
//////////////////////////////////////////////////////////////////////

/*
BEGIN @31 // Elven Court
DESIGNATED 22
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/ormand.tph~

COPY ~questpack/ormand/randenc/areas~ ~override~

LAF questpack_tilesets
  STR_VAR
    tiz_path = ~questpack/ormand/randenc/tiz~
END
*/

//////////////////////////////////////////////////////////////////////
// BLOOD WAR
//////////////////////////////////////////////////////////////////////

/*
BEGIN @38 // Quest Content & Fiend Revisions
DESIGNATED 23
REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee eet~ @100
SUBCOMPONENT @16 // Blood War On Carceri

INCLUDE ~questpack/tp2/quest/carceri_quest.tph~
INCLUDE ~questpack/tp2/quest/carceri_revisions.tph~

BEGIN @37 // Quest Content Only
DESIGNATED 24
REQUIRE_PREDICATE GAME_IS ~tob bgt bg2ee eet~ @100
SUBCOMPONENT @16 // Blood War On Carceri

INCLUDE ~questpack/tp2/quest/carceri_quest.tph~
*/

//////////////////////////////////////////////////////////////////////
// COUNCIL BUILDING
//////////////////////////////////////////////////////////////////////

/*
BEGIN @15 // Enhanced Council Building
DESIGNATED 25
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/council.tph~
*/

//////////////////////////////////////////////////////////////////////
// FALDORN
//////////////////////////////////////////////////////////////////////

/*
BEGIN @9 // Expanded Druid Stronghold
DESIGNATED 26
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/faldorn.tph~
*/

//////////////////////////////////////////////////////////////////////
// QUALLO
//////////////////////////////////////////////////////////////////////

/*
BEGIN @24 // Quallo's Friendship
DESIGNATED 27
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/quallo.tph~
*/

//////////////////////////////////////////////////////////////////////
// OGHMA
//////////////////////////////////////////////////////////////////////

/*
BEGIN @25 // Word And Wisdom
DESIGNATED 28
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

INCLUDE ~questpack/tp2/quest/oghma.tph~
*/

//////////////////////////////////////////////////////////////////////
// UNDERDARK
//////////////////////////////////////////////////////////////////////

/*
BEGIN @26 // Underdark Shortcut
DESIGNATED 29
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

COMPILE EVALUATE_BUFFER ~questpack/underdark/dialog.d~
*/

//////////////////////////////////////////////////////////////////////
// SMUGGLERS
//////////////////////////////////////////////////////////////////////

/*
BEGIN @5 // Escaping Brynnlaw
DESIGNATED 30
REQUIRE_PREDICATE GAME_IS ~soa tob bgt bg2ee eet~ @98

COMPILE EVALUATE_BUFFER ~smugglers/dialog.d~

LAF questpack_audio
  STR_VAR
    audio_path = ~questpack/smugglers/audio~
END
*/
