Jump to content

Unbreachable Stoneskin


Recommended Posts

From the Bioware forums:

 

Mekrath fired the globe, stoneskin, and prot from magical weapons. My sorcerer fired breach... nothing. My fighters are still wacking at a stoneskin. My sorcerer fired second breach... nothing...

 

Basically, the problem occurs because a few mage opponents (including the aforementioned Mekrath) have a special item (STONSKIN.ITM) which grants them the Stoneskin effect while equipped. As this Stoneskin effect isn't applied as a spell (and therefore hasn't got the COMBATPROTECTIONS flag) it cannot be removed by Breach. Currently, the only way to get rid of it is to use Dispel Magic or brute force.

Link to comment

I've made a slightly hacky workaround for this issue:

 

// Make the stoneskin effect applied by stonskin.itm properly breachable

COPY_EXISTING ~stonskin.itm~ ~override~
 PATCH_IF SOURCE_SIZE > 0x71 BEGIN
READ_LONG   0x64 "abil_off"
READ_SHORT  0x68 "abil_num"
READ_LONG   0x6a "fx_off"
READ_SHORT  0x70 "fx_num"
FOR (index = 0; index < "%fx_num%"; index = index + 1) BEGIN				 // loop through global effects
  READ_SHORT ("%fx_off%" +		("%index%" * 0x30)) "type"				 // read effect type
  PATCH_IF ("%type%" = 218) BEGIN											// if the effect is #218 (stoneskin)
	DELETE_BYTES ("%fx_off%" +		("%index%" * 0x30)) 0x30			   // delete effect
	SET "fx_num" = ("%fx_num%" - 1)										  // indicate that 1 global effect has been removed
	SET "index" = ("%index%" - 1)											
   END
 END
INSERT_BYTES("%fx_off%"	   ) 0x30										 // add new global effect
WRITE_SHORT ("%fx_off%"	   ) 146										  // effect: #146 (cast spell at creature)
WRITE_BYTE  ("%fx_off%" + 0x02) 1											// target: 1 (self)
WRITE_LONG  ("%fx_off%" + 0x08) 1											// param2: 1 (cast instantly)
WRITE_BYTE  ("%fx_off%" + 0x0c) 0											// timing mode: 0 (duration)
WRITE_BYTE  ("%fx_off%" + 0x0d) 3											// resist: 3 (dispellable and bypasses magic resistance)
WRITE_BYTE  ("%fx_off%" + 0x0e) 1											// duration: 1 second
WRITE_BYTE  ("%fx_off%" + 0x12) 100										  // probability: 100%
WRITE_ASCII ("%fx_off%" + 0x14) ~SPWI408~ #8								 // resref: SPWI408 (WIZARD_STONE_SKIN)
INSERT_BYTES("%fx_off%"	   ) 0x30										 // add new global effect
WRITE_SHORT ("%fx_off%"	   ) 296										  // effect: #296 (protection from specific animation)
WRITE_BYTE  ("%fx_off%" + 0x02) 1											// target: 1 (self)
WRITE_BYTE  ("%fx_off%" + 0x0c) 0											// timing mode: 0 (duration)
WRITE_BYTE  ("%fx_off%" + 0x0d) 3											// resist: 3 (dispellable and bypasses magic resistance)
WRITE_BYTE  ("%fx_off%" + 0x0e) 1											// duration: 1 second
WRITE_BYTE  ("%fx_off%" + 0x12) 100										  // probability: 100%
WRITE_ASCII ("%fx_off%" + 0x14) ~SPSTONES~ #8								// resref: SPSTONES (stoneskin effect)
SET "fx_num" = ("%fx_num%" + 2)											  // indicate that 2 global effects have been added
WRITE_SHORT 0x70 "%fx_num%"												  // update the number of global effects
END
BUT_ONLY_IF_IT_CHANGES

 

As you can see, this code removes all instances of the unbreachable stoneskin effect (#218) from the item and makes it cast the regular mage version of the stoneskin spell instead. This will occur once per area load, so characters wearing this ring still get the craptastic "I mystically refreshed my stoneskin in the split second when you didn't look" ability as was the case with the unmodded item. I even temporarily prevented stoneskin's visual effect from triggering to preserve the original sneaky feeling. :) So, in conclusion, the only difference is that this stoneskin can now be properly brought down by breach.

Link to comment

And fixed, the effect will no longer expire unless it's dispelled (as with the unmodded item).

 

// Make the stoneskin effect applied by stonskin.itm properly breachable

COPY_EXISTING ~stonskin.itm~ ~override~
 PATCH_IF SOURCE_SIZE > 0x71 BEGIN
READ_LONG   0x64 "abil_off"
READ_SHORT  0x68 "abil_num"
READ_LONG   0x6a "fx_off"
READ_SHORT  0x70 "fx_num"
FOR (index = 0; index < "%fx_num%"; index = index + 1) BEGIN // loop through global effects
  READ_SHORT ("%fx_off%" +		("%index%" * 0x30)) "type" // read effect type
  PATCH_IF ("%type%" = 218) BEGIN // if the effect is #218 (stoneskin)
	DELETE_BYTES ("%fx_off%" +		("%index%" * 0x30)) 0x30 // delete effect
	SET "fx_num" = ("%fx_num%" - 1) // indicate that 1 global effect has been removed
	SET "index" = ("%index%" - 1) // end loop
   END
 END
INSERT_BYTES("%fx_off%"	   ) 0x30 // add new global effect
WRITE_SHORT ("%fx_off%"	   ) 146 // effect: #146 (cast spell at creature)
WRITE_BYTE  ("%fx_off%" + 0x02) 1 // target: 1 (self)
WRITE_LONG  ("%fx_off%" + 0x08) 1 // param2: 1 (cast instantly)
WRITE_BYTE  ("%fx_off%" + 0x0c) 2 // timing mode: 2 (while equipped)
WRITE_BYTE  ("%fx_off%" + 0x0d) 3 // resist: 3 (dispellable and bypasses magic resistance)
WRITE_BYTE  ("%fx_off%" + 0x12) 100 // probability: 100%
WRITE_ASCII ("%fx_off%" + 0x14) ~RR#STONS~ #8 // resref: RR#STONS (cloned stoneskin which lasts forever)
SET "fx_num" = ("%fx_num%" + 1) // indicate that 1 global effect has been added
WRITE_SHORT 0x70 "%fx_num%" // update the number of global effects
END
BUT_ONLY_IF_IT_CHANGES

// Clone stoneskin into a custom spell which lasts forever

COPY_EXISTING ~spwi408.spl~  ~override/rr#stons.spl~
PATCH_IF (%SOURCE_SIZE%>0x71) THEN BEGIN
SAY NAME1 #0 // null spell name to remove combat log feedback
READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 SET "fx_delta" = 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"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_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%" = 218) BEGIN // if the effect is #218 (stoneskin)
	WRITE_BYTE ("%fx_off%" + 0x0c + (("%abil_fx_idx%" + "%index2%") * 0x30)) 1 // set timing mode to 1 (permanent)
	WRITE_LONG ("%fx_off%" + 0x0e + (("%abil_fx_idx%" + "%index2%") * 0x30)) 0 // null duration
  END
  PATCH_IF ("%opcode%" = 215 OR "%opcode%" = 174 OR "%opcode%" = 50) BEGIN // remove visual and sound fx
	DELETE_BYTES ("%fx_off%" +		(("%abil_fx_idx%" + "%index2%") * 0x30)) 0x30 // delete effect
	SET "fx_delta" = "%fx_delta%" - 1
	SET "index2" = "%index2%" - 1
	SET "abil_fx_num" = "%abil_fx_num%" - 1
  END
WRITE_SHORT  ("%abil_off%" + 0x1e + (0x28 * "%index%")) ("%abil_fx_num%")
  END
 END
END
BUT_ONLY_IF_IT_CHANGES

 

EDIT - I've nulled the name of the cloned spell in order to prevent combat log feedback messages (i.e. Mekrath - Stoneskin: Mekrath) so now the item behaves exacly as in the unmodded game except that the stoneskin effect is breachable. :)

Link to comment

Archived

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

×
×
  • Create New...