/* STATE.IDS patching to ToB - thanks, Cam, if you read it */
/* adds custom IsValidForPartyDialogue state */
APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~

/* ToB ACTION.IDS parts that work within SoA */
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

/* ToB TRIGGER.IDS parts that work within SoA */
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

/* SHOUT.IDS creation if it does not exist */
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

/* GTIMES.IDS confirmations/additions */
APPEND ~GTIMES.IDS~    ~5 ONE_MINUTE~         UNLESS ~ONE_MINUTE~
APPEND ~GTIMES.IDS~   ~10 TWO_MINUTES~        UNLESS ~TWO_MINUTES~
APPEND ~GTIMES.IDS~   ~15 THREE_MINUTES~      UNLESS ~THREE_MINUTES~
APPEND ~GTIMES.IDS~   ~20 FOUR_MINUTES~       UNLESS ~FOUR_MINUTES~
APPEND ~GTIMES.IDS~   ~25 FIVE_MINUTES~       UNLESS ~FIVE_MINUTES~
APPEND ~GTIMES.IDS~   ~30 SIX_MINUTES~        UNLESS ~SIX_MINUTES~
APPEND ~GTIMES.IDS~   ~35 SEVEN_MINUTES~      UNLESS ~SEVEN_MINUTES~
APPEND ~GTIMES.IDS~   ~40 EIGHT_MINUTES~      UNLESS ~EIGHT_MINUTES~
APPEND ~GTIMES.IDS~   ~45 NINE_MINUTES~       UNLESS ~NINE_MINUTES~
APPEND ~GTIMES.IDS~   ~50 TEN_MINUTES~        UNLESS ~TEN_MINUTES~
APPEND ~GTIMES.IDS~   ~55 ELEVEN_MINUTES~     UNLESS ~ELEVEN_MINUTES~
APPEND ~GTIMES.IDS~   ~60 TWELVE_MINUTES~     UNLESS ~TWELVE_MINUTES~
APPEND ~GTIMES.IDS~   ~65 THIRTEEN_MINUTES~   UNLESS ~THIRTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~70 FOURTEEN_MINUTES~   UNLESS ~FOURTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~75 FIFTEEN_MINUTES~    UNLESS ~FIFTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~80 SIXTEEN_MINUTES~    UNLESS ~SIXTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~85 SEVENTEEN_MINUTES~  UNLESS ~SEVENTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~90 EIGHTEEN_MINUTES~   UNLESS ~EIGHTEEN_MINUTES~
APPEND ~GTIMES.IDS~   ~95 NINETEEN_MINUTES~   UNLESS ~NINETEEN_MINUTES~
APPEND ~GTIMES.IDS~  ~100 TWENTY_MINUTES~     UNLESS ~TWENTY_MINUTES~
APPEND ~GTIMES.IDS~  ~150 THIRTY_MINUTES~     UNLESS ~THIRTY_MINUTES~
APPEND ~GTIMES.IDS~  ~200 FORTY_MINUTES~      UNLESS ~FORTY_MINUTES~
APPEND ~GTIMES.IDS~  ~250 FIFTY_MINUTES~      UNLESS ~FIFTY_MINUTES~
APPEND ~GTIMES.IDS~  ~300 ONE_HOUR~           UNLESS ~ONE_HOUR~
APPEND ~GTIMES.IDS~  ~600 TWO_HOURS~          UNLESS ~TWO_HOURS~
APPEND ~GTIMES.IDS~  ~900 THREE_HOURS~        UNLESS ~THREE_HOURS~
APPEND ~GTIMES.IDS~ ~1200 FOUR_HOURS~         UNLESS ~FOUR_HOURS~
APPEND ~GTIMES.IDS~ ~1500 FIVE_HOURS~         UNLESS ~FIVE_HOURS~
APPEND ~GTIMES.IDS~ ~1800 SIX_HOURS~          UNLESS ~SIX_HOURS~
APPEND ~GTIMES.IDS~ ~2100 SEVEN_HOURS~        UNLESS ~SEVEN_HOURS~
APPEND ~GTIMES.IDS~ ~2400 EIGHT_HOURS~        UNLESS ~EIGHT_HOURS~
APPEND ~GTIMES.IDS~ ~2700 NINE_HOURS~         UNLESS ~NINE_HOURS~
APPEND ~GTIMES.IDS~ ~3000 TEN_HOURS~          UNLESS ~TEN_HOURS~
APPEND ~GTIMES.IDS~ ~3300 ELEVEN_HOURS~       UNLESS ~ELEVEN_HOURS~
APPEND ~GTIMES.IDS~ ~3600 TWELVE_HOURS~       UNLESS ~TWELVE_HOURS~
APPEND ~GTIMES.IDS~ ~3900 THIRTEEN_HOURS~     UNLESS ~THIRTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~4200 FOURTEEN_HOURS~     UNLESS ~FOURTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~4500 FIFTEEN_HOURS~      UNLESS ~FIFTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~4800 SIXTEEN_HOURS~      UNLESS ~SIXTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~5100 SEVENTEEN_HOURS~    UNLESS ~SEVENTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~5400 EIGHTEEN_HOURS~     UNLESS ~EIGHTEEN_HOURS~
APPEND ~GTIMES.IDS~ ~5700 NINETEEN_HOURS~     UNLESS ~NINETEEN_HOURS~
APPEND ~GTIMES.IDS~ ~6000 TWENTY_HOURS~       UNLESS ~TWENTY_HOURS~
APPEND ~GTIMES.IDS~ ~6300 TWENTY_ONE_HOURS~   UNLESS ~TWENTY_ONE_HOURS~
APPEND ~GTIMES.IDS~ ~6600 TWENTY_TWO_HOURS~   UNLESS ~TWENTY_TWO_HOURS~
APPEND ~GTIMES.IDS~ ~6900 TWENTY_THREE_HOURS~ UNLESS ~TWENTY_THREE_HOURS~


/* ANIMATE.IDS rechecks for non-fixpacked installs */
APPEND ~ANIMATE.IDS~ ~0x7F3F YAGA-SHURA~ 		UNLESS ~^0x7F3F~
APPEND ~ANIMATE.IDS~ ~0xE000 CYCLOPS~ 			UNLESS ~^0xE000~
APPEND ~ANIMATE.IDS~ ~0xE060 LICH_WHITE~ 		UNLESS ~^0xE060~
APPEND ~ANIMATE.IDS~ ~0xE0A0 TROLL_ICE~ 		UNLESS ~^0xE0A0~
APPEND ~ANIMATE.IDS~ ~0xE200 BEETLE~ 			UNLESS ~^0xE200~
APPEND ~ANIMATE.IDS~ ~0xE210 BEETLE_FIRE~ 		UNLESS ~^0xE210~
APPEND ~ANIMATE.IDS~ ~0xE220 BEETLE_BOMBADIER~ 	UNLESS ~^0xE220~
APPEND ~ANIMATE.IDS~ ~0xE230 BEETLE_RHINOCEROS~ UNLESS ~^0xE230~
APPEND ~ANIMATE.IDS~ ~0xE300 GHOST~ 			UNLESS ~^0xE300~
APPEND ~ANIMATE.IDS~ ~0xE310 GHOUL_GREATER~ 	UNLESS ~^0xE310~
APPEND ~ANIMATE.IDS~ ~0xE320 GHAST_GREATER~ 	UNLESS ~^0xE320~
APPEND ~ANIMATE.IDS~ ~0xE510 LIZARD_MAN~ 		UNLESS ~^0xE510~
APPEND ~ANIMATE.IDS~ ~0xE520 LIZARD_MAN_KING~ 	UNLESS ~^0xE520~
APPEND ~ANIMATE.IDS~ ~0xEA10 GHOST_SHADOW~ 		UNLESS ~^0xEA10~
APPEND ~ANIMATE.IDS~ ~0xEA20 GHOST_SHADE~ 		UNLESS ~^0xEA20~
APPEND ~ANIMATE.IDS~ ~0xEC00 WIGHT~ 			UNLESS ~^0xEC00~
APPEND ~ANIMATE.IDS~ ~0xEC10 WIGHT_LESSER~ 		UNLESS ~^0xEC10~
APPEND ~ANIMATE.IDS~ ~0xEC20 WIGHT_GREATER~		UNLESS ~^0xEC20~
APPEND ~ANIMATE.IDS~ ~0xEE00 ZOMBIE_LESSER~ 	UNLESS ~^0xEE00~
APPEND ~ANIMATE.IDS~ ~0xEE10 ZOMBIE_GREATER~	UNLESS ~^0xEE10~
APPEND ~ANIMATE.IDS~ ~0xEF10 ELEMENTAL_WATER~ 	UNLESS ~^0xEF10~
