Jump to content

Staff of Magi - Prot. from Evil ability not fixed ?


Guest Fleur du Mal

Recommended Posts

Guest Fleur du Mal

Using the newest version of the Fixpack i noticed that the Staff of Magi doesn't protect from evil (Also tried it out by summonig a Glabrezu) even if there is a text ("Char - is protected from evil") in the message window that says otherwise.

Link to comment
Yep, confirmed. We added the right effects, but due to a bug in the code we were setting their probabilities to 0%. I've got this fixed locally and it'll be in the next release.

 

If it's not too much trouble, could you give instructions for an in-the-meantime fix?

Link to comment

Sure, here are instructions for correcting with an editor and by editing the tp2. First, the editor:

 

Open up the item file, staf11.itm. In the global effects, the first two effects listed should be Attack Roll Penalty (219) and Protection From Creature Type (100). On both effects, change the target to Self (1) and the probability to 100 (listed as probability 1 in NI).

 

To do it via tp2, open up setup-bg2fixpack.tp2 inside the bg2fixpack folder with a text editor. Round about line 15,551 the patch begins with this:

 

// SotM needs a lot of rebuilding--dispel effects don't work in melee, several effects are
// mistargeted or dispellable, etc.
COPY_EXISTING ~staf11.itm~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 READ_SHORT 0x70 "fx_num"
 SET "loops" = "%fx_num%"
 WHILE ("%loops%" > 0) BEGIN
SET "loops" = ("%loops%" - 1)
READ_SHORT ("%fx_off%" +		("%loops%" * 0x30)) "type"
READ_LONG  ("%fx_off%" + 0x08 + ("%loops%" * 0x30)) "icon"
PATCH_IF ("%type%" = 101) BEGIN // immunity to charm
  WRITE_BYTE ("%fx_off%" + 0x0d + ("%loops%" * 0x30)) 0 // no dispel/bypass resistance
END ELSE
PATCH_IF (("%type%" = 139) OR ("%type%" = 141)) BEGIN // lighting effects, display string
  WRITE_BYTE ("%fx_off%" + 0x02 + ("%loops%" * 0x30)) 1 // target: self
  WRITE_BYTE ("%fx_off%" + 0x0d + ("%loops%" * 0x30)) 0 // no dispel/bypass resistance
END ELSE
PATCH_IF (("%type%" = 142) OR ("%icon%" = 28)) BEGIN // display protection from magic icon
  WRITE_LONG  ("%fx_off%" + 0x08 + ("%loops%" * 0x30)) 52 // mind shield
END
 END
 INSERT_BYTES  ("%fx_off%"	   ) 0x30
WRITE_SHORT ("%fx_off%"	   ) 100 // protection from creatue type
WRITE_LONG  ("%fx_off%" + 0x04) 9   // summoned demon
WRITE_LONG  ("%fx_off%" + 0x08) 7   // gender
 INSERT_BYTES  ("%fx_off%"	   ) 0x30
WRITE_SHORT ("%fx_off%"	   ) 219 // protection from creatue type
WRITE_LONG  ("%fx_off%" + 0x04) 3   // mask_evil
WRITE_LONG  ("%fx_off%" + 0x08) 8   // from align.ids
 SET "loops" = 2
 WHILE ("%loops%" > 2) BEGIN
SET "loops" = ("%loops%" - 1)
WRITE_BYTE ("%fx_off%" + 0x02 + ("%loops%" * 0x30)) 1   // target: self
WRITE_BYTE ("%fx_off%" + 0x0c + ("%loops%" * 0x30)) 2   // instant/while equipped
WRITE_BYTE ("%fx_off%" + 0x12 + ("%loops%" * 0x30)) 100 // probability
 END
 SET "delta" = 2
 WRITE_SHORT 0x70 ("%fx_num%" + "%delta%") // updates global fx total

 

Leave the rest of the patch alone, just replace the above bits with this:

 

// SotM needs a lot of rebuilding--dispel effects don't work in melee, several effects are
// mistargeted or dispellable, etc.
COPY_EXISTING ~staf11.itm~ ~override~
 READ_LONG  0x64 "abil_off"
 READ_SHORT 0x68 "abil_num"
 READ_LONG  0x6a "fx_off"
 READ_SHORT 0x70 "fx_num"
 SET "loops" = "%fx_num%"
 WHILE ("%loops%" > 0) BEGIN
SET "loops" = ("%loops%" - 1)
READ_SHORT ("%fx_off%" +		("%loops%" * 0x30)) "type"
READ_LONG  ("%fx_off%" + 0x08 + ("%loops%" * 0x30)) "icon"
PATCH_IF ("%type%" = 101) BEGIN // immunity to charm
  WRITE_BYTE ("%fx_off%" + 0x0d + ("%loops%" * 0x30)) 0 // no dispel/bypass resistance
END ELSE
PATCH_IF (("%type%" = 139) OR ("%type%" = 141)) BEGIN // lighting effects, display string
  WRITE_BYTE ("%fx_off%" + 0x02 + ("%loops%" * 0x30)) 1 // target: self
  WRITE_BYTE ("%fx_off%" + 0x0d + ("%loops%" * 0x30)) 0 // no dispel/bypass resistance
END ELSE
PATCH_IF (("%type%" = 142) OR ("%icon%" = 28)) BEGIN // display protection from magic icon
  WRITE_LONG  ("%fx_off%" + 0x08 + ("%loops%" * 0x30)) 52 // mind shield
END
 END
 INSERT_BYTES  ("%fx_off%"	   ) 0x30
WRITE_SHORT ("%fx_off%"	   ) 100 // protection from creatue type
WRITE_BYTE  ("%fx_off%" + 0x02) 1   // target: self
WRITE_LONG  ("%fx_off%" + 0x04) 9   // summoned demon
WRITE_LONG  ("%fx_off%" + 0x08) 7   // gender
WRITE_BYTE  ("%fx_off%" + 0x0c) 2   // instant/while equipped
WRITE_BYTE  ("%fx_off%" + 0x12) 100 // probability
 INSERT_BYTES  ("%fx_off%"	   ) 0x30
WRITE_SHORT ("%fx_off%"	   ) 219 // protection from creatue type
WRITE_BYTE  ("%fx_off%" + 0x02) 1   // target: self
WRITE_LONG  ("%fx_off%" + 0x04) 3   // mask_evil
WRITE_LONG  ("%fx_off%" + 0x08) 8   // from align.ids
WRITE_BYTE  ("%fx_off%" + 0x0c) 2   // instant/while equipped
WRITE_BYTE  ("%fx_off%" + 0x12) 100 // probability
 SET "delta" = 2
 WRITE_SHORT 0x70 ("%fx_num%" + "%delta%") // updates global fx total

 

Then just re-insall the core component.

Link to comment
Sure, here are instructions for correcting with an editor and by editing the tp2. First, the editor:

 

Open up the item file, staf11.itm. In the global effects, the first two effects listed should be Attack Roll Penalty (219) and Protection From Creature Type (100). On both effects, change the target to Self (1) and the probability to 100 (listed as probability 1 in NI).

 

A minor note: for the "manual" fix to work, the 'duration' of both effects must also be changed to 'instant / while equipped'. The change is of course included in the .tp2 code, but I thought I'd mention it in case anyone else doesn't fancy waiting for every mod to un- and reinstall (the fixpack being first and all). :)

Link to comment

Archived

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

×
×
  • Create New...