Jump to content

Wand of Spell Striking bug


Recommended Posts

I just tried to use the secondary Pierce Magic ability of WAND18.ITM to remove Spell Turning from a party member and it didn't work. :band: I tried the same with Spell Deflection and and that doesn't work either.

 

Since the Wand pretty closely mimics the spell that it's supposed to cast, I think this may be a projectile or a secondary type issue. As usual during testing, I just have the fixpack and RR installed.

Link to comment

Pierce Magic is classed as a Magical Attack (4) spell, which lets it bypass all sorts of stuff (i.e. MR) so that it can effectively counter magic. Since the wand is simply using the same effects, it's probably not getting the free pass that the spell does. Try this patch and see if it behaves better:

 

// pierce magic from wand of spellstrike not working
COPY_EXISTING ~wand18.itm~ ~override~
 READ_LONG  0x64 "abil_off" ELSE 0
 READ_SHORT 0x68 "abil_num" ELSE 0
 READ_LONG  0x6a "fx_off"   ELSE 0
 SET "abil_length" = 0x38
 SET "fx_delta" = 0
 FOR (index = 0; index < abil_num; index = index + 1) BEGIN // start iterating through abilities
READ_ASCII  ("%abil_off%" + 0x04 + ("%abil_length%" * "%index%")) "bam"
READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) ("%abil_fx_idx%")
PATCH_IF ("%bam%" STRING_COMPARE_CASE "spwi608b" = 0) BEGIN // if pierce magic ability
  READ_SHORT  ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "abil_fx_num"
  WRITE_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) 1
  WRITE_SHORT ("%abil_off%" + 0x2a + ("%abil_length%" * "%index%")) 1 // remove projectile
  SET "fx_delta" = ("%fx_delta%" + 1 - "%abil_fx_num%")
  // delete all effects and replace with cast spell effect
  DELETE_BYTES ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) (0x30 * "%abil_fx_num%")
  INSERT_BYTES ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) 0x30
	WRITE_SHORT ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) 146 // cast spell
	WRITE_BYTE  ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2 // preset target
	WRITE_LONG  ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 20 // cast at level
	WRITE_LONG  ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 1 // cast instantly
	WRITE_BYTE  ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1 // instant/permanent
	WRITE_BYTE  ("%fx_off%" + 0x0d + (0x30 * "%abil_fx_idx%")) 2 // no dispel/no bypass
	WRITE_BYTE  ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100 // probability high
	WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) ~spwi608~ #8 // resref
END
 END
 BUT_ONLY_IF_IT_CHANGES

 

Also, could you try it against an MR-heavy target? That no dispel/no bypass (2) may need to be set to no dispel/bypass (0).

Link to comment
Try this patch and see if it behaves better

 

Yup, it works flawlessly now. :band: However, note that making an item cast an arcane spell via effect #146 will prompt a reaction from the Cowled Wizards just as if a real arcane spell had been cast.

 

Also, could you try it against an MR-heavy target? That no dispel/no bypass (2) may need to be set to no dispel/bypass (0).

 

I had Viconia drink a Potion of Magic Protection for an effective MR of 120 and the patched wand worked perfectly on her.

Link to comment

This is nerfing the magic resistance penalty (cast instantly chooses always the Level 1 ability). The problem in this case is that magic attacks bypass power checks (for determining if spell bounce or deflect by level effects catch them or not); setting power to 0 would also bypass this (as the magic attack spells themselves should be, since they *don't* bypass spell level immunity like they do the bounce and deflect stuff), but then it's not blocked by spell shield (it'll just dispel it). Magic attacks are never subject to magic resistance, but Duration 2 is not "no dispel/no bypass" (the wand would never be subject to resistance anyway).

 

So, yes, CDWAND18.SPL to the rescue. :( Note that the Breach ability also has this same issue.

Link to comment
// spells from wand of spellstrike not working
COPY_EXISTING ~wand18.itm~ ~override~
 READ_LONG  0x64 "abil_off" ELSE 0
 READ_SHORT 0x68 "abil_num" ELSE 0
 READ_LONG  0x6a "fx_off"   ELSE 0
 SET "abil_length" = 0x38
 SET "fx_delta" = 0
 FOR (index = 0; index < abil_num; index = index + 1) BEGIN // start iterating through abilities
READ_ASCII  ("%abil_off%" + 0x04 + ("%abil_length%" * "%index%")) "bam"
READ_SHORT  ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "abil_fx_num"
READ_SHORT  ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) ("%abil_fx_idx%")
WRITE_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) 1
WRITE_SHORT ("%abil_off%" + 0x2a + ("%abil_length%" * "%index%")) 1 // remove projectile from ability (spell has one)
SET "fx_delta" = ("%fx_delta%" + 1 - "%abil_fx_num%")
// delete all effects and replace with cast spell effect
DELETE_BYTES   ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) (0x30 * "%abil_fx_num%")
INSERT_BYTES   ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) 0x30
  WRITE_SHORT  ("%fx_off%" +		(0x30 * "%abil_fx_idx%")) 146 // cast spell
  WRITE_BYTE   ("%fx_off%" + 0x02 + (0x30 * "%abil_fx_idx%")) 2 // preset target
  WRITE_LONG   ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 1 // cast at level
  WRITE_LONG   ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 1 // cast instantly
  WRITE_BYTE   ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1 // instant/permanent
  WRITE_BYTE   ("%fx_off%" + 0x12 + (0x30 * "%abil_fx_idx%")) 100 // probability high
  PATCH_IF ("%bam%" STRING_COMPARE_CASE "spwi608b" = 0) BEGIN
	WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) ~cdwand18~ #8 // resref
  END ELSE BEGIN
	WRITE_ASCIIE ("%fx_off%" + 0x14 + (0x30 * "%abil_fx_idx%")) "%bam%" #8 // resref
	WRITE_BYTE   ("%fx_off%" + 0x1b + (0x30 * "%abil_fx_idx%")) 0 // nicks last 'b' off resref
  END
 END
 BUT_ONLY_IF_IT_CHANGES

// create separate version of pierce magic for wand of spell striking
COPY_EXISTING ~spwi608.spl~ ~override/cdwand18.spl~
 READ_LONG  0x64 "abil_off" ELSE 0
 READ_SHORT 0x68 "abil_num" ELSE 0
 READ_LONG  0x6a "fx_off"   ELSE 0
 READ_SHORT ("%abil_off%" + 0x20 + (0x28 * ("%abil_num%" - 1))) "abil_fx_idx" // read index from last ability
 DELETE_BYTES "%fx_off%"   (0x30 * "%abil_fx_idx%")	// delete all effects except for last ability
 DELETE_BYTES "%abil_off%" (0x28 * ("%abil_num%" - 1)) // delete all abilities except last
 WRITE_SHORT ("%abil_off%" + 0x10) 1 // min level on remaining ability
 WRITE_SHORT ("%abil_off%" + 0x20) 0 // fx index on remaining ability
 WRITE_SHORT 0x68 1 // set number of abilities to 1
 WRITE_SHORT 0x70 0 // set global fx to 0
 WRITE_LONG  0x6a ("%abil_off%" + 0x28) // correct fx offset

Link to comment

May I suggest instead of deleting headers, changing the casting time on wand18a.spl (or CDWAND18.SPL, as you like it) to zero, changing type to innate, and casting normally through the wand?

 

The patch as it stands will anti-nerf the magic resistance penalty.

 

I've got a whole stupid grip of these locally, although in some cases it was just to make sure that wands were using the "correct" saving throw.

Link to comment

Archived

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

×
×
  • Create New...