BACKUP ~UniversalArcherKit/backup~
AUTHOR ~ced2168@columbia.edu~

VERSION ~1.0~

//MODDER

AUTO_TRA ~UniversalArcherKit/tra/%s~

/*
 * This mod does not use any chapter checks
 *
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
END
*/

LANGUAGE   ~English~
           ~English~
           ~UniversalArcherKit/tra/English/UniversalArcherKit.tra~

BEGIN "Universal Archer Kit" //
INCLUDE "UniversalArcherKit/lib/fl#add_kit_ee.tpa"


ADD_KIT ~USAF00~
	~USAF00 1 1 1 1 1 1 1 1~
      ~USAF00 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 1 1 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
	~USAF00 9 0 0 0 0 0~
	~USAF00 0 0 0 0 0 0~
	~USAF00 15 0 0 0 0 0~
        ~USAF00 15 0 0 0 0 0~
	~USAF00 1 1 1 1 1 1 1 1 1~
	~USAF00 0 1 1 1 1 0~
	~UniversalArcherKit/CLABUSAF.2da~
	~K_F_H	K_F_D   K_F_G   K_F_E   K_F_HE   K_F_HL   K_F_HO~
	~0x00008000 2~
	~FI0~
	~LEAT14 * HELM07 BAG24 RING06 RING31 CLCK02 BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 HAMM07 SW1H39 STAF08~

	SAY ~archer~
	SAY ~Archer~
	SAY ~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> proficiency with melee weapons and armor.

Advantages:
- +1 to hit and damage rolls with any missile weapon every 3 levels.
- May achieve Grand Mastery (5 slots) in longbows, shortbows, crossbows, darts, and slings.
- May use the Called Shot ability once per day. Gains one use at level 4 and an additional use every 4 levels thereafter.

CALLED SHOT: All successful ranged attacks within the next 10 seconds have the following cumulative effects besides normal damage, according to the level of the Archer:
 4th level: -1 penalty to target's THAC0.
 8th level: -1 penalty to target's Saving Throws vs. Spell.
 12th level: -1 penalty to the target's Strength score.
 16th level: +2 bonus to damage roll.

Disadvantages:
– May only wear leather, studded leather, and hide armor.
– May only become Proficient (one slot) with melee weapons.
~

LAF fl#add_kit_ee
	INT_VAR
		biography = RESOLVE_STR_REF (~~)
		briefdesc = RESOLVE_STR_REF (~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> proficiency with melee weapons and armor.~)
	STR_VAR
		kit_name = ~USAF00~
		clswpbon = ~1 0 2~
		numwslot = ~4~
		clascolr = ~30 91 93 23 93~
		hpclass = ~HPWAR~
		clsrcreq = ~1 1 1 1 1 1 1~
		clasthac = ~0~
END



ADD_KIT ~USAP00~
	~USAP00 1 1 1 1 1 1 1 1~
      ~USAP00 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 1 1 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
	~USAP00 12 0 0 0 12 17~
	~USAP00 0 0 0 0 0 0~
	~USAP00 0 0 0 0 0 0~
        ~USAP00 0 0 0 0 0 0~
	~USAP00 1 0 0 0 0 0 0 0 0~
	~USAP00 0 0 0 0 0 0~
	~UniversalArcherKit/CLABUSAP.2da~
	~K_P_H	K_P_D   K_P_G   K_P_E   K_P_HE   K_P_HL   K_P_HO~
	~0x00008000 6~
	~PA0~
	~LEAT14 * HELM07 BAG24 RING06 RING31 CLCK02 BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 HAMM07 SW1H39 STAF08~

	SAY ~archer~
	SAY ~Archer~
	SAY ~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> proficiency with melee weapons and armor.

Advantages:
- +1 to hit and damage rolls with any missile weapon every 3 levels.
- May achieve Grand Mastery (5 slots) in longbows, shortbows, crossbows, darts, and slings.
- May use the Called Shot ability once per day. Gains one use at level 4 and an additional use every 4 levels thereafter.

CALLED SHOT: All successful ranged attacks within the next 10 seconds have the following cumulative effects besides normal damage, according to the level of the Archer:
 4th level: -1 penalty to target's THAC0.
 8th level: -1 penalty to target's Saving Throws vs. Spell.
 12th level: -1 penalty to the target's Strength score.
 16th level: +2 bonus to damage roll.

Disadvantages:
– May only wear leather, studded leather, and hide armor.
– May only become Proficient (one slot) with melee weapons.
~

LAF fl#add_kit_ee
	INT_VAR
		biography = RESOLVE_STR_REF (~~)
		briefdesc = RESOLVE_STR_REF (~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> proficiency with melee weapons and armor.~)
	STR_VAR
		kit_name = ~USAP00~
		clswpbon = ~1 0 2~
		numwslot = ~3~
		clascolr = ~25 28 57 2 24~
		hpclass = ~HPWAR~
		clsrcreq = ~1 1 1 1 1 1 1~
		clasthac = ~0~
END

ADD_KIT ~USAT00~
	~USAT00 1 1 1 1 1 1 1 1~
      ~USAT00 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 5 0 5 5 5 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
	~USAT00 0 9 0 0 0 0~
	~USAT00 0 0 0 0 0 0~
	~USAT00 0 15 0 0 0 0~
        ~USAT00 0 15 0 0 0 0~
	~USAT00 1 1 1 1 1 1 1 1 1~
	~USAT00 1 1 1 0 0 0~
	~UniversalArcherKit/CLABUSAT.2da~
	~K_T_H	K_T_D   K_T_G   K_T_E   K_T_HE   K_T_HL   K_T_HO~
	~0x08000000 4~
	~TH0~
	~LEAT14 * * BAG28 RING06 RING05 * BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN10,2 POTN14,5 DAGG12 SW1H28 STAF08~

	SAY ~archer~
	SAY ~Archer~
	SAY ~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> conventional skills as a rogue.

Advantages:
- +1 to hit and damage rolls with any missile weapon every 3 levels.
- May achieve Grand Mastery (5 slots) in shortbows, crossbows, darts, and slings.
- May use the Called Shot ability once per day. Gains one use at level 4 and an additional use every 4 levels thereafter.

CALLED SHOT: All successful ranged attacks within the next 10 seconds have the following cumulative effects besides normal damage, according to the level of the Archer:
 4th level: -1 penalty to target's THAC0.
 8th level: -1 penalty to target's Saving Throws vs. Spell.
 12th level: -1 penalty to the target's Strength score.
 16th level: +2 bonus to damage roll.

Disadvantages:
– May not backstab.
– Only gains 15 skill points per level (30 at level 1).
~

LAF fl#add_kit_ee
	INT_VAR
		biography = RESOLVE_STR_REF (~~)
		briefdesc = RESOLVE_STR_REF (~ARCHER: The Archer is the epitome of skill with the bow—the ultimate marks<PRO_MANWOMAN>, able to make almost any shot, no matter how difficult. To become so skilled with the bow, the Archer has had to sacrifice some of <PRO_HISHER> proficiency with melee weapons and armor.~)
	STR_VAR
		kit_name = ~USAT00~
		backstab = ~1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1~
		clswpbon = ~0 0 3~
		numwslot = ~2~
		thiefskl = ~30 15~
		traplimt = ~7~
		clascolr = ~24 99 169 2 93~
		clasiskl = ~10 10 10 10 10 10 10~
		thiefscl = ~100 100 100 100 100 100 100 0~
		hpclass = ~HPROG~
		clsrcreq = ~1 1 1 1 1 1 1~
		clasthac = ~0~
		sneakatt = ~1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1~
		crippstr = ~0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
END


COPY_EXISTING ~weapprof.2da~ ~override~
  COUNT_2DA_COLS cols
  SET kit_cols = (cols - 1) // because the row with the class/kit names has one fewer column
  FOR (col = 1; col < kit_cols; ++col) BEGIN
    READ_2DA_ENTRY 0 col kit_cols ~weapprof_kit~
    PATCH_IF (~%weapprof_kit%~ STRING_EQUAL_CASE ~feralan~) BEGIN
      SET archer_col = (%col% + 1) // because rows to be patched have one more column than the class/kit row
      SET_2DA_ENTRY 26 archer_col cols 5 // darts are row 26
      SET_2DA_ENTRY 27 archer_col cols 5 // sling is row 27
    END
  END
IF_EXISTS BUT_ONLY
