Jump to content

Special snare


Recommended Posts

I got a moment to finally whip up a patch for Yoshimo's spell. The effects are pretty weak (the slow has no icon nor lighting effects or sound, the resilient sphere uses only BG-era effects, and everything wants to No dispel/bypass resistance). The resilient sphere should probably get fixed, at least.


Since I'm anal about having everything in the proper order, I now have to patch the damn sphere twice. So everyone can laugh at me when Cam comes up with teh better:

READ_LONG 0x6a eo
WRITE_BYTE eo + 0x63 0x3
WRITE_BYTE eo + 0x6d 0x1
WRITE_BYTE eo + 0x693 0x8
WRITE_BYTE eo + 0x69d 0x2
WRITE_BYTE eo + 0x6cd 0x2
WRITE_LONG eo + 0x12e 0x1e
READ_SHORT 0xe2 ne
eo += ne * 0x30
READ_SHORT 0xe0 ne
DELETE_BYTES eo (ne - 0x1) * 0x30
 READ_LONG 0x6a o
 WRITE_LONG o + 0x784 0x3
 FOR (l = o + 0x21e; l < 0x84a; l += 0x30) BEGIN
   WRITE_LONG l 0x2a
 WRITE_BYTE o + 0xd 0x1
 WRITE_BYTE o + 0x12 0x64
 WRITE_LONG o 0x4020014
 WRITE_LONG o + 0xe 0x2a
 WRITE_LONG o + 0x24 0x1
 READ_SHORT 0x90 n
 WRITE_SHORT 0x90 n + 0x8
 l = o + ((n + 0x1) * 0x30)
 FOR (i = 0x0; i < 0x7; i += 0x1) BEGIN
   INSERT_BYTES l 0x30
   WRITE_BYTE l + 0xd 0x1
   WRITE_BYTE l + 0x12 0x64
   WRITE_LONG l + 0x4 (i == 0x5) ? 0x0 : 0x64
   WRITE_LONG l + 0x8 (i == 0x5) ? 0x19 : 0x1
   WRITE_LONG l + 0xe 0x2a
   WRITE_LONG l + 0x24 0x1
   WRITE_SHORT l (i < 0x5) ? 0x1f - i : (i == 0x5) ? 0x65 : 0xad
   WRITE_SHORT l + 0x2 0x402
 READ_SHORT 0x90 n
 READ_ASCII o e (n * 0x30)
INSERT_BYTES eo n * 0x30
WRITE_SHORT 0xe0 n + 0x1
READ_SHORT 0x90 ne
WRITE_SHORT 0x90 ne + 0x2
READ_LONG 0x6a eo
eo += ne * 0x30
WRITE_LONG eo + 0xe 0x1e
FOR (i = 0x2; i; i -= 0x1) BEGIN
 WRITE_BYTE eo + 0x12 0x64
 WRITE_LONG eo i + 0x302008c
 WRITE_LONG eo + 0x8 (i == 0x1) ? 0x6 : 0x29
 WRITE_LONG eo + 0x24 0x1
 WRITE_LONG eo + 0x28 `0x3
 WRITE_SHORT eo + 0xc (i == 0x1) ? 0x101 : 0x100
 eo += 0x30
READ_LONG 0x64 ao
FOR (READ_SHORT 0x68 na; na; na -= 0x1) BEGIN
 READ_SHORT ao + 0x1e ne
 WRITE_SHORT ao + 0x20 x
 ao += 0x28
 x += ne


Link to comment
I think your code is IF_EVAL prone.
Who uses IF_EVAL? NO_ONE.


It's a consequence of lazy coding, and coding for maximum efficiency (both memory and speed). My patches look like crap these days and can be horribly incompatible, but they're all instantaneous (vs. the old days, WeiDU doesn't once pause after the initial COPY, instead literally racing through all 35K lines in 30.0t).


This one has a little bloat, but I simply don't care enough to bother anymore.

Link to comment
Yes, but reads are still performed out of order - unless you add NO_IF_EVAL_BUG in the header.
You know I know that, and I used to comment out the initial process_patch1 entirely. THERE IS NO IF_EVAL. :p


EDIT: after looking at the code, there isn't an issue with IF_EVAL. I'm not trying to READ* any place that's less than or greater than the file size.

Link to comment

I tried interpreting this. Then I got smart and realized it's a lot simpler to ask what the hell it's doing. :)

  • Change slow effect to power 3 and no dispel/bypass to dispel/not bypass.
  • Maze lighting effects to power 8 and no dispel/bypass to no dispel/not bypass
  • Maze opcode itself no dispel/bypass to no dispel/not bypass
  • Hold play 3d effect duration from 1 to 30

It looks like next we delete all Otiluke's effects (except map marker) and copy them in from the Otiluke spell, with a few changes. Then I threw my hands up.

Link to comment

The power settings were off, so I made them match (Otiluke's is correct by default, as is hold and two of the maze effects). This isn't really necessary (I guess it depends if you think traps should have effects that may get blocked by spell immunity).


I then fixed up the dispel/resistance stuff just to make sure the trap doesn't apply effects that bypass resistance or are undispellable.


The hold person VVC is SPMINDAT, which needs to run over the target for the duration of the hold effect, so that's a fix.


For the wizard version of Otiluke's, there are several bugs we fix (and some we may not). Because of the whole in-order thing, I need to make those updates before reading the effects. First, the very last spell immunity is set to block spell level 0; spell level 3 is never blocked, so I change it to level 3. The sphere should last 1 turn, but a lot of the effects were lasting 42 seconds; I don't know if it comes from the BG version of the spell, or if it was just lazy copying or honest mistake. I thought the variation would be nice, so I make the trap sphere only last 7 rounds.


Since the sphere applies invisibility (improved), I add invisibility (normal) to the top of the effects list (BioWare always put these in pairs, first normal and then improved). Then I add immunity to fire, cold, acid, electricity, and magic damage. I add reduced damage from poison and immunity to poison (BioWare always put these in pairs).


Finally, I go back to the first ability, and add effects to display the slow icon and lighting effects (alteration water).


The final block just recreates the ability effect indexes.

Link to comment


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

  • Create New...