Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

opcode 321 does not cancel opcode 0 effects with permanent timing.

subtledoctorsubtledoctor Member Posts: 11,462
edited March 2017 in Troubleshooting
Found a bit of a bug. I'll post it on Redmine but if people don't mind I'll use this post for the files needed to reproduce.

Opcode 321, "cancel effect by resource," is meant to cancel the effects of a specified spell. However, it fails on effects that use opcode 0 (armor class bonus) with permanent timing. Note: it doesn't fail to cancel the target spell; it only fails to cancel any permanent opcode 0 effects within the target spell.

Steps to reproduce:
1) Download the three files attached to this post, unzip them and drop them in your override folder.
2) Start up any game, and type the following into the CLUA Console:
3) Use the newly-granted innate ability with the Shield icon. Observe that your armor class and thac0 have both been improved by 2 points.
4) Now use the newly-granted innate ability with the Remove Magic icon.

Expected behavior:
Both the AC and thac0 bonuses should disappear.

Observed behavior:
Only the thac0 bonus disappears. The AC bonus survives the removal.

You can keep using the bonus ability and the removal ability, and you will see that your thac0 score bounces back and forth, while your AC score continually ratchets down.


  • kjeronkjeron Member Posts: 2,131
    edited March 2017
    Opcode 0, Timing mode 1 does not leave any effect behind to be removed.
    It directly changes the AC stat in the creature file.
    You'll need to use timing mode 9, or 0 with an arbitrarily large duration (126144000 = 48 in-game years, can't go much higher because its converted to ticks (x15) and still has same field size(4bytes)).
    Or timing mode 4096, duration = 0x7fffffff.

    Most opcodes with a relevant CRE stat do this when using timing mode 1 (or 4 or 7, which convert to 1 after their delay).
    • Base, Specific, and [All Weapon] AC
    • Resistances (excluding magic damage and poison)
    • Saving Throws
    • Attributes
    • Base Thac0
    • Lore
    • APR
    • Current HP and Damage (obviously)
    • Max HP
    • Kit
    • Animation
    • Thieving skills are a mixed bag, the older opcodes do (59/90/91/92), the newer opcodes do not (275/276/277).
    • Never tried Colors or portrait.

    Post edited by kjeron on
  • DanacmDanacm Member Posts: 738
    I created portrait change to shapeshifter, and it works like this, only max timing can store the effect otherwise its permament.

Sign In or Register to comment.