Jump to content

CamDawg

Gibberling Poobah
  • Posts

    12,018
  • Joined

Posts posted by CamDawg

  1. 25 minutes ago, jastey said:

    Using the tweak means that Breagar can't use his own axe granted by (spoiler) for some time along the storyline, though - his one hand is insured due to story design.

    Ah, that throws a wrench in things. I can either adjust the tweak to ignore these axes, or generate them but then make the two-handers unusable by Breagar.

    26 minutes ago, jastey said:

    in ACCUT_14.baf should take the existing axe (assuming it's "ACAXE2" from the mod) and replace it with "ACAXE3". If Breagar now has ""c!ax44" instead of "ACAXE2", and you inserted a DestroyItem for that one, the new replacement axe will not be created.

    TakeItemReplace always creates the item. So if Breagar has c!ax44, it'll get destroyed by the explicit DestroyItem action, and then acaxe3 will be generated by the TIR even though acaxe2 doesn't exist.

    28 minutes ago, jastey said:

    Can someone explain why making item changes by making new, differently called items is a preferable way to go? It will break any kind of item check where an axe is supposed to be recognized. You wrote the engine doesn#t allow for changeable items, I don't understand what this means. Maybe this tweak is just not such a good idea?

    It's no so much as the preferred method as it is the only method available.

    There's no way to make, say, ax1h01.itm be both a one-handed and two-handed axe, as it's a basic item flag that can't be changed via script or opcode. Tweaks ships with a list of known axes and designates known alternatives so if you really need to check for, say, Bala's Axe, you have to check for ax1h07, c!ax4, and cdax4. Two-handed bastard swords and katanas have their own lists, as does the PnP restrictions version of Wear Multiple Protection Items. If they're not on the known list, they get assigned the next available number, and the lists are stored locally in weidu_external/cdtweaks/2da.

    Yes, this is a colossal PITA--I had to account for all of these alternatives in Item Upgrade--but there's no other way to do it.

  2. Yeah, the engine doesn't allow for changeable items, so the various Two-Handed X components work by creating clones of existing items. That means that triggers that look for an item also have to look for the clone(s) created by this component--e.g. I had to account for all of the alternates in Item Upgrade, which was a bit of a pain.

    So, two changes: Tweaks generates these file names on the fly, but does come preloaded with a small set of items so that they get consistent, fixed file names. Tweaks will do this for Breagor's axes as of the next version.

    Second, I've sent a pull request to @jastey with the necessary changes on Breagar's end.

  3. The Gibberlings Three

    The Tweaks Anthology is a WeiDU compilation of nearly 200 components of cosmetic changes, house rules, and other tweaks. Some of these were fan requests, others are needed changes, and others simply make dealing with the more irritating aspects of the game engine easier. Each component can be installed separately so the player can pick and choose only which ones they wish to install.

    Version 16 features one new component, updated French and Russian translations, and a mess of bugfixes.

  4. The Tweaks Anthology is a WeiDU compilation of nearly 200 components of cosmetic changes, house rules, and other tweaks. Some of these were fan requests, others are needed changes, and others simply make dealing with the more irritating aspects of the game engine easier. Each component can be installed separately so the player can pick and choose only which ones they wish to install.

    Version 16 features one new component, updated French and Russian translations, and a mess of bugfixes.

    New Components in v16:

    Make Certain Creatures Immune to Backstab/Sneak Attack [Luke]
    BGEE, BG2(EE), BGT, EET, Tutu, IWDEE, oIWD (requires HoW or TotLM), IWD2

    Technically speaking, a rogue can backstab / sneak attack only living creatures with discernible anatomies. As a result, this component makes sure all those creatures that lack vital areas to attack are immune to backstabs / sneak attacks. This includes the following creatures:

    • Undead
    • Plants
    • Oozes
    • Constructs (all but Flesh Golems)
    • Incorporeal creatures that are not undead (Nishruu, Hakeashar, Mist Horror, Poison Mist, etc.)
    • Demonic creatures
    • Elementals (includes Salamanders)
    • Beholders (due to their 360 degree vision)
    • Celestials (devas, planetars, solars, etc.)
    • Dragons (due to their enhanced senses)
    • Animated weapons (Mordenkainen's Sword)

    Complete Version 16 Changelog

    "My story is a lot like yours, only more interesting ‘cause it involves robots."

    • Added the Make Certain Creatures Immune to Backstab/Sneak Attack [Luke] component, courtesy of Luke
    • Remove Helmet Animations was not removing helmets for clerics on EE games
    • Realized that Thieves Can Backstab With More Weapons With "Use Any Item" would also apply to dual- and multi-class thieves, so the component was made available on more games and renamed Thieves Can Backstab With More Weapons With "Use Any Item" or as Dual- and Multi-Classes
    • Updated the Russian and French translations
    • NPCs Don't Fight stops the Korgan-Aerie fight by blocking the entire series of banters that leads to the confrontation. The component now only blocks the final banter that forces the split.
    • Updated Unique Icons [Lava] and Unique Containers [Miloch] to account for a few more mod versions of items
    • Increase Party Movement Speed and/or Casting Speed Outside of Combat [argent77] will now provide a name/description for these abilities; the portrait icon associated with this will now more accurately reflect the player's selection
    • Add Bags of Holding added a Bag of Holding to Ribald, but this was not mentioned in the docs. The two variants of Unique Icons [Lava] are also better delineated.
    • Change Jaheira to Neutral Good Alignment could throw a warning due to an old GAME_IS check
    • Components which update item descriptions (e.g. the Two-Handed X components) would try to update a description if the item had a string reference in a valid range without checking to see if the string actually existed in the tlk table. This resulted in items getting descriptions of ''. These fields are no longer altered unless both the string reference and string contents are valid.
    • Under-Represented Items and Item Upgrade items have been added to the static item lists for the Two-Handed X components and the PnP restrictions variant of Wear Multiple Protection Items
    • A number of components had minor issues on oIWD games, due to not the slightly different file formats: the Two-Handed X components, Increase Jewelry, Gem, and Miscellaneous Item Stacks, Increase Scroll Stacking, and the PnP restrictions variant of Wear Multiple Protection Items
    • Fixed a bug where needed variables would not be set in passive install scenarios (Tweaks gets automatically reinstalled because a mod earlier in the order gets updated/removed), causing Tweaks components to fail to re-install
    • Fixed bug with Everyone Gets Bonus APR from Specialization [subtledoctor] where it could grant an erroneous half-attack for characters when imported between games, notably from BG to BG2
    • Compatibility fixes for Auril's Bane 1.7. This mod ships with a number of mis-indexed and/or broken files which can cause various Tweaks components to fail. If AB is detected, Tweaks will silently fix these issues.
    • Another round of fixes for Send BioWare NPCs to an Inn. Specifically, Neera and Rasaad could still leave for their normal locations if More Interjections was installed. Also, the option to send Neera to the FAI would sometimes do nothing.
  5. On 9/9/2022 at 4:10 AM, argent77 said:

    [BG2EE] One of the Frost Salamanders in Abazigal's Hideout (AR6005) is on impassable terrain

    On 9/15/2022 at 8:54 AM, argent77 said:

    [PsTEE] Map AR0902: Anarchist (actor #5) at position [802.218] is on impassable terrain
    Could be intentional. Scripting is not negatively affected by her position.

    [SoD] Map BD0020: Noblewoman (actor #122) at position [1843.188] is placed outside of map range

    [SoD] Map BD5000: Ogre (actor #7) at position [3953.2018] is on impassable terrain

    [BG2EE] Map AR0305: Shadow Thief (actor #4) at position [398.527] is on impassable terrain

    [BG2EE] Map AR2000: The gypsy Kveroslava (actor #88) at position [1060.3033] is on impassable terrain

    [BG2EE] Map AR5202: Skeleton Cleric (actor #1) at position [878.882] is on impassable terrain

    [BG2EE] Map OH5500: Crusader (actor #6) at position [1021.2607] is on impassable terrain
    [BG2EE] Map OH5500: Celestial Hound (actor #21) at position [2552.2880] is on impassable terrain

    [BG2EE] Map OH7100: Yi Niu (actor #21) at position [1412.888] is on impassable terrain
    Could be a false positive. The creature is initially disabled, so I couldn't verify it in a quick test.

    Minus the oh7100 creature (which is disabled, and doesn't seem to get activated) these are all fixed.

  6. Tweaks does it:

     
      COPY_EXISTING_REGEXP GLOB ~^.+\.bcs$~ ~override~
        DECOMPILE_AND_PATCH BEGIN
          PATCH_PHP_EACH cd_stackables AS item => stack BEGIN
            PATCH_IF stack < 2 BEGIN
              REPLACE_TEXTUALLY ~TakePartyItem("%item%")~ ~TakePartyItemNum("%item%",1)~
            END  
          END
        END
        BUT_ONLY IF ~116OB~

    The key bit is the IF ~116OB~ in the closing predicate. The action I'm looking for is 116 and (for whatever reason) that's always followed by OB in a compiled script. In NI, you can view the 'script code' tab to try and find something there to use as a key.

    edit: looks like triggers are the trigger's decimal value and always at the beginning of a line, so IF ~^16399~ would work for something like a Global() trigger.

  7. This came up while troubleshooting some Tweaks stuff. Two minor items:

    • In the Hall of Heroes (ar6006) two containers are on top of one another (labeled as containers 4 and 9). One contains the Blessed Helm of Lathander, and the other contains a Potion of Insulation and a Spell Thrust scroll.
    • Both the Hall of Heroes and the Tiers of the Dead (ar6005) contain the same random treasure (rndtre57, ud5tres in the original). This resolves to one of three items: Short Sword of Shadows +3 (uSswd4a), Bastard Sword +2: Conflagration (uBswd4c), or Hold Fast +3 (uLswd4a).

    For the former, I suggest we disable one container and combine the loot into the other. Alternatively, we can move one of them to cover a different tomb.

    The latter is one of those that I think is a bug, but the fix can go a number of ways. We can simply delete one instance (which one?) or substitute it (with what?). And while the u-items aren't strictly unique, potentially getting one of those items in consecutive areas feels very weird, especially since it's a good chance (33%) since it's a small random drop.

  8. Nope. Long explanation follows, but the tl;dr is that the oBG and BG2/EE proficiency systems co-exist just fine. What all of the various flavors of Alter Weapon Proficiency do is alter the BG2/EE system to the desired end without touching the underlying oBG system.

    Creatures have two sources for weapon proficiencies. There are old BG profs, which are set int he creature file (0x6e - 0x75) and tied to a weapon's item type (0x1c). This was the system for oBG, and still works in oBG2 and the EEs, and remains the main method that non-joinable NPCs and monsters set proficiencies. The BG2/EE system is a series of opcode 233s attached to a creature file, and tied to the proficiency field (0x31) of an item. When you select pips for a party member or your PC, this is what it's using. Non-joinable NPCs can use the BG2 system as well, though the majority use the oBG system.

    Alter Weapon Proficiencies (all flavors) exclusively alter the oBG2/EE system. Item types aren't changed, nor does it mess with the oBG prof fields on creatures, so the underlying oBG system remains unchanged. When you choose the BG option, what it's doing is converting the BG2/EE system to emulate the BG system, so you essentially have the original oBG system, plus the BG2/EE system altered to look like the BG system. Under the hood it's still using op233 against weapon proficiency fields, but it's changed the name of the profs and changed the proficiency of items to match the new scheme. Creatures with existing pips (existing op233s) also get mapped to the new system, as outlined above.

  9. On 8/31/2022 at 5:15 AM, argent77 said:

    [BG2EE] First Pocket Plane challenge: Summoned creatures should not drop items

    Some of the summoned creatures have items equipped that are not flagged as "undroppable". As a result they will drop lots of bows and swords. Some of the droppable items aren't even needed, since they only exist in inventory slots.

    Affected creatures:
    CHEVIL01.CRE: BOW05.ITM (inventory slot)
    CHEVIL03.CRE: SW1H01.ITM (inventory slot)
    CHGOOD04.CRE: SW1H05.ITM (equipped)
    CHGOOD05.CRE: SW1H05.ITM (equipped)

    chevil01 is definitely wrong, as this is a bug inherited from 1pp. Since kobolds don't have a shortbow animation, it moves the existing short bow to inventory (losing the undroppable flag in the process) and equips an undroppable dupe with a longbow animation. The same is true for chevil03's bastard sword (ogre mages only have a long sword animation) except that in this case the original bastard sword was droppable.

    chevil01 needs a fix, and I'm inclined to make the rest undroppable as well. As polytope says, this isn't a farmable exploit, and getting a pile of +1 long swords and bastard swords in ToB is not moving the needle on anything. However, the overall consistency of undroppable flags on the other creatures in the series suggests this was an oversight.

  10. On 8/29/2022 at 12:08 PM, argent77 said:

    [BG2EE] Hell Trials map (AR2900): Visual effect of closing the eyes of the tear door has black outlines and is misaligned

    On 8/30/2022 at 5:16 AM, argent77 said:

    [BG2EE] Hexxat quest: Visual effect on Graveyard map has black outlines

    These are both fixed (commit, commit). For the former, I made one additional cosmetic tweak--the main door blocks line of sight to the topmost eye, so unless you place your party members in very specific locations crowding the door you'd never see the animation. Since there's nothing actually behind it, I've enabled LoS through the door to make the animation more visible.

  11. Fixed in two commits, here and here. Running notes as I do these:

    IWDEE

    • EETPLDOR.BCS (door script) - would remain true infinitely, but harmless as it was only one block of script. Converted to MYAREA.
    • D4DOORT.BCS, D4DOORG.BCS, D4GELDOR.BCS (door scripts) - Scripts to open the doors in the Eldathyn section (level 4 of Dragon's Eye). Once the alarm was sounded, the scripts would open these doors instantly if closed. Scripts amended; door opening handled by area script.
    • D5DOOR.BCS, D5YXUDOR.BCS (door script) - Scripts to open doors once Yxunomei attacks. Like the Eldathyn area, these doors would open instantly if closed after she attacked, and is also handled by the area script. D5YXUDOR.BCS was previously fixed as part of this.
    • 5104D3.BCS (door script) - should open a door five seconds after entry, but door was opening instantly. LOCALS timer converted to MYAREA.
    • UDTRAP1.BCS (region script) - Harmless; would infinitely loop trying to set a variable. Converted to MYAREA
    • WTBRIDGE.BCS (region script) - Warning about broken bridge at aquarium; should only fire once per area visit/reload, but fired every time the region was entered
    • LDEYETP1.BCS (region script), LDEYETP2.BCS (region script) - Petrification traps in Malavon's lair that should only fire once, but would fire infinitely
    • LDBDGOPN.BCS (door script) - would infinitely loop opening itself; changed to MYAREA

    BGEE

    • BDMENHI1.BCS, BDMENHI4.BCS (region script) - Fixed already as part of the Menhir quest fixes
    • NETRIG1.BCS (region script) - Non-working check of a non-existent variable for dialogue prompt; converted to check for valid dialogue conditions instead

    BG2EE

    • OHBPOT.BCS (container script) - Wasn't working, and disabled by EEFP. The pots were supposed to hand out an item for cooking myconid, but this is handled via dialogue elsewhere (and the item being rewarded via this script is a placeholder).

    PSTEE:

    • 1204TRIG.BCS (region script) - Was trying to set a debug LOCALS var. Removed.
  12. 41 minutes ago, ahungry said:

    The other neat thing with having the data in a database, I can check for duplicate strrefs for item descriptions/names etc. in a similar way as querying my dialog.tlk table.

    There are some hidden pitfalls here. In oBG2, scook.cre uses strref #12895 ("Cook") as her name and 12889 ("Cook") as her tooltip. In BG2EE, she uses 12895 (still "Cook") for both, and 12889 (also still "Cook") is used as both name and tooltip for ohdhcook.cre. This is one of the times we made a change to game files for gendered language translations, because the latter is a male cook. We simply repurposed the redundant string--e.g. in Polish, 12889 is "Kucharz" and 12895 is "Kucharka".

     

  13. 45 minutes ago, jmerry said:

    I've also had an idea - we really need a tool that systematically looks up where a string is referenced in the game files. That would let us automate the first two steps, leading to a much more manageable project that has more of a chance of actually getting done. I call this tool SULU (String Usage Lookup Utility). I ... might be able to write it. In theory, it would take a list of numbers as input and give a (tab-delimited text?) list of places those numbers are referenced.

    NI's string lookup tool is excellent, but it lacks is a way to do it en masse and report.

    To the broader question, I'd like to circle back to the original EEFP structure. (I'd like to make a quick aside here: I'm speaking personally, not declaring this as official.) Remember that when I coded up the string fixes--both in the mainline component, and the optional GTUs--I made the languages independent from one another. This is primarily because I know there are issues in one language that don't occur in others and, more to the point, I wanted to defer these decisions to the same translation teams and communities that led the original projects.

    With that in mind, the primary question instead shifts to whether the French players want these changes. If the French version wants to synchronize these strings in the GTU--as apparently the Polish team did, from Cahir's post--I don't have an opinion on it, and the discussion should be held by and with the French players. Whether these changes constitute a fix and should be included in the in the core French fixes component is a tougher discussion, but I'm again comfortable deferring to the French players. Since the Polish community already did this, Cahir or one of the other Polish translators may be able to give you a better framework on the pros and cons of a synchronization approach for discussion.

    The natural followup questions are whether we would want synchronization within the other translations. From the comments I've seen on the thread so far, it looks like the answer is leaning towards no for English at least, unless we're talking about material differences. If the Polish or Russian or whatever versions want to synchronize is, again, something I'd defer to the respective players and translators.

  14. Calin uses this Blade Master kit from the SP Collection:

    Quote

     

    BLADE MASTER: The Blade Master uses one-handed bladed weapons, but he can do many things with them that the regular fighter cannot. He gains many special abilities using his blades, but he can only wear very light armor. Only one innate ability may be active at any given moment.

    Advantages:
    - +2 to dexterity
    - +10% to slashing and piercing resistance
    - Gains Precision Strike ability at levels 4, 7 and 22. Grants a +3 THAC0 bonus for three rounds, does 1d10 damage to target, and has a 25% chance to stun target.
    - Gains Parry ability at levels 7, 10 and 22. Parry grants virtual immunity to physical attacks for two rounds.
    - Gains Counter Attack ability at levels 10, 13 and 22. Grants virtual immunity to physical attacks for one round and does 2d10 of damage to attacker.
    - Gains Disarm ability at levels 13, 16 and 22. Has a 50% chance to make opponent drop their weapon.
    - Gains Feint ability at levels 16, 19 and 22. Feint grants Invisibility and Non-Detection for one round.
    - Gains Swift Strike ability at levels 19 and 22. Decreases weapon speed by 2, adds an extra attack, a +5 THAC0 bonus and a -2 Armor Class penalty for two rounds.
    - Gains extra one-half attack at levels 11, 15 and 19

    Disadvantages:
    - Penalty of -2 to strength
    - Can only wear armor up to Studded Leather
    - Cannot have proficiency in any non-bladed weapon

     

     

  15. The Gibberlings Three

    Like its predecessors for Baldur's Gate and Baldur's Gate II, Unfinished Business for Icewind Dale aims to restore content and quests that were omitted from the game as shipped. The additional content in this mod is based on what I can piece together from various game resources and from talking with former developer JE Sawyer on the Obsidian forums. Later, through my work with Beamdog, I was able to secure some of the original quest design notes and further refine the restorations. Version 10 features a new component for the Vale of Shadows--credit for spotting and restoring this goes to Graion Dilach.

     

  16. Like its predecessors for Baldur's Gate and Baldur's Gate II, Unfinished Business for Icewind Dale aims to restore content and quests that were omitted from the game as shipped. The additional content in this mod is based on what I can piece together from various game resources and from talking with former developer JE Sawyer on the Obsidian forums. Later, through my work with Beamdog, I was able to secure some of the original quest design notes and further refine the restorations. Version 10 features a new component for the Vale of Shadows--credit for spotting and restoring this goes to @Graion Dilach.

    v10 Changelog

    • Added the Actual Shadows in Vale of Shadows [Graion Dilach]; credit for spotting and restoring this goes to Graion Dilach, Cheers!
    • Updated a lot of code behind the scenes; name updating the translation scheme to be a little more modern as well as making the mod more portable

    v11 Changelog

    • Updated the Brazilian Portuguese translation. Thanks Felipe!
  17. A brief overview

    There are any number of items and spell that reverse adverse conditions: antidote potions to cure poison, restoration to reverse level drain, free action to counter hold, etc. These work on the major effects (and their portrait icons) but they're not always consistent on cleaning up ancillary effects such as visuals or expiration sounds. A well-known example of this is Horror, which (in addition to a fear effect) plays a spinning animation over the creatures panicking. Curing the fear removes the fear, but doesn't clear the spinny animation. The EEs addressed this in an ad hoc fashion by adding effects (opcode 321) to outright remove all effects of the Horror spell when fear is cured. While this does effectively end the animation, it's a bit cumbersome and not very extensible.

    Using 321s against lingering effects works, but decentralizing them to every item that reverses an effect is a recipe for future bugs--any mod that adds something that cures fear would have to determine which items and spells need 321s, or update every item that cures fear to account for their new fear-inducing item. Imagine iterating this through several mods, and you can see there's phenomenal potential to get things (lots of things) wrong.

    (As an aside, if you're looking at ways to properly prevent or provide immunity to effects, there's already a tutorial for that.)

    Enter the EE Fixpack

    EEFP introduces a series of subspells, each one dedicated to reversing a specific effect:

    • #cureber.spl - Berserk
    • #curebld.spl - Blind
    • #curecon.spl - Confusion
    • #curedef.spl - Deafness
    • #curedis.spl - Disease
    • #curedrk.spl - Drunkenness
    • #curefer.spl - Fear
    • #curefbm.spl - Feeblemind
    • #curehol.spl - Hold
    • #cureinv.spl - Invisibility
    • #cureldr.spl - Level Drain
    • #curendt.spl - Non-Detection
    • #curepse.spl - Pause Caster
    • #curepsn.spl - Poison
    • #curesil.spl - Silence
    • #cureslp.spl - Sleep
    • #curestn.spl - Stun

    The list was built to be thorough so not everything is really useful--e.g. modders shouldn't be curing Caster Pause, and nearly every level drain is permanent without time-limited effects--but they're made available for completeness. Every one of these cure spells will, at a minimum, cure the main effect, remove its normally associated icons via op 240, and add 321s as relevant. For example, the fear cure (#curefer) cures fear via opcode 161, removes the panic (36) portrait icon, and then has a series of 321s to remove all effects from some spells, e.g. Horror is removed via 321 to get rid of the spinny head animation.

    The idea is that something that cures fear will apply #curefer via opcode 146 instead of directly curing it with opcode 161. This gives a centralized resource for addressing fear that any mod can tap into.

    Modders need to be aware of this on both ends. A new item/spell that cures fear should cast #curefer instead of using opcode 161. An item/spell that causes fear may need to be added to the list of 321s in #curefer. It's important to note that anything which causes fear does not necessarily need to be added: if you add a sword that causes panic on its target and shows a portrait icon, there's no need to add it since these are already covered by ops 161 and 240. If the sword plays a visual effect that lasts with the fear, or an expiration sound, or some other effect like a THAC0 penalty from the fear, then it needs to be added so that those effects also go away when the fear is cured. Short-term or instant effects (like a two-second visual or brief sound effect to show the target has been panicked) don't necessitate coverage in a #curefer 321.

    Some practical examples from Item Upgrade (IU)

    Let's first look at some items which cause reversible effects. IU adds Teleomortis (c2bow01.itm), a bow that causes confusion on hit. If the bow only caused confusion with a portrait icon, there would be no need to add it to #curecon. However, because it plays an animation to accompany the confusion, a 321 is needed--otherwise the confusion could be cured, but the animation would continue to play for the original confusion duration. The code is simple enough:

    COPY_EXISTING ~#curecon.spl~ ~override~ // if using EEFP's cure spell setup, have it also cure confusion from teleomortis
      LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 2 timing = 1 parameter2 = 2 STR_VAR resource = c2bow01 END
      BUT_ONLY IF_EXISTS

    The 321 targets the item (c2bow01.itm). The IF_EXISTS clause covers games without EEFP, so this can be added without additional checks such as FILE_EXISTS or MOD_IS_INSTALLED.

    Item Upgrade also adds an updated Celestial Fury, which can stun its target. In this case, we don't have to patch #curestn because the upgraded weapon causes stun, a portrait icon, and combat feedback of 'Stunned'. With no lingering effects or expiration audio, there's nothing that needs to be removed aside from the stun itself and the portrait icon, which are handled directly by #curestn.

    On the other side we have an updated version of Keldorn's sword, which now dispels magic on hit. Among its other effects dispel magic cures both feeblemind and deafness:

    COPY ~itemupgrade/itm/c2keld02.itm~ ~override~
      // other code removed for clarity
      PATCH_IF FILE_EXISTS_IN_GAME ~#curedef.spl~ BEGIN // ee fixpack
        LPF ALTER_EFFECT INT_VAR match_opcode = 81 opcode = 146 parameter1 = 0 parameter2 = 2 STR_VAR resource = ~#curedef~ END
        LPF DELETE_EFFECT INT_VAR match_opcode = 240 match_parameter2 = 112 END
      END
      PATCH_IF FILE_EXISTS_IN_GAME ~#curefbm.spl~ BEGIN // ee fixpack
        LPF ALTER_EFFECT INT_VAR match_opcode = 77 opcode = 146 parameter1 = 0 parameter2 = 2 STR_VAR resource = ~#curefbm~ END
        LPF DELETE_EFFECT INT_VAR match_opcode = 240 match_parameter2 = 48 END
      END

    The code is straightforward: if the cure spells exist, convert the existing cure opcode (81 for deafness, 77 for feeblemind) into 146 for the spells. We also remove the 240s for the associated icons (112 for deaf, 48 for feebelmind) as redundant since the icon removal is also handled by the cure spells. 

    Another important thing to note is that, like the effect immunities, you may have to move specific effects into subspells since opcode 321 targets the entire resource. An example of this is Creeping Chaos, an updated version of Haer'Dalis's sword Chaos. Creeping Chaos causes the target to lose dexterity, as well as a chance to be confused (like Teleomortis, this confusion includes a visual that runs for its duration). If we simply updated #curecon with a 321 vs. the item, it means that anything that cured confusion would also roll back the dexterity drain, an unrelated effect. In this case we farm out the confusion to a separate spell, and target the separate spell with the 321 instead:

    COPY ~itemupgrade/itm/c2hd2.itm~ ~override~
      // code removed for clarity
    
    COPY ~itemupgrade/spl/c2hd2con.spl~ ~override~ // confusion effect from creeping chaos
      // code removed for clarity
    
    COPY_EXISTING ~#curecon.spl~ ~override~ // if using EEFP's cure spell setup, have it also cure confusion from creeping chaos
      LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 2 timing = 1 parameter2 = 2 STR_VAR resource = c2hd2con END
      BUT_ONLY IF_EXISTS

    The item applies confusion via c2hd2con.spl on hits, which #curecon.spl in turn cures. Since the dexterity drain is still sourced directly from the weapon (c2hd2.itm) any confusion cures do not affect it.

    Some final notes

    The examples above are also examples of where the old method would have failed. If someone was confused by Teleomortis and had the confusion cured via Restoration or Spiritual Clarity, the spinning animation would persist. While EE Fixpack (as of this post) is not yet released, the code above can be added now so that mods will seamlessly integrate when it becomes available.

×
×
  • Create New...