Author Topic: Ding0's Tweak Pack  (Read 136513 times)

n00ber

  • Guest
Re: Ding0's Tweak Pack
« Reply #50 on: October 19, 2005, 04:59:13 PM »
For some reason, I think that the "Corrected Summonned Demon Behaviour" isn't working as it should. Glabrezu attack Pit Fiends alright, but they also attack Nabassu, and even other Glabrezu. I don't think that's supposed to happen.

I have Oversight installed, but since it's actually recommended that this component is installed on top of the alignment correction of Oversight, I don't think that's the problem.

Nice mod, BTW.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Ding0's Tweak Pack
« Reply #51 on: October 20, 2005, 11:11:57 AM »
It should be coded so that Glabrezu will attack Nabassu and so on if nothing else is around (demons being fairly unpleasent creatures), but always favour attacking Pit Fiends. Perhaps some D&D person could provide some information on whether they would actually attack each other?

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: Ding0's Tweak Pack
« Reply #52 on: October 23, 2005, 10:18:04 AM »
They'd attack Pit Fiends because Bit Fiends are Baatezu, while Glabrezu are Tanar'ri.

I don't think there are many other Devils in the game - Erinyes and Abishai spring to mind as possibilities.

Other than that I would tend to think that Tanar'ri summoned to the Prime would turn their destructive energies on mortals to promote Chaos instead of attacking each other.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Ding0's Tweak Pack
« Reply #53 on: October 23, 2005, 10:21:37 AM »
And if there's nothing else around?

Offline Caedwyr

  • Planewalker
  • *****
  • Posts: 433
Re: Ding0's Tweak Pack
« Reply #54 on: October 23, 2005, 02:03:59 PM »
Probably the strongest one would take control of the others.  I can see two equally powerful Tanar'ri going at it, but since these creatures can gate in more creatures, there wouldn't be nothing else around for long.  They are intelligent, and not just mindless killing machines.
"Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."  - Mikka

PnP Celestials
Geomantic Sorcerer Kit

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: Ding0's Tweak Pack
« Reply #55 on: October 23, 2005, 08:20:36 PM »
And if there's nothing else around?

They'd walk around and find someone to start some shit with.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Shard

  • Planewalker
  • *****
  • Posts: 24
Re: Ding0's Tweak Pack
« Reply #56 on: November 09, 2005, 08:29:53 AM »
Ding0 Tweaks rocks. I can't play without it anymore. It just makes so much sense.
My gratitude, Sim.

Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Ding0's Tweak Pack
« Reply #57 on: January 27, 2007, 10:03:52 PM »
I wonder why Summoning Cap Removal only patches a predefined list of creatures instead of doing something like this:
Code: [Select]
COPY_EXISTING_REGEXP GLOB ~^.*\.CRE$~ ~override~
PATCH_IF SOURCE_SIZE > 0 BEGIN
 READ_BYTE 0x275 "cur"
 PATCH_IF ("%cur%" = 6) BEGIN
  WRITE_BYTE 0x275 20 // Change gender from SUMMONED
 END
END
BUT_ONLY_IF_IT_CHANGES

Does it cause any problems I'm not aware of?

It would make this tweak more compatible with mods which add new summoned/summonible creatures.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Ding0's Tweak Pack
« Reply #58 on: January 28, 2007, 10:40:40 AM »
The reason is one of two: either because I was concerned that some creatures might be erroneously flagged as summoned and wanted to exclude them (this is daft), or because the code predates READ_BYTE (this is more likely). Next release will fix.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Ding0's Tweak Pack
« Reply #59 on: January 28, 2007, 02:33:44 PM »
The reason is one of two: either because I was concerned that some creatures might be erroneously flagged as summoned and wanted to exclude them (this is daft), or because the code predates READ_BYTE (this is more likely). Next release will fix.
There actually are some enemy-only creatures that are flagged as summoned.

Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Ding0's Tweak Pack
« Reply #60 on: January 28, 2007, 04:14:53 PM »
Going through all EFF and SPL files also may be a good idea. By the way - there are four SPL files affected by this in unmodded game, not just two (I didn't bother to check if they're actually used anywhere).

Code: [Select]
COPY_EXISTING_REGEXP GLOB ~^.*\.EFF$~ ~OVERRIDE~
READ_LONG 0x10 "opcode"
PATCH_IF (("%opcode%" = 219) // Attack roll penalty
OR ("%opcode%" = 72) // Change AI type
OR ("%opcode%" = 179) // Damage vs type bonus
OR ("%opcode%" = 238) // Disintegrate
OR ("%opcode%" = 175) // Hold creature
OR ("%opcode%" = 185) // Hold creature 2
OR ("%opcode%" = 248) // Melee hit effect
OR ("%opcode%" = 109) // Paralyze
OR ("%opcode%" = 100) // Protection from creature type
OR ("%opcode%" = 249) // Ranged hit effect
OR ("%opcode%" = 55) // Slay
OR ("%opcode%" = 178) // THAC0 vs type bonus
OR ("%opcode%" = 177) // Use EFF file
OR ("%opcode%" = 283) // Use EFF file as curse
) THEN BEGIN
READ_LONG 0x20 "IDS_file"
READ_LONG 0x1c "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
WRITE_LONG 0x1c 20
END
END ELSE
PATCH_IF ("%opcode%" = 71) // Sex change
THEN BEGIN
READ_LONG 0x1c "IDS_entry"
PATCH_IF ("%IDS_entry%" = 6)
THEN BEGIN
WRITE_LONG 0x1c 20
END
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^.*\.SPL$~ ~override~
  READ_LONG  0x64 "abil_off" ELSE 0
  READ_SHORT 0x68 "abil_num" ELSE 0
  READ_LONG  0x6a "fx_off"   ELSE 0
  FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
    READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
    READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
    FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
      READ_SHORT ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
      PATCH_IF (("%opcode%" = 219) // Attack roll penalty
OR ("%opcode%" = 72) // Change AI type
OR ("%opcode%" = 179) // Damage vs type bonus
OR ("%opcode%" = 238) // Disintegrate
OR ("%opcode%" = 175) // Hold creature
OR ("%opcode%" = 185) // Hold creature 2
OR ("%opcode%" = 248) // Melee hit effect
OR ("%opcode%" = 109) // Paralyze
OR ("%opcode%" = 100) // Protection from creature type
OR ("%opcode%" = 249) // Ranged hit effect
OR ("%opcode%" = 55) // Slay
OR ("%opcode%" = 178) // THAC0 vs type bonus
OR ("%opcode%" = 177) // Use EFF file
OR ("%opcode%" = 283) // Use EFF file as curse     
      ) THEN BEGIN
READ_LONG ("%fx_off%" + 0x08 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_file"
READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
END
      END ELSE
  PATCH_IF ("%opcode%" = 71) // Sex change
  THEN BEGIN
  READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
  PATCH_IF ("%IDS_entry%" = 6)
  THEN BEGIN
  WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
  END
  END
    END   
  END
BUT_ONLY_IF_IT_CHANGES

EDIT:
P.S. Of course, then we also have effects in ITM files... I'm sure you get the idea. :)
« Last Edit: January 28, 2007, 06:35:43 PM by pro5 »

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Ding0's Tweak Pack
« Reply #61 on: January 28, 2007, 09:13:41 PM »
Usual disclaimer applies: All this stuff didn't exist back in mid-2002 or whenever D0Tweak first originated, and I'm really, really lazy. Thanks for the code, though--consider it incorporated into the next version. I'm increasingly appreciating that I don't seem to have to even write my own mods any more. :)

lac

  • Guest
Re: Ding0's Tweak Pack
« Reply #62 on: February 16, 2007, 07:02:08 AM »
I have been playing a Cleric-Thief recently, through BG1 and now in BG2.  Assuming that you find the concept of sneaking around and thumping people with a great big quarterstaff so unlikely as to be unwilling to exploit the fact that the game allows it,  there exists in BG1 only one useful weapon  for a cleric-thief, the staff-mace +2 (which
is available on Werewolf Island in TotSC).  For vanilla BG: nothing.    No magical clubs.  I wonder if staff-maces are treated differently by your changed
backstab modifiers,, or if they suffer the same penalty as regular quarterstaves?

curious,
lac

DanielZK

  • Guest
Re: Ding0's Tweak Pack
« Reply #63 on: May 21, 2007, 07:57:07 PM »
Whenever i try extracting the remove summon cap, there is a parsing error. Help!

Offline Salk

  • Planewalker
  • *****
  • Posts: 873
Re: Ding0's Tweak Pack
« Reply #64 on: May 22, 2007, 11:05:37 AM »
DanielZK, do you have Big Picture installed ?

John

  • Guest
Re: Ding0's Tweak Pack
« Reply #65 on: August 04, 2007, 10:45:05 PM »
How does one remove the Innate Drow Abilities component of the Tweak Pack?  I would like to be able to use the general creature and area improvements.  I've installed Ver 2.3

 It used to be a stand alone mod that I could add for a particular game.  I enjoy it occasionally but not all the time.

Also, I don't know if this mod is the cause, but there are now two elder orb beholders in the beholder cave in the Underdark that give the eyestalk, the sword artifact and the spell amulet.

Thanks,

John

Offline lac

  • Planewalker
  • *****
  • Posts: 107
Re: Ding0's Tweak Pack v20
« Reply #66 on: September 18, 2008, 09:12:19 AM »
I just installed the Tweak Pack on a BG Tutu installation.

The readme mentions 'Greyfain's BG1-style summoning' as being BG Tutu compatible, but it wasn't in the archive
I downloaded.  Also, it was possible to install the Visual Ioun Stones, but the readme doesn't indicate if this is a
sensible idea for BG1 Tutu or not, nor whether it has been tested and found to work.  I dont anticipate running into
any Ioun Stones playing BG1, but then I have just dl'ed a bunch of mods I have never played, nor even heard about.  :)
So for all I know I am about to run into Ioun stones all over the place.

Thank you very much for the mod by the way. 

Keiran Halycon

  • Guest
Re: Ding0's Tweak Pack
« Reply #67 on: November 28, 2008, 08:25:04 PM »
I noticed the same issue.  I got the component to be installable by blanking lines 826 and 1229 of setup-d0tweak.tp2 (the first for the summoning cap alone, the second for the bg1-style summons), but I'm not sure yet if there are any real incompatibilities that I haven't noticed yet.  In my brief testing, it seems to work fine, with the following exception: the wand of monster summoning gives me the message "You cannot control more than 5 monsters at any given time" and creates 5 creatures (regardless of how many I already have).  Based on the description (12 HD of creatures), and based on the effect of Monster Summoning II (also 12 HD of creatures, summons 6 creatures when used), I think it's trying to spawn 6 creatures, but something is still left of the summoning cap and is stopping it.

Offline rhomboidspace

  • Planewalker
  • *****
  • Posts: 6
Re: Ding0's Tweak Pack
« Reply #68 on: February 10, 2009, 08:41:40 AM »
found a small bug with the remove summoning cap marco of V20, in the item effect check of sex change, uses %index2%, instead of %index%,  easy fix,  just a demon from copy/pasting code.

Dirty Uncle Bertie

  • Guest
Re: Ding0's Tweak Pack
« Reply #69 on: February 10, 2009, 11:35:59 AM »
Are you able to upload a fixed file somewhere, rhomboidspace?  That would be a big help.

Offline rhomboidspace

  • Planewalker
  • *****
  • Posts: 6
Re: Ding0's Tweak Pack
« Reply #70 on: February 12, 2009, 12:45:05 PM »
Code: [Select]
BACKUP ~d0tweak/backup~
AUTHOR ~SimDing0@hotmail.com~

ALLOW_MISSING
  ~OGRESU.CRE~
  ~JAGUARSU.CRE~
  ~CATLIOWP.CRE~
  ~SWAAIR01.CRE~
  ~SWAAIR02.CRE~   
  ~DAUMBER.CRE~   
  ~BEARBRSU.CRE~
  ~BEARGRSU.CRE~
  ~BEARBLSU.CRE~
  ~GHOULSU.CRE~
  ~C6GUEN.CRE~   
  ~UDDOOR07.CRE~   
  ~SUMTAN01.CRE~   
  ~SUMTAN02.CRE~   
  ~TELICESA.CRE~   
  ~SAHANGU.CRE~   
  ~SKELWASU.CRE~   
  ~TOMEGOL1.CRE~   
  ~TOMEGOL2.CRE~   
  ~TOMEGOL3.CRE~   
  ~TOMEGOL4.CRE~   
  ~ELFIRSU1.CRE~   
  ~ELFIRSU2.CRE~   
  ~ELFIRSU3.CRE~   
  ~ELFIRSU4.CRE~   
  ~SERVSU.CRE~   
  ~ELFIRSUW.CRE~   
  ~TELICESA.CRE~   
  ~SPIDSWSU.CRE~   
  ~BERSERSU.CRE~   
  ~ELFIRPR.CRE~   
  ~WOLFDISU.CRE~   
  ~ELFIRSU.CRE~   
  ~ELAIRSU1.CRE~   
  ~ELAIRSU2.CRE~   
  ~ELAIRSU3.CRE~   
  ~OGREMASU.CRE~   
  ~ELAIRSUW.CRE~   
  ~SWAFIR01.CRE~   
  ~SWAFIR02.CRE~   
  ~SAHLACE.CRE~
  ~HAMASU.CRE~   
  ~DOGWISU.CRE~   
  ~SPIDPHSU.CRE~   
  ~SUMEFREE.CRE~
  ~SENSTALK.CRE~   
  ~RABBITSU.CRE~   
  ~SMOUNDSU.CRE~   
  ~SPIRLION.CRE~   
  ~GIBBERSU.CRE~   
  ~ELEARSU1.CRE~   
  ~ELEARSU2.CRE~   
  ~ELEARSU3.CRE~   
  ~ELEARSU4.CRE~   
  ~ELEARSUW.CRE~   
  ~GLOBSHAM.CRE~   
  ~STALKE.CRE~   
  ~CARRIOSU.CRE~   
  ~ELFIRPR2.CRE~   
  ~ELFIRPR3.CRE~   
  ~DRUFIR01.CRE~   
  ~TASLOISU.CRE~   
  ~GORMISTP.CRE~   
  ~DAGNOLL.CRE~   
  ~MOONDOG.CRE~   
  ~BEARCASU.CRE~   
  ~WOLFSU.CRE~   
  ~WRAITHSU.CRE~   
  ~DOGWASU.CRE~   
  ~BASILGSU.CRE~   
  ~MISTPO01.CRE~   
  ~DOGWAWP.CRE~   
  ~HOBGOBSU.CRE~
  ~SPIRBEAR.CRE~   
  ~SUMELEAR.CRE~   
  ~WYVERNSU.CRE~   
  ~SWORD01.CRE~   
  ~GNOLLSU.CRE~   
  ~BASILLSU.CRE~   
  ~WOLFWISU.CRE~   
  ~ELEARPR.CRE~   
  ~SPIRSNAK.CRE~   
  ~SPIRWOLF.CRE~   
  ~CATJAGSU.CRE~   
  ~NISHRUSU.CRE~   
  ~WOLFWWSU.CRE~   
  ~TELELFIR.CRE~   
  ~SAHSKEL.CRE~   
  ~CATJAGWP.CRE~   
  ~SWAEAR01.CRE~   
  ~SWAEAR02.CRE~   
  ~GHASTGSU.CRE~   
  ~ELEARPR2.CRE~   
  ~ELEARPR3.CRE~   
  ~GHASTSU.CRE~   
  ~WISH02.CRE~   
  ~SHADOWSU.CRE~   
  ~SUMELAIR.CRE~   
  ~HAKSU.CRE~   
  ~GPSKEL1.CRE~   
  ~DECKFELE.CRE~   
  ~DJINNISU.CRE~   
  ~OGREGRSU.CRE~   
  ~JELLMUSU.CRE~   
  ~SUMELFIR.CRE~   
  ~NYMPHSU.CRE~   
  ~OGRELESU.CRE~   
  ~EFREETSU.CRE~   
  ~SAHZOMB.CRE~   
  ~SPIDGISU.CRE~   
  ~BERSER02.CRE~   
  ~BERSER03.CRE~   
  ~BEARPOSU.CRE~   
  ~DRUEAR01.CRE~   
  ~KOBOLDSU.CRE~   
  ~CATLIOSU.CRE~   
  ~ETTERCSU.CRE~   
  ~SUMDJINN.CRE~   
  ~SWORD02.CRE~   
  ~WORGSU.CRE~
  ~XVARTSU.CRE~

ALWAYS

  COPY_EXISTING_REGEXP GLOB ~^anomen[0-9]*\.cre~ ~override~
                            ~^imoen[0-9]*\.cre~  ~override~
                            ~^mazzy[0-9]*\.cre~  ~override~
   READ_LONG 0x244 "current_kit_value"
   PATCH_IF ("%current_kit_value%" = 0x00000000) BEGIN
     WRITE_LONG 0x244 0x40000000
   END
  BUT_ONLY_IF_IT_CHANGES

  COPY_EXISTING_REGEXP GLOB ~^haer[0-9]*\.cre~ ~override~
   READ_LONG 0x244 "current_kit_value"
   PATCH_IF ("%current_kit_value%" = 0x00000020) BEGIN
     WRITE_LONG 0x244 0x400d0000
   END
  BUT_ONLY_IF_IT_CHANGES

  COPY_EXISTING_REGEXP GLOB ~^korgan[0-9]*\.cre~ ~override~
   READ_LONG 0x244 "current_kit_value"
   PATCH_IF ("%current_kit_value%" = 0x00010000) BEGIN
     WRITE_LONG 0x244 0x40010000
   END
  BUT_ONLY_IF_IT_CHANGES

  COPY_EXISTING ~spell.ids~ ~override~
REPLACE_TEXTUALLY ~PSIONIC _SUPERIOR_INVISIBILITY~ ~PSIONIC_SUPERIOR_INVISIBILITY~
  BUT_ONLY_IF_IT_CHANGES

  COPY_EXISTING ~kit.ids~ ~override~
    REPLACE_TEXTUALLY ~.*\bTRUECLASS\b~              ~0x4000 TRUECLASS~
    REPLACE_TEXTUALLY ~.*\bBERSERKER\b~              ~0x4001 BERSERKER~
    REPLACE_TEXTUALLY ~.*\bWIZARDSLAYER\b~           ~0x4002 WIZARDSLAYER~
    REPLACE_TEXTUALLY ~.*\bKENSAI\b~                 ~0x4003 KENSAI~
    REPLACE_TEXTUALLY ~.*\bCAVALIER\b~               ~0x4004 CAVALIER~
    REPLACE_TEXTUALLY ~.*\bINQUISITOR\b~             ~0x4005 INQUISITOR~
    REPLACE_TEXTUALLY ~.*\bUNDEADHUNTER\b~           ~0x4006 UNDEADHUNTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ABJURER\b~     ~0x0040 MAGESCHOOL_ABJURER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_CONJURER\b~    ~0x0080 MAGESCHOOL_CONJURER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_DIVINER\b~     ~0x0100 MAGESCHOOL_DIVINER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ENCHANTER\b~   ~0x0200 MAGESCHOOL_ENCHANTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ILLUSIONIST\b~ ~0x0400 MAGESCHOOL_ILLUSIONIST~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_INVOKER\b~     ~0x0800 MAGESCHOOL_INVOKER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_NECROMANCER\b~ ~0x1000 MAGESCHOOL_NECROMANCER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_TRANSMUTER\b~  ~0x2000 MAGESCHOOL_TRANSMUTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_GENERALIST\b~  ~0x0000 WILDMAGE~
    REPLACE_TEXTUALLY ~.*\bFERALAN\b~                ~0x4007 FERALAN~
    REPLACE_TEXTUALLY ~.*\bSTALKER\b~                ~0x4008 STALKER~
    REPLACE_TEXTUALLY ~.*\bBEASTMASTER\b~            ~0x4009 BEASTMASTER~
    REPLACE_TEXTUALLY ~.*\bASSASIN\b~                ~0x400A ASSASIN~
    REPLACE_TEXTUALLY ~.*\bBOUNTYHUNTER\b~           ~0x400B BOUNTYHUNTER~
    REPLACE_TEXTUALLY ~.*\bSWASHBUCKLER\b~           ~0x400C SWASHBUCKLER~
    REPLACE_TEXTUALLY ~.*\bBLADE\b~                  ~0x400D BLADE~
    REPLACE_TEXTUALLY ~.*\bJESTER\b~                 ~0x400E JESTER~
    REPLACE_TEXTUALLY ~.*\bSKALD\b~                  ~0x400F SKALD~
    REPLACE_TEXTUALLY ~.*\bGODTALOS\b~               ~0x4013 GODTALOS~
    REPLACE_TEXTUALLY ~.*\bGODHELM\b~                ~0x4014 GODHELM~
    REPLACE_TEXTUALLY ~.*\bGODLATHANDER\b~           ~0x4015 GODLATHANDER~
    REPLACE_TEXTUALLY ~.*\bTOTEMIC\b~                ~0x4010 TOTEMIC~
    REPLACE_TEXTUALLY ~.*\bSHAPESHIFTER\b~           ~0x4011 SHAPESHIFTER~
    REPLACE_TEXTUALLY ~.*\bBEASTFRIEND\b~            ~0x4012 BEASTFRIEND~
    REPLACE_TEXTUALLY ~.*\bBARBARIAN\b~              ~0x0000 BARBARIAN~
    REPLACE_TEXTUALLY ~.*\bWILDMAGE\b~               ~0x0000 WILDMAGE~
  BUT_ONLY_IF_IT_CHANGES

  APPEND ~kit.ids~ ~0x4000 TRUECLASS~
    UNLESS ~\bTRUECLASS\b~
  APPEND ~kit.ids~ ~0x0000 BARBARIAN~
    UNLESS ~\bBARBARIAN\b~
  APPEND ~kit.ids~ ~0x0000 WILDMAGE~
    UNLESS ~\bWILDMAGE\b~

  APPEND ~state.ids~ ~0x00000FC0 STATE_REALLY_DEAD~ UNLESS ~STATE_REALLY_DEAD~

  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~
    ~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~
    ~0x4031 HaveSpellRES(S:Spell*)~
    UNLESS ~0x4031 HaveSpellRES(S:Spell*)~

  APPEND ~ACTION.IDS~
    ~335 SetTokenGlobal(S:GLOBAL*,S:Area*,S:Token*)~
    UNLESS ~335 SetTokenGlobal(S:GLOBAL*,S:Area*,S:Token*)~

  APPEND ~CLASS.IDS~
    ~202 LONG_BOW~
    UNLESS ~202 LONG_BOW~
  APPEND ~CLASS.IDS~
    ~202 MAGE_ALL~
    UNLESS ~202 MAGE_ALL~

  COPY_EXISTING ~race.ids~ ~override~
    REPLACE_TEXTUALLY ~^149 +SHADOW\b~ ~149 STATUE~
  BUT_ONLY_IF_IT_CHANGES

  CLEAR_IDS_MAP

END

README ~d0tweak/readme.htm~

DEFINE_ACTION_MACRO ~REMOVE_SUMMONING_CAP~ BEGIN

ACTION_IF NOT FILE_EXISTS ~override/No_Summoning_Cap.d0~ THEN BEGIN

COPY ~d0tweak/dummy.d0~ ~override/No_Summoning_Cap.d0~

COPY_EXISTING_REGEXP GLOB ~^.*\.CRE$~ ~override~
PATCH_IF SOURCE_SIZE > 0 BEGIN
 READ_BYTE 0x275 "cur"
 PATCH_IF ("%cur%" = 6) BEGIN
  WRITE_BYTE 0x275 20 // Change gender from SUMMONED
 END
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^.*\.EFF$~ ~OVERRIDE~
READ_LONG 0x10 "opcode"
PATCH_IF (("%opcode%" = 219) // Attack roll penalty
OR ("%opcode%" = 72) // Change AI type
OR ("%opcode%" = 179) // Damage vs type bonus
OR ("%opcode%" = 238) // Disintegrate
OR ("%opcode%" = 175) // Hold creature
OR ("%opcode%" = 185) // Hold creature 2
OR ("%opcode%" = 248) // Melee hit effect
OR ("%opcode%" = 109) // Paralyze
OR ("%opcode%" = 100) // Protection from creature type
OR ("%opcode%" = 249) // Ranged hit effect
OR ("%opcode%" = 55) // Slay
OR ("%opcode%" = 178) // THAC0 vs type bonus
OR ("%opcode%" = 177) // Use EFF file
OR ("%opcode%" = 283) // Use EFF file as curse
) THEN BEGIN
READ_LONG 0x20 "IDS_file"
READ_LONG 0x1c "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
WRITE_LONG 0x1c 20
END
END ELSE
PATCH_IF ("%opcode%" = 71) // Sex change
THEN BEGIN
READ_LONG 0x1c "IDS_entry"
PATCH_IF ("%IDS_entry%" = 6)
THEN BEGIN
WRITE_LONG 0x1c 20
END
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^.*\.SPL$~ ~override~
  READ_LONG  0x64 "abil_off" ELSE 0
  READ_SHORT 0x68 "abil_num" ELSE 0
  READ_LONG  0x6a "fx_off"   ELSE 0
  FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
    READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
    READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
    FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
      READ_SHORT ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
      PATCH_IF (("%opcode%" = 219) // Attack roll penalty
OR ("%opcode%" = 72) // Change AI type
OR ("%opcode%" = 179) // Damage vs type bonus
OR ("%opcode%" = 238) // Disintegrate
OR ("%opcode%" = 175) // Hold creature
OR ("%opcode%" = 185) // Hold creature 2
OR ("%opcode%" = 248) // Melee hit effect
OR ("%opcode%" = 109) // Paralyze
OR ("%opcode%" = 100) // Protection from creature type
OR ("%opcode%" = 249) // Ranged hit effect
OR ("%opcode%" = 55) // Slay
OR ("%opcode%" = 178) // THAC0 vs type bonus
OR ("%opcode%" = 177) // Use EFF file
OR ("%opcode%" = 283) // Use EFF file as curse
      ) THEN BEGIN
READ_LONG ("%fx_off%" + 0x08 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_file"
READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
END
      END ELSE
  PATCH_IF ("%opcode%" = 71) // Sex change
  THEN BEGIN
  READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
  PATCH_IF ("%IDS_entry%" = 6)
  THEN BEGIN
  WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
  END
  END
    END
  END
  READ_SHORT 0x70 "global_fx_num" ELSE 0
  FOR (index = 0 ; index < global_fx_num ; index = index + 1) BEGIN
    READ_SHORT ("%fx_off%" + ("%index%" * 0x30)) "opcode"
    PATCH_IF (("%opcode%" = 219) // Attack roll penalty
  OR ("%opcode%" = 72) // Change AI type
  OR ("%opcode%" = 179) // Damage vs type bonus
  OR ("%opcode%" = 238) // Disintegrate
  OR ("%opcode%" = 175) // Hold creature
  OR ("%opcode%" = 185) // Hold creature 2
  OR ("%opcode%" = 248) // Melee hit effect
  OR ("%opcode%" = 109) // Paralyze
  OR ("%opcode%" = 100) // Protection from creature type
  OR ("%opcode%" = 249) // Ranged hit effect
  OR ("%opcode%" = 55) // Slay
  OR ("%opcode%" = 178) // THAC0 vs type bonus
  OR ("%opcode%" = 177) // Use EFF file
  OR ("%opcode%" = 283) // Use EFF file as curse
    ) THEN BEGIN
READ_LONG ("%fx_off%" + 0x08 + ("%index%" * 0x30)) "IDS_file"
READ_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
  WRITE_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) 20
END
    END ELSE
PATCH_IF ("%opcode%" = 71) // Sex change
THEN BEGIN
  READ_LONG ("%fx_off%" + 0x04 + ("%index2%" * 0x30)) "IDS_entry"
  PATCH_IF ("%IDS_entry%" = 6)
  THEN BEGIN
    WRITE_LONG ("%fx_off%" + 0x04 + ("%index2%" * 0x30)) 20
  END
END
  END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^.*\.ITM$~ ~override~
READ_LONG  0x64 "abil_off" ELSE 0
READ_SHORT 0x68 "abil_num" ELSE 0
READ_LONG  0x6a "fx_off"   ELSE 0
FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
READ_SHORT ("%abil_off%" + 0x1e + (0x38 * "%index%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x38 * "%index%")) "abil_fx_idx"
FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
READ_SHORT ("%fx_off%" + (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
PATCH_IF (("%opcode%" = 219) // Attack roll penalty
  OR ("%opcode%" = 72) // Change AI type
  OR ("%opcode%" = 179) // Damage vs type bonus
  OR ("%opcode%" = 238) // Disintegrate
  OR ("%opcode%" = 175) // Hold creature
  OR ("%opcode%" = 185) // Hold creature 2
  OR ("%opcode%" = 248) // Melee hit effect
  OR ("%opcode%" = 109) // Paralyze
  OR ("%opcode%" = 100) // Protection from creature type
  OR ("%opcode%" = 249) // Ranged hit effect
  OR ("%opcode%" = 55) // Slay
  OR ("%opcode%" = 178) // THAC0 vs type bonus
  OR ("%opcode%" = 177) // Use EFF file
  OR ("%opcode%" = 283) // Use EFF file as curse
) THEN BEGIN
READ_LONG ("%fx_off%" + 0x08 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_file"
READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
END
END ELSE
PATCH_IF ("%opcode%" = 71) // Sex change
THEN BEGIN
READ_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "IDS_entry"
PATCH_IF ("%IDS_entry%" = 6)
THEN BEGIN
WRITE_LONG ("%fx_off%" + 0x04 + (("%abil_fx_idx%" + "%index2%") * 0x30)) 20
END
END
END
END
  READ_SHORT 0x70 "global_fx_num" ELSE 0
  FOR (index = 0 ; index < global_fx_num ; index = index + 1) BEGIN
    READ_SHORT ("%fx_off%" + ("%index%" * 0x30)) "opcode"
    PATCH_IF (("%opcode%" = 219) // Attack roll penalty
  OR ("%opcode%" = 72) // Change AI type
  OR ("%opcode%" = 179) // Damage vs type bonus
  OR ("%opcode%" = 238) // Disintegrate
  OR ("%opcode%" = 175) // Hold creature
  OR ("%opcode%" = 185) // Hold creature 2
  OR ("%opcode%" = 248) // Melee hit effect
  OR ("%opcode%" = 109) // Paralyze
  OR ("%opcode%" = 100) // Protection from creature type
  OR ("%opcode%" = 249) // Ranged hit effect
  OR ("%opcode%" = 55) // Slay
  OR ("%opcode%" = 178) // THAC0 vs type bonus
  OR ("%opcode%" = 177) // Use EFF file
  OR ("%opcode%" = 283) // Use EFF file as curse
    ) THEN BEGIN
READ_LONG ("%fx_off%" + 0x08 + ("%index%" * 0x30)) "IDS_file"
READ_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) "IDS_entry"
PATCH_IF (("%IDS_file%" = 7) AND ("%IDS_entry%" = 6))  // if IDS target = "Gender.ids/SUMMONED"
THEN BEGIN
  WRITE_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) 20
END
    END ELSE
PATCH_IF ("%opcode%" = 71) // Sex change
THEN BEGIN
  READ_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) "IDS_entry"
  PATCH_IF ("%IDS_entry%" = 6)
  THEN BEGIN
    WRITE_LONG ("%fx_off%" + 0x04 + ("%index%" * 0x30)) 20
  END
END
  END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~kit.ids~ ~override~
REPLACE_TEXTUALLY ~0X401F~ ~0x401F~
BUT_ONLY_IF_IT_CHANGES
ACTION_IF NOT FILE_EXISTS ~override/ar2812.bcs~
THEN BEGIN
COPY ~d0tweak/d0tweak.bcs~ ~override/ar2812.bcs~
END
ACTION_IF FILE_EXISTS ~override/cm7000.bcs~
THEN BEGIN
EXTEND_TOP ~cm7000.bcs~ ~d0tweak/d0tweak.bcs~
END
COPY ~d0tweak/d0tweak.bcs~ ~override/rdog.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rdwarf.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/retter.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rgibbler.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rhalflin.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rhobgoba.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rhobgobf.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rkobold.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rogre.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rsiren.bcs~
COPY ~d0tweak/d0tweak.bcs~ ~override/rsirine.bcs~

COPY_EXISTING_REGEXP GLOB ~.*\.bcs~ ~override~
PATCH_SILENT
PATCH_IF (SOURCE_SIZE > 0) THEN BEGIN // protects against invalid files
DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~SUMMONED)~ ~20)~
REPLACE_TEXTUALLY ~\.SUMMONED\.~ ~.20.~
REPLACE_TEXTUALLY ~\.SUMMONED\]~ ~.20]~
COMPILE_BAF_TO_BCS
END
PATCH_VERBOSE
BUT_ONLY_IF_IT_CHANGES

END
END



LANGUAGE ~English~
         ~english~
         ~d0tweak/english/d0tweak.tra~
LANGUAGE ~French (by Raphaël Mizrahi)~
         ~french~
         ~d0tweak/english/d0tweak.tra~
         ~d0tweak/french/d0tweak.tra~
LANGUAGE ~Spanish (by Bhasbuto/Clan DLAN)~
         ~spanish~
         ~d0tweak/english/d0tweak.tra~
         ~d0tweak/spanish/d0tweak.tra~
LANGUAGE ~Polish (by Damian Staniszewski)~
         ~polish~
         ~d0tweak/english/d0tweak.tra~
         ~d0tweak/polish/d0tweak.tra~
LANGUAGE ~German (by Tanis Eichenblatt)~
         ~german~
         ~d0tweak/english/d0tweak.tra~
         ~d0tweak/german/d0tweak.tra~
LANGUAGE ~Japanese (by Kuroukume Velve)~
         ~japanese~
         ~d0tweak/english/d0tweak.tra~
         ~d0tweak/japanese/d0tweak.tra~

BEGIN @1

COPY ~d0tweak/goodberry/gberry2.itm~ ~override~
  SAY UNIDENTIFIED_DESC @2
COPY ~d0tweak/goodberry/gberry3.itm~ ~override~
  SAY UNIDENTIFIED_DESC @3
COPY ~d0tweak/goodberry/gberry4.itm~ ~override~
  SAY UNIDENTIFIED_DESC @4
COPY ~d0tweak/goodberry/gberry5.itm~ ~override~
  SAY UNIDENTIFIED_DESC @5
COPY ~d0tweak/goodberry/gberry6.itm~ ~override~
  SAY UNIDENTIFIED_DESC @6
COPY ~d0tweak/goodberry/gberry7.itm~ ~override~
  SAY UNIDENTIFIED_DESC @7
COPY ~d0tweak/goodberry/sppr207.spl~ ~override~
  SAY 0x50 @8

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

BEGIN @9

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

// 0x13 = LE, 0x33 = CE
COPY_EXISTING ~dempitsu.cre~ ~override~
              ~imp01.cre~ ~override~
              ~icsalfir.cre~ ~override~
  WRITE_BYTE 0x27b 0x13
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~demnabsu.cre~ ~override~
              ~demglasu.cre~ ~override~
              ~impqua01.cre~ ~override~
              ~obsdem01.cre~ ~override~
              ~obsdem02.cre~ ~override~ // Unused "Mane"
              ~obsdem04.cre~ ~override~
              ~obsdem05.cre~ ~override~ // Unused Nabassu
              ~abydem01.cre~ ~override~
  WRITE_BYTE 0x27b 0x33
BUT_ONLY_IF_IT_CHANGES

COMPILE ~d0tweak/demons~

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

BEGIN @10

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

// Correct Animations
// COPY_EXISTING ~sudemde1.cre~ ~override~
// WRITE_SHORT 0x28 4352
// COPY_EXISTING ~sudemde2.cre~ ~override~
// WRITE_SHORT 0x28 4352
COPY_EXISTING ~dempit01.cre~ ~override~
  WRITE_SHORT 0x28 32558
COPY_EXISTING ~jondem02.cre~ ~override~
  WRITE_SHORT 0x28 4352
COPY_EXISTING ~jondem04.cre~ ~override~
  WRITE_SHORT 0x28 4352
COPY_EXISTING ~obsdem04.cre~ ~override~
  WRITE_SHORT 0x28 57424 // Maurezhi = IC_LICHBLACK
ACTION_IF FILE_EXISTS ~data/25CreAni.bif~ // ToB Demons
THEN BEGIN
  COPY_EXISTING ~gordem.cre~ ~override~
    WRITE_SHORT 0x28 4352
  COPY_EXISTING ~demgla01.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~demglab.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~demglab2.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~demglasu.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~enddem01.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~enddem02.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~jondem01.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~jondem03.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~jondem05.cre~ ~override~
    WRITE_SHORT 0x28 57585
  COPY_EXISTING ~abisred1.cre~ ~override~
    WRITE_SHORT 0x28 57568
  COPY_EXISTING ~gordem.cre~ ~override~
    WRITE_SHORT 0x28 4352
  COPY_EXISTING ~telpit1.cre~ ~override~
    WRITE_SHORT 0x28 32558
  COPY_EXISTING ~telpit2.cre~ ~override~
    WRITE_SHORT 0x28 32558
  COPY_EXISTING ~gordem2.cre~ ~override~
    WRITE_SHORT 0x28 59648 // Velithuu = IC_SALAMANDER
  ACTION_IF FILE_EXISTS ~override/balth2.dlg~ // Ascension Demons
  THEN BEGIN
    COPY_EXISTING ~fincamb2.cre~ ~override~
      WRITE_SHORT 0x28 8960 // Cambion = IC_DEATH_KNIGHT
    COPY_EXISTING ~finnabas.cre~ ~override~
      WRITE_SHORT 0x28 4352
    // COPY_EXISTING ~finbabau.cre~ ~override~ // Babau = IC_LICHBLACK
  END
END

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

BEGIN @14

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

COPY_EXISTING ~SPWI402.SPL~ ~override/SPWI450.SPL~
COPY ~d0tweak/ddoor/D0SCRLDD.ITM~ ~override~

COPY_EXISTING ~scrolls.sto~ ~override~
  READ_LONG 0x34 "sale_offset"
  READ_LONG 0x38 "sale_num"
  READ_LONG 0x2C "item_offset"
  READ_LONG 0x4C "drink_offset"
  READ_LONG 0x70 "cure_offset"
  SET "orig_sale_num" = "%sale_num%"
  SET "ddoor_added" = 0
  SET "ddoor_insert" = 0
  SET "item_offset_patch" = 0
  SET "drink_offset_patch" = 0
  SET "cure_offset_patch" = 0
  WHILE ("%sale_num%" > 0) BEGIN
    READ_LONG ("%sale_offset%" +        (("%sale_num%" - 1) * 0x1C)) "item1"
    READ_LONG ("%sale_offset%" + 0x04 + (("%sale_num%" - 1) * 0x1C)) "item2"
    WHILE (("%item1%" = 0x4c524353) AND ("%item2%" = 0x00004232) AND ("%ddoor_insert%" = 0)) BEGIN // scrl2b
      SET "ddoor_insert" = "%sale_num%"
    END
  SET "sale_num" = ("%sale_num%" - 1)
  END
  WHILE (("%ddoor_added%" = 0) AND ("%ddoor_insert%" > 0)) BEGIN
    INSERT_BYTES ("%sale_offset%" + ("%ddoor_insert%" * 0x1C)) 28
    WRITE_ASCII ("%sale_offset%" +        ("%ddoor_insert%" * 0x1C)) ~D0SCRLDD~
    WRITE_LONG  ("%sale_offset%" + 0xa + ("%ddoor_insert%" * 0x1C)) 1 // stacks of 1
    WRITE_LONG  ("%sale_offset%" + 0x10 + ("%ddoor_insert%" * 0x1C)) 1 // identified
    WRITE_LONG  ("%sale_offset%" + 0x14 + ("%ddoor_insert%" * 0x1C)) 3 // quantity
    SET "ddoor_added" = 1
  END
  WRITE_LONG 0x38 ("%orig_sale_num%" + "%ddoor_added%")
  WHILE (("%ddoor_added%" = 1) AND ("%item_offset_patch%" = 0) AND NOT ("%item_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x2C ("%item_offset%" + 0x1C)
    SET "item_offset_patch" = 1
  END
  WHILE (("%ddoor_added%" = 1) AND ("%drink_offset_patch%" = 0) AND NOT ("%drink_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x4C ("%drink_offset%" + 0x1C)
    SET "drink_offset_patch" = 1
  END
  WHILE (("%ddoor_added%" = 1) AND ("%cure_offset_patch%" = 0) AND NOT ("%cure_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x70 ("%cure_offset%" + 0x1C)
    SET "cure_offset_patch" = 1
  END
BUT_ONLY_IF_IT_CHANGES

ACTION_IF FILE_EXISTS ~data/25Store.bif~
THEN BEGIN
COPY_EXISTING ~25spell.sto~ ~override~
              ~25spell2.sto~ ~override~
  READ_LONG 0x34 "sale_offset"
  READ_LONG 0x38 "sale_num"
  READ_LONG 0x2C "item_offset"
  READ_LONG 0x4C "drink_offset"
  READ_LONG 0x70 "cure_offset"
  SET "orig_sale_num" = "%sale_num%"
  SET "ddoor_added" = 0
  SET "ddoor_insert" = 0
  SET "item_offset_patch" = 0
  SET "drink_offset_patch" = 0
  SET "cure_offset_patch" = 0
  WHILE ("%sale_num%" > 0) BEGIN
    READ_LONG ("%sale_offset%" +        (("%sale_num%" - 1) * 0x1C)) "item1"
    READ_LONG ("%sale_offset%" + 0x04 + (("%sale_num%" - 1) * 0x1C)) "item2"
    WHILE (("%item1%" = 0x4c524353) AND ("%item2%" = 0x00004232) AND ("%ddoor_insert%" = 0)) BEGIN // scrl2b
      SET "ddoor_insert" = "%sale_num%"
    END
  SET "sale_num" = ("%sale_num%" - 1)
  END
  WHILE (("%ddoor_added%" = 0) AND ("%ddoor_insert%" > 0)) BEGIN
    INSERT_BYTES ("%sale_offset%" + ("%ddoor_insert%" * 0x1C)) 28
    WRITE_ASCII ("%sale_offset%" +        ("%ddoor_insert%" * 0x1C)) ~D0SCRLDD~
    WRITE_LONG  ("%sale_offset%" + 0xa + ("%ddoor_insert%" * 0x1C)) 1 // stacks of 1
    WRITE_LONG  ("%sale_offset%" + 0x10 + ("%ddoor_insert%" * 0x1C)) 1 // identified
    WRITE_LONG  ("%sale_offset%" + 0x14 + ("%ddoor_insert%" * 0x1C)) 4 // quantity
    SET "ddoor_added" = 1
  END
  WRITE_LONG 0x38 ("%orig_sale_num%" + "%ddoor_added%")
  WHILE (("%ddoor_added%" = 1) AND ("%item_offset_patch%" = 0) AND NOT ("%item_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x2C ("%item_offset%" + 0x1C)
    SET "item_offset_patch" = 1
  END
  WHILE (("%ddoor_added%" = 1) AND ("%drink_offset_patch%" = 0) AND NOT ("%drink_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x4C ("%drink_offset%" + 0x1C)
    SET "drink_offset_patch" = 1
  END
  WHILE (("%ddoor_added%" = 1) AND ("%cure_offset_patch%" = 0) AND NOT ("%cure_offset%" < "%sale_offset%")) BEGIN
    WRITE_LONG 0x70 ("%cure_offset%" + 0x1C)
    SET "cure_offset_patch" = 1
  END
BUT_ONLY_IF_IT_CHANGES
END

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

BEGIN @16

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

ACTION_IF FILE_EXISTS ~data/25Items.bif~
THEN BEGIN
COPY_EXISTING ~DEVA.ITM~ ~override/DEVA.ITM~
WRITE_BYTE 0x60 4
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~DEVAEVIL.ITM~ ~override/DEVAEVIL.ITM~
WRITE_BYTE 0x60 4
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~DEVMON01.ITM~ ~override/DEVMON01.ITM~
WRITE_BYTE 0x60 4
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~PLANETAR.ITM~ ~override/PLANETAR.ITM~
WRITE_BYTE 0x60 4
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
END

COPY_EXISTING ~SAREVO.ITM~ ~override/SAREVO.ITM~
WRITE_BYTE 0x60 3
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~BEARSPIR.ITM~ ~override/BEARSPIR.ITM~
WRITE_BYTE 0x60 2
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~LIONSPIR.ITM~ ~override/LIONSPIR.ITM~
WRITE_BYTE 0x60 2
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~SNAKSPIR.ITM~ ~override/SNAKSPIR.ITM~
WRITE_BYTE 0x60 2
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING ~WOLFSPIR.ITM~ ~override/WOLFSPIR.ITM~
WRITE_BYTE 0x60 2
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~AROW10.ITM~ ~override~
WRITE_LONG 0x60 4
READ_BYTE 0x18 "flags"
WRITE_BYTE 0x18 ("%flags%" BOR 0b01000000)
BUT_ONLY_IF_IT_CHANGES

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

BEGIN @17

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

COPY ~d0tweak/racial/haterace.2da~ ~override~
REPLACE 99999 @18
REPLACE 99998 @19
REPLACE 99997 @20
REPLACE 99996 @21
REPLACE 99995 @22
REPLACE 99994 @23
REPLACE 99993 @24

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

BEGIN @25

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

LAUNCH_ACTION_MACRO ~REMOVE_SUMMONING_CAP~

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

BEGIN @26

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

EXTEND_TOP ~baldur.bcs~ ~d0tweak/cfmod/cfmod.baf~
EXTEND_TOP ~baldur25.bcs~ ~d0tweak/cfmod/cfmod.baf~

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

BEGIN @27

DEPRECATED ~An updated version of this component is now incorporated into the BG2 Fixpack at http://www.gibberlings3.net/.~

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

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

BEGIN @32

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~
REQUIRE_PREDICATE FILE_EXISTS ~data/25CreAni.bif~ ~Skipping ToB-specific component.~

COPY_EXISTING ~botsmith.cre~ ~override~
WRITE_LONG 0x14 150
WRITE_SHORT 0x24 50
WRITE_SHORT 0x26 50
WRITE_BYTE 0x59 100
WRITE_BYTE 0x5a 100
WRITE_BYTE 0x5b 75
WRITE_BYTE 0x5c 0
WRITE_BYTE 0x5d 35
WRITE_BYTE 0x5e 100
WRITE_BYTE 0x5f 100
WRITE_BYTE 0x60 0
WRITE_BYTE 0x61 0
WRITE_BYTE 0x62 0
WRITE_BYTE 0x63 0
REPLACE_TEXTUALLY ~CLCK24~ ~CLCK25~
REPLACE_TEXTUALLY ~INVULNER~ ~D0NOTHIN~

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

BEGIN @33

DEPRECATED ~An updated version of this component is now incorporated into the AI Improvements component of Quest Pack at http://www.pocketplane.net/quest/.~

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

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

BEGIN @34

REQUIRE_PREDICATE FILE_EXISTS ~data/25CreAni.bif~ ~Skipping component requiring ToB.~

COPY ~d0tweak/ioun/d0io1.bam~ ~override~
     ~d0tweak/ioun/d0io2.bam~ ~override~
     ~d0tweak/ioun/d0io3.bam~ ~override~
     ~d0tweak/ioun/d0io4.bam~ ~override~
     ~d0tweak/ioun/d0io5.bam~ ~override~
     ~d0tweak/ioun/d0io6.bam~ ~override~
     ~d0tweak/ioun/d0io7.bam~ ~override~
     ~d0tweak/ioun/d0io8.bam~ ~override~
     ~d0tweak/ioun/d0io9.bam~ ~override~

COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io1.vvc~
WRITE_ASCII 0x8 "D0IO1"
WRITE_BYTE 0x1a 0x8
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io2.vvc~
WRITE_ASCII 0x8 "D0IO2"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io3.vvc~
WRITE_ASCII 0x8 "D0IO3"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io4.vvc~
WRITE_ASCII 0x8 "D0IO4"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io5.vvc~
WRITE_ASCII 0x8 "D0IO5"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io6.vvc~
WRITE_ASCII 0x8 "D0IO6"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io7.vvc~
WRITE_ASCII 0x8 "D0IO7"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io8.vvc~
WRITE_ASCII 0x8 "D0IO8"
COPY ~d0tweak/ioun/sporbit.vvc~ ~override/d0io9.vvc~
WRITE_ASCII 0x8 "D0IO9"

COPY_EXISTING ~helm18.itm~ ~override~
              ~helm25.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO6"

COPY_EXISTING ~helm20.itm~ ~override~
              ~helm34.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO4"

COPY_EXISTING ~helm23.itm~ ~override~
              ~helm27.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO3"

COPY_EXISTING ~helm26.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO5"

COPY_EXISTING ~helm24.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO1"

COPY_EXISTING ~helm19.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO7"

ACTION_IF FILE_EXISTS ~data/25Items.bif~
THEN BEGIN
COPY_EXISTING ~amsoul01.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO2"
END

ACTION_IF FILE_EXISTS ~override/CDIOUN1.itm~
THEN BEGIN
COPY_EXISTING ~CDIOUN1.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO8"
END

ACTION_IF FILE_EXISTS ~override/CDIOUN2.itm~
THEN BEGIN
COPY_EXISTING ~CDIOUN2.itm~ ~override~
READ_LONG 0x6a "effectsoffset"
READ_SHORT 0x70 "#effects"
WRITE_SHORT 0x70 ("%#effects%" + 1)
INSERT_BYTES "%effectsoffset%" 48
WRITE_SHORT "%effectsoffset%" 215
WRITE_BYTE ("%effectsoffset%" + 2) 1
WRITE_BYTE ("%effectsoffset%" + 8) 1
WRITE_BYTE ("%effectsoffset%" + 12) 2
WRITE_BYTE ("%effectsoffset%" + 18) 100
WRITE_ASCII ("%effectsoffset%" + 20) "D0IO9"
END

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

BEGIN @35

DEPRECATED ~An updated version of this component is now incorporated into the G3 Tweak Pack at http://www.gibberlings3.net/.~

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

BEGIN @36

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

COPY ~d0tweak/drow/KRDL1.BAM~ ~override~
     ~d0tweak/drow/KRDL1.vvc~ ~override~
     ~d0tweak/drow/KRGLOBD.BAM~ ~override~
     ~d0tweak/drow/KRGLOBD.vvc~ ~override~
     ~d0tweak/drow/KRGLOBD2.BAM~ ~override~
     ~d0tweak/drow/KRGLOBD2.vvc~ ~override~

COPY ~d0tweak/drow/KRIN400.SPL~ ~override~
  SAY 0x8 @37
  SAY 0x50 @38

COPY ~d0tweak/drow/KRIN401.SPL~ ~override~
  SAY 0x8 @39
  SAY 0x50 @40

COPY ~d0tweak/drow/KRIN402.SPL~ ~override~
  SAY 0x8 @41
  SAY 0x50 @42
  SAY 0xfe @43
  SAY 0x12e @44

COPY ~d0tweak/drow/KRIN403.SPL~ ~override~
  SAY 0x8 @45
  SAY 0x50 @46

EXTEND_TOP ~WTASIGHT.BCS~ ~d0tweak/drow/ET_WTA.BAF~
EXTEND_TOP ~WTARSGT.BCS~ ~d0tweak/drow/ET_WTA.BAF~
EXTEND_TOP ~WDASIGHT.BCS~ ~d0tweak/drow/ET_WTA.BAF~
EXTEND_TOP ~WDARSGT.BCS~ ~d0tweak/drow/ET_WTA.BAF~

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

BEGIN @47

DEPRECATED ~An updated version of this component is now incorporated into the Miscellaneous Enhancements component of Quest Pack at http://www.pocketplane.net/quest/.~

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

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

BEGIN @50

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

COPY_EXISTING ~QUAYLEM.CRE~ ~override/QUAYLEM.CRE~
WRITE_ASCII ~0x34~ ~D0Nothin~
WRITE_ASCII ~0x3c~ ~D0Nothin~

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

BEGIN @51

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

COPY_EXISTING ~AR0011.ARE~ ~override~
  ~AR0013.ARE~ ~override~
  ~AR0084.ARE~ ~override~
  ~AR0085.ARE~ ~override~
  ~AR0086.ARE~ ~override~
READ_BYTE 0x14 "flags"
WRITE_BYTE 0x14 ("%flags%" BOR 0b00001000)
BUT_ONLY_IF_IT_CHANGES

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

BEGIN @52

COPY ~d0tweak/lore~ ~override~

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

BEGIN @53

COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
  READ_SHORT 0x1c "itemtype"
  SPRINT itemtypestring ~%itemtype%~

  PATCH_IF FILE_CONTAINS_EVALUATED (~d0tweak/backstab.txt~ ~^%itemtypestring% ~) THEN BEGIN
READ_LONG 0x64 ext_off
READ_SHORT 0x68 ext_count
READ_SHORT 0x6e eq_eff_indx
    READ_SHORT 0x70 "#effects"
    READ_LONG 0x6a "effectsoffset"
    WRITE_SHORT 0x70 ("%#effects%" + 1)
    effectsoffset += eq_eff_indx * 0x30 // maybe an extended header's effects are before the equipped ones...
    INSERT_BYTES "%effectsoffset%" 48
    WRITE_SHORT "%effectsoffset%" 263
    WRITE_BYTE ("%effectsoffset%" + 2) 1
    WRITE_BYTE ("%effectsoffset%" + 12) 2
    WRITE_BYTE ("%effectsoffset%" + 18) 100

// update extended headers' effects index table
    FOR (ext_cyc = 0; ext_cyc < ext_count; ext_cyc += 1) BEGIN
      READ_SHORT (ext_off + (ext_cyc * 0x38) + 0x20) ext_eff_idx
  PATCH_IF (ext_eff_idx > eq_eff_indx) BEGIN
     WRITE_SHORT (ext_off + (ext_cyc * 0x38) + 0x20) ext_eff_idx + 1
  END
    END

    // read the penalty from the file
    INNER_PATCH_FILE ~d0tweak/backstab.txt~ BEGIN
      SET thisline = 999
      FOR (i = 0; thisline != itemtype; i+=1) BEGIN
        READ_2DA_ENTRY i 0 1 thisline
      END
      i -= 1
      READ_2DA_ENTRY i 1 1 penalty
    END // INNER_PATCH_FILE

PATCH_IF itemtype = 20 BEGIN
      READ_SHORT 0x31 "proficiency"
  PATCH_IF proficiency = 93 BEGIN
    SET penalty = 3
  END
END

    WRITE_LONG ("%effectsoffset%" + 4) 0 - penalty
  END // PATCH_IF the itemtype is in the list
END // PATCH_IF SOURCE_SIZE is good
BUT_ONLY_IF_IT_CHANGES

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

BEGIN @59
SUBCOMPONENT @55
OUTER_SET "install_mode" = 1
INCLUDE ~d0tweak/functions/npctraps.tph~

BEGIN @60
SUBCOMPONENT @55
OUTER_SET "install_mode" = 2
INCLUDE ~d0tweak/functions/npctraps.tph~

BEGIN @61
SUBCOMPONENT @55
OUTER_SET "install_mode" = 3
INCLUDE ~d0tweak/functions/npctraps.tph~

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

BEGIN @56

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

DEPRECATED ~An updated version of this component is now incorporated into the G3 Tweak Pack at http://www.gibberlings3.net/.~

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

BEGIN @58

REQUIRE_PREDICATE NOT FILE_EXISTS ~override/fw2600.are~ ~Skipping Tutu-incompatible component.~

LAUNCH_ACTION_MACRO ~REMOVE_SUMMONING_CAP~

COPY ~d0tweak/summons/Copy~ ~override~

COPY ~d0tweak/summons/SPWI309.SPL~ ~override/SPWI309.SPL~
  SAY 0x50 @2201

COPY ~d0tweak/summons/SPWI504.SPL~ ~override/SPWI504.SPL~
  SAY 0x50 @2202

COPY ~d0tweak/summons/SPWI407.SPL~ ~override/SPWI407.SPL~
  SAY 0x50 @2203

COPY ~d0tweak/summons/SPPR402.SPL~ ~override/SPPR402.SPL~
     ~d0tweak/summons/SPRA304.SPL~ ~override/SPRA304.SPL~
  SAY 0x50 @2204

COPY ~d0tweak/summons/SPPR501.SPL~ ~override/SPPR501.SPL~
     ~d0tweak/summons/SPRA305.SPL~ ~override/SPRA305.SPL~
  SAY 0x50 @2205

COPY ~d0tweak/summons/SPPR602.SPL~ ~override/SPPR602.SPL~
     ~d0tweak/summons/SPRA306.SPL~ ~override/SPRA306.SPL~
  SAY 0x50 @2217

COPY ~d0tweak/summons/SPWI501.SPL~ ~override/SPWI501.SPL~
  SAY 0x50 @2206

COPY ~d0tweak/summons/SPPR301.SPL~ ~override/SPPR301.SPL~
  SAY 0x50 @2207

COPY_EXISTING ~scrl2d.itm~ ~override~
SAY 0x54 @2206
COPY_EXISTING ~scrl2g.itm~ ~override~
SAY 0x54 @2202
COPY_EXISTING ~scrl2a.itm~ ~override~
SAY 0x54 @2203
COPY_EXISTING ~scrl1l.itm~ ~override~
SAY 0x54 @2201

COPY_EXISTING ~SKELWASU.CRE~ ~override~
WRITE_LONG 0x14 1150
WRITE_BYTE 0x272 115
WRITE_ASCII 0x248 "GMINIONM"

COPY ~d0tweak/summons/newcres~ ~override~

COPY ~d0tweak/summons/skeletons~ ~override~
  SAY NAME1 @2208
  SAY NAME2 @2208
  SAY BATTLE_CRY1 @2209
  SAY BATTLE_CRY2 @2209
  SAY BATTLE_CRY3 @2209
  SAY BATTLE_CRY4 @2209
  SAY BATTLE_CRY5 @2209
  SAY ATTACK1 @2210
  SAY ATTACK2 @2211
  SAY ATTACK3 @2212
  SAY DAMAGE @2213
  SAY DYING @2214
  SAY SELECT_COMMON1 @2215
  SAY SELECT_COMMON2 @2216

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

/* BEGIN @57

COPY_EXISTING ~imoen2j.dlg~ ~override~
  READ_LONG 0x8 "#states"
  PATCH_IF ("%#states%" > 0) BEGIN
    INNER_ACTION BEGIN
  COPY_EXISTING ~d0tweak/imoen/contimoen.d~ ~d0tweak/imoen/contimoen.d~
    FOR (int i = 0; i < "%#states%"; i++) BEGIN
  REPLACE_TEXTUALLY ~ADD_STATE_TRIGGER IMOEN2J~ ~ADD_STATE_TRIGGER IMOEN2J %i%~
    END
  COMPILE ~d0tweak/imoen/contimoen.d~
    END
DECOMPILE_DLG_TO_D
  INNER_ACTION BEGIN
    COPY_EXISTING ~imoenj.dlg~ ~override~
  DECOMPILE_DLG_TO_D
    APPEND_FILE ~imoen2j.dlg.d~
REPLACE_TEXTUALLY ~BEGIN IMOEN2J.*~ ~~
  COMPILE_D_TO_DLG
    BUT_ONLY_IF_IT_CHANGES
  END
COMPILE_D_TO_DLG
BUT_ONLY_IF_IT_CHANGES */

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: Ding0's Tweak Pack
« Reply #71 on: February 13, 2009, 12:56:32 AM »
Looks like another competent modder joined the scene. Welcome!

(I'm saying competent, because I don't understand what the file means - which automatically makes anyone who does understand a more clever person than me).

Offline Drelnza

  • Planewalker
  • *****
  • Posts: 10
Re: Ding0's Tweak Pack
« Reply #72 on: April 11, 2010, 07:21:41 AM »
Thanks rhomboidspace, I am going to try and install the summoning cap removal despite the reports of it being buggy....

Offline Angel

  • Planewalker
  • *****
  • Posts: 138
Re: Ding0's Tweak Pack
« Reply #73 on: February 22, 2015, 10:36:58 AM »
D0Tweak v22 is now available from PPG at http://pocketplane.net/sim/.

Offline Salk

  • Planewalker
  • *****
  • Posts: 873
Re: Ding0's Tweak Pack
« Reply #74 on: July 23, 2015, 02:15:08 AM »
Angel,

does my beloved component "Summon set off traps" exclude flying creatures?

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: