Jump to content

Special abilities failure


Recommended Posts

Heh, I just got a player report on my forum that Barbarian Rage is subject to Wild Magic and Dead Magic zones. Looking at the unmodded version of SPCL152.SPL I can see that it's missing the flag which DLTCEP calls "Simplified Duration" and which actually serves as a non-magical flag in BG2. The secondary part of the Berserker Enrage ability (SPCL321D.SPL) seems to suffer from the same problem. This is fairly easy to test: simply create a Barbarian protagonist, use CLUAConsole:MoveToArea("AR3004") or CLUAConsole:MoveToArea("AR3005") and try using your Barbarian Rage there. For reference, those are Dead Magic and Wild Magic zones, respectively. And here's the fix:

 

// Barbarian Rage and Berserker Enrage shouldn't be affected by Wild Magic and Dead Magic zones

COPY_EXISTING ~spcl152.spl~  ~override~ // Barbarian Rage
		  ~spcl321d.spl~ ~override~ // Berserker Enrage secondary effect (becoming winded)
 READ_BYTE  0x19 "flags"
 WRITE_BYTE 0x19 ("%flags%" BOR 0b01000000) // add "Simplified Duration" flag (this actually marks the ability as non-magical) 
BUT_ONLY_IF_IT_CHANGES

Link to comment

I've slightly expanded the code to include the Paladin's and Monk's Lay On Hands abilities and the Druids' shapeshifting abilities. In the unmodded game, these abilities were all affected by Wild Magic and Dead Magic zones.

 

// Non-magical innate abilities shouldn't be affected by Wild Magic and Dead Magic zones

COPY_EXISTING ~spcl152.spl~ ~override~ // Barbarian Rage
		  ~spcl211.spl~ ~override~ // Paladin Lay On Hands
		 ~spcl321d.spl~ ~override~ // Berserker Enrage secondary effect (becoming winded)
		  ~spcl611.spl~ ~override~ // Druid Shapeshift Brown Bear
		  ~spcl612.spl~ ~override~ // Druid Shapeshift Wolf
		  ~spcl613.spl~ ~override~ // Druid Shapeshift Black Bear
		  ~spcl632.spl~ ~override~ // Avenger Shapeshift Spider
		  ~spcl633.spl~ ~override~ // Avenger Shapeshift Baby Wyvern
		  ~spcl634.spl~ ~override~ // Avenger Shapeshift Fire Salamander
		  ~spcl643.spl~ ~override~ // Shapeshifter Werewolf Transformation
		  ~spcl644.spl~ ~override~ // Shapeshifter Greater Werewolf Transformation
		  ~spcl815.spl~ ~override~ // Monk Lay On Hands
		  ~sppr731.spl~ ~override~ // Druid Fire Elemental Transformation
		  ~sppr732.spl~ ~override~ // Druid Earth Elemental Transformation
 READ_BYTE  0x19 "flags"
  PATCH_IF (("%flags%" BAND 0b01000000) != 0b01000000) BEGIN // only patch if the "simplified duration" flag is unchecked
  WRITE_BYTE 0x19 ("%flags%" BOR 0b01000000) // add the "simplified duration" flag (this actually marks the ability as non-magical)
  END
BUT_ONLY_IF_IT_CHANGES

Link to comment

Heh, I'm afraid you'll have to wait for aTweaks v1.1 in order to get the "Make druidic shapeshifting uninterruptable" component. But, if all goes well, that should be out in about a week or so. :(

 

BTW, the code I posted will also be used in aTweaks although in a slightly altered form. However, since it contains redundancy checks, when/if it's integrated into the G3 BG2 Fixpack installing aTweaks over it won't cause any problems.

Link to comment

Since BUT_ONLY will always be evaluated, the PATCH_IF statement does nothing (whether it happens by not writing or by writing a bit that's already on, the BUT_ONLY code will still compare the two and eject the files which already had this bit set).

 

That would likely be the only suggested change for its incorporation into the fixpack (it'll definitely get tossed in someday, with permission). Well, it'd probably get a SOURCE_SIZE sanity check, but it's not something that would ever be necessary...

Link to comment

Cool, I suspected that BUT_ONLY might make the PATCH_IF check redundant, but I still wanted to be on the safe side. And yes, permission to integrate the code into the G3 BG2 Fixpack is given, as always. :(

 

BTW, devSin, can you confirm my suspicion that Silence preventing the activation of non-magical innates is hardcoded?

Link to comment
BTW, devSin, can you confirm my suspicion that Silence preventing the activation of non-magical innates is hardcoded?
Details?

 

It may take another couple weeks for me to truly get back in the swing of things; if you're saying that silence prevents the ability from firing at all, it would be hardcoded (silence already has hardcode checks to do terrible things like disable soundsets and prevent dialogue, so preventing spellcasting altogether is very likely).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...