Skip to content

Increasing Duration of Barkskin

One thing that has annoyed me to no end in my 20+ years of playing BG is the short duration of the Barkskin spell. Considering it isn't an especially powerful spell, only at level 16 does it get comparable to mage level 3 spell ghost armour (with shorter duration), and at level 20 to level 4 mage spell, I find it very underpowered as a spell. Especially since I am doing a playthrough as a shapeshifter now, who cannot wear any armour.

Long story short, I want to increase the duration of the Barkskin spell to 5 turns. Is there a way to do this from the console, or by patching some files, in the running game? If not and I need to start the new game...How do I do this? If there is a simple way to do this, assuming zero knowledge of modding BG2, I will be extremely grateful :)

Comments

  • jmerryjmerry Member Posts: 4,001
    Well, yes, of course you could increase the duration. You just go through all 18 levels of the SPL file and change the duration of every effect with a duration. Quite tedious, unless you automate it with a few lines of code.

    Not that I would - the duration is quite fair, given that it's only a level 2 spell, and mage and priest spells aren't in direct competition anyway. What else are you using those level 2 druid spell slots for?

    And on a shapeshifter? When you want to go into melee, you just turn into a werewolf. Barkskin is strictly for those fights when you're standing back and casting spells, and don't want stray arrows hitting you. One round per level plus a few will easily last you through a fight by the midgame.
  • VanDerBergVanDerBerg Member Posts: 221
    Thanks for a quick reply.

    As for the second part, I am playing with some components from the Talents of Faerun mod, including IWD and additional priest spells, which introduce some viable options for druid level 2 spell slots (otherwise known as the worst spell slot in the history of RPG games). So, it is no longer a choice between Barkskin and Goodberries/Known Allighnment. There are some neat disablers early on, some damage-dealing spells, and some of that (together with some level 1 and 3 spells) increase the prowess of the druid in melee combat, giving them higher strength, more damage and more attacks per round. Alas, without proper defense, the druid gets toasted very quickly, which isn't a problem for any other druid, as they can get Ankheg armour at level 1 and be well protected. Except for shapeshifters (and avengers?). As far as I can tell, the only way for a shapeshifter to protect themselves is via Barkskin.

    In short, there seems to be more now to a shapeshifter gameplay than 1) buff with ironskin, 2) summon, 3) call lighting and throw insect plague and 4) shapeshift and for the rest of the fight be a badass fighter. Maybe there was before too, but I've never played with a shapeshifter

    Secondly, a pretty cool component of the mod is nerfing of some BG2 powers of specialist classes in BG1. Shapeshifters now get a nerfed werewolf form until level 7, which is still much better in melee than the non-shapeshifted druid, but it isn't such a gamechanger as werewolf/greater werewolf forms are. More importantly, as far as I can see (and SCS installed on top of it doesn't change it), it does away with the shapeshifting token, replacing it with good old certain-amount-of-transformations-per-day power, which starts at 1. So, you cannot shapeshift at will, but only once per rest (at the start). Coupled with the part where you cannot rest in the wilderness without provisions, it makes it unviable to rest after each fight so you can always fight as a werewolf. Besides, I really like alternating between going into fights as a pure werewolf fighter and as a spellcaster, especially with the new druid disablers with IWD spells. Which makes proper defense (that pretty much very other class apart from crappy beastmaster has) a must. Hence my motivation for longer Barkskin, which I don't need to renew every minute.

    As for the first part, is there any documentation or any page anywhere on what parts of these SPL files need to be modified? I was thinking of hacking the SCS mod, which includes a patch for extending the length of protection from fire and just doing pretty much the same with the Barkskin spell code, but the syntax in the patch looks obscure and I don't know whether that would work or not.

  • jmerryjmerry Member Posts: 4,001
    edited March 25
    One of the first things you learn when you get into modding is the basic structure of how effects are put together. Effects are a structure, occasionally on its own as an EFF file but usually embedded into other files, that does something. They're the building blocks of basically everything.
    Now, regarding duration, there are two fields that we should look at: duration and timing mode. The latter tells us how to interpret the former; some modes ignore duration, some treat it as a delay until doing the thing, and some treat it as a duration - when to stop doing the thing. The most common timing mode used in limited-duration ongoing effects denotes that duration in seconds - so 5 turns = 50 rounds = 300 seconds is a duration of 300.
    So, then, which effects would you change duration on? All of them. Or, at least, all of them that use duration in the same way. Barkskin at a given level has 15 effects. Four of them are instant effects with timing mode 1 and no duration - cosmetic stuff that plays when you cast the spell. Those don't get their durations updated. Ten of the effects use timing mode 0, the standard limited duration. That's what you'd set the duration field to 300 for. And then there's one effect (the ending sound) that uses timing mode 4 for a delay. You'd also set that to 300.

    Automating this ... SCS is not the place to look for easily understandable entry-level code. It uses a forest of libraries, rather than the basic functions included with WeiDU that could do most of the same things. Doing things the SCS way is harder, or at least harder to learn. In fact, here's a code snippet that would set the duration of Barkskin to 5 turns (with the proper boilerplate around it, as part of a mod component):
    COPY_EXISTING ~SPPR202.SPL~ ~override~ // Barkskin. Open up a new copy to go in the override folder.
        LAUNCH_PATCH_FUNCTION ALTER_EFFECT // A function included in WeiDU.
          INT_VAR
            match_timing = 0 // "Match" variables tell us which effects to change. All "limited" effects.
            duration = 300 // And non-match variables tell us what changes to make. New duration value.
        END // Done with the function
        LPF ALTER_EFFECT INT_VAR match_timing = 4 duration = 300 END // Abbreviated. Timing 4 is "delay".
    BUT_ONLY_IF_IT_CHANGES // Close this file. If we didn't change anything, don't save it.
    
    (Much quicker to write that than to go through and manually change nearly 200 effects)
    Post edited by jmerry on
  • VanDerBergVanDerBerg Member Posts: 221
    edited March 25
    Amazing, thank you very much for your work! So...If I put these into a file, then run this file somehow using weidu, it should patch the Barkskin file...which is used in the running game?

    EDIT: I *think* I have figured it out and done it, will test it later. Thanks again.
    Post edited by VanDerBerg on
Sign In or Register to comment.