Jump to content

Protection scrolls don't bypass MR


CamDawg

Recommended Posts

From BD; the various protection from X scrolls can be blocked by MR. Also makes one more minor change (from devSin) where the unidentifed name for Protection from Electricty is changed from "Scroll" to "Protection Scroll" for consistency. This affects scrol03, scrol04, scrl05, scrl06, scrl08, scrl09, and scrl15.

 

// protection from x scrolls not bypassing MR
COPY_EXISTING_REGEXP ~^scrl\(0[345689]\|15\)\.itm$~ ~override~
 SAY        0x08 #18094 // protection scroll
 READ_LONG   0x64 "abil_off"
 READ_SHORT  0x68 "abil_num"
 READ_LONG   0x6a "fx_off"
 READ_SHORT  0x70 "fx_num"
 PATCH_IF ("%abil_num%" > 0) BEGIN
   READ_SHORT ("%abil_off%" + 0x1e + ("%abil_num%" * 0x38)) "last_fx_num"
   READ_SHORT ("%abil_off%" + 0x20 + ("%abil_num%" * 0x38)) "last_fx_idx"
   SET "fx_num" = ("%last_fx_num%" + %"last_fx_idx%")
 END
 WHILE ("%fx_num%" > 0) BEGIN
   SET "fx_num" = ("%fx_num%" - 1)
   WRITE_BYTE ("%fx_off%" + 0x0d + ("%fx_num%" * 0x30)) 3 // dispel/bypass resistance
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

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

×
×
  • Create New...