APPEND ~ACTION.IDS~ ~31 SpellRES(S:RES*,O:Target*)~
             UNLESS ~31 SpellRES(S:RES\*,O:Target\*)~
APPEND ~ACTION.IDS~ ~95 SpellPointRES(S:RES*,P:Target*)~
             UNLESS ~95 SpellPointRES(S:RES\*,P:Target\*)~
APPEND ~ACTION.IDS~ ~113 ForceSpellRES(S:RES*,O:Target)~
             UNLESS ~113 ForceSpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~114 ForceSpellPointRES(S:RES*,P:Target)~
             UNLESS ~114 ForceSpellPointRES(S:RES\*,P:Target)~
APPEND ~ACTION.IDS~ ~147 RemoveSpellRES(S:Spell*)~
             UNLESS ~147 RemoveSpellRES(S:Spell\*)~
APPEND ~ACTION.IDS~ ~160 ApplySpellRES(S:RES*,O:Target)~
             UNLESS ~160 ApplySpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~181 ReallyForceSpellRES(S:RES*,O:Target)~
             UNLESS ~181 ReallyForceSpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~191 SpellNoDecRES(S:RES*,O:Target*)~
             UNLESS ~191 SpellNoDecRES(S:RES\*,O:Target\*)~
APPEND ~ACTION.IDS~ ~192 SpellPointNoDecRES(S:RES*,P:Target*)~
             UNLESS ~192 SpellPointNoDecRES(S:RES\*,P:Target\*)~
APPEND ~ACTION.IDS~ ~240 ReallyForceSpellDeadRES(S:RES*,O:Target)~
             UNLESS ~240 ReallyForceSpellDeadRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~318 ForceSpellRangeRES(S:RES*,O:Target)~
             UNLESS ~318 ForceSpellRangeRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~319 ForceSpellPointRangeRES(S:RES*,P:Target)~
             UNLESS ~319 ForceSpellPointRangeRES(S:RES\*,P:Target)~
APPEND ~ACTION.IDS~ ~337 ReallyForceSpellPointRES(S:RES*,P:Target*)~
             UNLESS ~337 ReallyForceSpellPointRES(S:RES\*,P:Target\*)~
COPY_EXISTING ~action.ids~ ~override~
  REPLACE_TEXTUALLY ~^106 Shout(.*$~ ~106 Shout(I:ID*SHOUTIDS)~
  BUT_ONLY_IF_IT_CHANGES

APPEND ~TRIGGER.IDS~ ~0x00A1 SpellCastOnMeRES(S:Spell*,O:Caster*)~
              UNLESS ~0x00A1 SpellCastOnMeRES(S:Spell\*,O:Caster\*)~
APPEND ~TRIGGER.IDS~ ~0x0091 SpellCastRES(S:Spell*,O:Object*)~
              UNLESS ~0x0091 SpellCastRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x00A6 SpellCastPriestRES(S:Spell*,O:Object*)~
              UNLESS ~0x00A6 SpellCastPriestRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x00A7 SpellCastInnateRES(S:Spell*,O:Object*)~
              UNLESS ~0x00A7 SpellCastInnateRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x4031 HaveSpellRES(S:Spell*)~
              UNLESS ~0x4031 HaveSpellRES(S:Spell\*)~
APPEND ~TRIGGER.IDS~ ~0x40D5 ActuallyInCombat()~
              UNLESS ~0x40D5 ActuallyInCombat()~
COPY_EXISTING ~trigger.ids~ ~override~
  REPLACE_TEXTUALLY ~\bHeard(O:Object\*,I:ID\*)~
                    ~Heard(O:Object*,I:ID*SHOUTIDS)~
  BUT_ONLY_IF_IT_CHANGES

ACTION_IF NOT FILE_EXISTS_IN_GAME ~shoutids.ids~ THEN BEGIN
  
<<<<<<<<shoutids.ids
90
123 HEALME
124 ASSIST
125 ALERT
126 SOLAR_STANCE
>>>>>>>>
COPY ~shoutids.ids~ ~override~

END

COPY_EXISTING ~kit.ids~ ~override~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(TRUECLASS[ %TAB%%LNL%%MNL%%WNL%]+\)~              ~0x4000 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BERSERKER[ %TAB%%LNL%%MNL%%WNL%]+\)~              ~0x4001 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(WIZARDSLAYER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x4002 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(KENSAI[ %TAB%%LNL%%MNL%%WNL%]+\)~                 ~0x4003 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(CAVALIER[ %TAB%%LNL%%MNL%%WNL%]+\)~               ~0x4004 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(INQUISITOR[ %TAB%%LNL%%MNL%%WNL%]+\)~             ~0x4005 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(UNDEADHUNTER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x4006 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_ABJURER[ %TAB%%LNL%%MNL%%WNL%]+\)~     ~0x0040 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_CONJURER[ %TAB%%LNL%%MNL%%WNL%]+\)~    ~0x0080 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_DIVINER[ %TAB%%LNL%%MNL%%WNL%]+\)~     ~0x0100 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_ENCHANTER[ %TAB%%LNL%%MNL%%WNL%]+\)~   ~0x0200 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_ILLUSIONIST[ %TAB%%LNL%%MNL%%WNL%]+\)~ ~0x0400 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_INVOKER[ %TAB%%LNL%%MNL%%WNL%]+\)~     ~0x0800 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_NECROMANCER[ %TAB%%LNL%%MNL%%WNL%]+\)~ ~0x1000 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_TRANSMUTER[ %TAB%%LNL%%MNL%%WNL%]+\)~  ~0x2000 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(MAGESCHOOL_GENERALIST[ %TAB%%LNL%%MNL%%WNL%]+\)~  ~0x4000 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(FERALAN[ %TAB%%LNL%%MNL%%WNL%]+\)~                ~0x4007 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(STALKER[ %TAB%%LNL%%MNL%%WNL%]+\)~                ~0x4008 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BEASTMASTER[ %TAB%%LNL%%MNL%%WNL%]+\)~            ~0x4009 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(ASSASIN[ %TAB%%LNL%%MNL%%WNL%]+\)~                ~0x400A \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BOUNTYHUNTER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x400B \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(SWASHBUCKLER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x400C \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BLADE[ %TAB%%LNL%%MNL%%WNL%]+\)~                  ~0x400D \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(JESTER[ %TAB%%LNL%%MNL%%WNL%]+\)~                 ~0x400E \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(SKALD[ %TAB%%LNL%%MNL%%WNL%]+\)~                  ~0x400F \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(GODTALOS[ %TAB%%LNL%%MNL%%WNL%]+\)~               ~0x4013 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(GODHELM[ %TAB%%LNL%%MNL%%WNL%]+\)~                ~0x4014 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(GODLATHANDER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x4015 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(TOTEMIC[ %TAB%%LNL%%MNL%%WNL%]+\)~                ~0x4010 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(SHAPESHIFTER[ %TAB%%LNL%%MNL%%WNL%]+\)~           ~0x4011 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BEASTFRIEND[ %TAB%%LNL%%MNL%%WNL%]+\)~            ~0x4012 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(BARBARIAN[ %TAB%%LNL%%MNL%%WNL%]+\)~              ~0x40000000 \1~
  REPLACE_TEXTUALLY ~^.+[ %TAB%]\(WILDMAGE[ %TAB%%LNL%%MNL%%WNL%]+\)~               ~0x80000000 \1~
  BUT_ONLY

APPEND ~kit.ids~ ~0x4000 TRUECLASS~     UNLESS ~^.+[ %TAB%]TRUECLASS[ %TAB%%LNL%%MNL%%WNL%]+~
APPEND ~kit.ids~ ~0x40000000 BARBARIAN~ UNLESS ~^.+[ %TAB%]BARBARIAN[ %TAB%%LNL%%MNL%%WNL%]+~
APPEND ~kit.ids~ ~0x80000000 WILDMAGE~  UNLESS ~^.+[ %TAB%]WILDMAGE[ %TAB%%LNL%%MNL%%WNL%]+~

APPEND ~ACTION.IDS~ ~31 SpellRES(S:RES*,O:Target*)~
            UNLESS ~31 SpellRES(S:RES\*,O:Target\*)~
APPEND ~ACTION.IDS~ ~95 SpellPointRES(S:RES*,P:Target*)~
            UNLESS ~95 SpellPointRES(S:RES\*,P:Target\*)~
APPEND ~ACTION.IDS~ ~113 ForceSpellRES(S:RES*,O:Target)~
            UNLESS ~113 ForceSpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~114 ForceSpellPointRES(S:RES*,P:Target)~
            UNLESS ~114 ForceSpellPointRES(S:RES\*,P:Target)~
APPEND ~ACTION.IDS~ ~147 RemoveSpellRES(S:Spell*)~
            UNLESS ~147 RemoveSpellRES(S:Spell\*)~
APPEND ~ACTION.IDS~ ~160 ApplySpellRES(S:RES*,O:Target)~
            UNLESS ~160 ApplySpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~181 ReallyForceSpellRES(S:RES*,O:Target)~
            UNLESS ~181 ReallyForceSpellRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~191 SpellNoDecRES(S:RES*,O:Target*)~
            UNLESS ~191 SpellNoDecRES(S:RES\*,O:Target\*)~
APPEND ~ACTION.IDS~ ~192 SpellPointNoDecRES(S:RES*,P:Target*)~
            UNLESS ~192 SpellPointNoDecRES(S:RES\*,P:Target\*)~
APPEND ~ACTION.IDS~ ~240 ReallyForceSpellDeadRES(S:RES*,O:Target)~
            UNLESS ~240 ReallyForceSpellDeadRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~318 ForceSpellRangeRES(S:RES*,O:Target)~
            UNLESS ~318 ForceSpellRangeRES(S:RES\*,O:Target)~
APPEND ~ACTION.IDS~ ~319 ForceSpellPointRangeRES(S:RES*,P:Target)~
            UNLESS ~319 ForceSpellPointRangeRES(S:RES\*,P:Target)~
APPEND ~ACTION.IDS~ ~337 ReallyForceSpellPointRES(S:RES*,P:Target*)~
            UNLESS ~337 ReallyForceSpellPointRES(S:RES\*,P:Target\*)~
APPEND ~TRIGGER.IDS~ ~0x00A1 SpellCastOnMeRES(S:Spell*,O:Caster*)~
             UNLESS ~0x00A1 SpellCastOnMeRES(S:Spell\*,O:Caster\*)~
APPEND ~TRIGGER.IDS~ ~0x0091 SpellCastRES(S:Spell*,O:Object*)~
             UNLESS ~0x0091 SpellCastRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x00A6 SpellCastPriestRES(S:Spell*,O:Object*)~
             UNLESS ~0x00A6 SpellCastPriestRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x00A7 SpellCastInnateRES(S:Spell*,O:Object*)~
             UNLESS ~0x00A7 SpellCastInnateRES(S:Spell\*,O:Object\*)~
APPEND ~TRIGGER.IDS~ ~0x4031 HaveSpellRES(S:Spell*)~
             UNLESS ~0x4031 HaveSpellRES(S:Spell\*)~
APPEND ~TRIGGER.IDS~ ~0x40D5 ActuallyInCombat()~
             UNLESS ~0x40D5 ActuallyInCombat()~

// Appending state.ids for combat AI (Use numerical values for shout.ids)

APPEND ~state.ids~
~0x00102029 STATE_HARMLESS~
UNLESS ~STATE_HARMLESS~
APPEND ~state.ids~
~0x00400010 STATE_NOT_VISIBLE~
UNLESS ~STATE_NOT_VISIBLE~
APPEND ~state.ids~
~0x8014202D STATE_OUT_OF_ACTION~
UNLESS ~STATE_OUT_OF_ACTION~

// Making sure that the player has correct (ToB) version of Shout() action in the action.ids

COPY_EXISTING ~action.ids~ ~override~
 REPLACE_TEXTUALLY ~^106 Shout(.*$~ ~106 Shout(I:ID*SHOUTIDS)~
 BUT_ONLY_IF_IT_CHANGES
