Jump to content

Adding an equipable spell/effect conditionally, like with opcode 326


Recommended Posts


I've been able to successfully use equipped effects on a MFISTX.ITM to increase the attacks per round only on "unarmed" attacks with the Fist weapon. But I've also used a SPL at level up to add APR on a certain proficiency level (with opcode 326 and adding entries to SPLPROT.2DA), and I wanted that to apply only with "normal" weapons, not the unarmed attack.

Since there is not a specific opcode for this I just want account for that in the MFISTX.ITM, so I was attempting to use again #326 with the opposite condition (so one increase only applies if the other is missing). I need to do it as an equipped effect on the MFISTX.ITM. The effect applies, but doesn't get cleared after the Monk equips a different weapon. :-(

If the effect is applied directly as an ITM effect, it appears and disappears correctly when switching weapons, but then I can't make it conditional on a certain stat.

I've tried to make the APR increase blocked by the MFISTX using #324 (Immunity to Resource and Message) and #318 (Protection from Resource), but without success. I'm quite a beginner, so I might be missing something, though. Any other idea?

Thank you!

Link to post

Try applying the effect using opcode 177, param1=0, param2=2, timing mode 2. The referenced EFF file should also use timing mode 2 for the APR effect, and you need to set the “parent resource” to type “spell” (offset 0x90 I think) and give it a name (at offset 0x94 I think... I might have those offsets switched though. For simplicity I use the same name here as the actual name of the .EFF file.)

Now, back in the .ITM file, after  before  that 177 effect, add a 318 effect that conditionally blocks the named .EFF.

Note, however, this is difficult to use when you want different stepped effects for different proficiency levels 0-5. Matching the negation of five proficiency values while not matching the negation of one is difficult... if you see what I mean. However, if it’s a simple “block the effect if prof < 1, allow the effect if prof > 0,” then thus should work fine.*

* (Probably. There might be other things that interfere, like a mod that uses values in the upper bytes of proficiencies (*cough*). For best results don’t use < or > in your conditions, instead just use multiple conditions with “prof = x.”)

Edited by subtledoctor
Link to post

Thanks for the answer!

I did it a quick try, and it did not work. I'll give it a second more detailed look after work. Meanwhile, a doubt from your comment. In the first paragraph you mentioned a spell resource, but in the second you said "back in the ITM file, after that 177 effect". Was a mistake, or you meant that I need to modify both the SPL and the ITM?

To clarify: I created a spell applied on level up (via the CLABxxxx.2DA) that grants the APR boost on proficiency (intended only for weapons), and then there is the MFISTx.ITM which also adds APR. I'll try as many combinations as I can later on just in case, but let me know which one you intended. :)

Link to post

Aaaah, I think I got it. It's even easier and without an EFF file (your comment put me on the right track, thank you).

On the same item (e.g. MFIST2.ITM) added a #318 (protection from resource) referencing the same MFIST2.ITM, conditioned to the stat that I wanted to check. Then followed by the  effect that I wanted. I don't know if the other way that you suggested works but I missed setting something, but this one is so simple that I feel silly for not noticing it before.

Thank you very much!

Link to post

You don't want to use a .SPL for this.  (Well, unless you set it up as a repeating effect, which would be fairly easy but probably would add unnecessary computational overhead.)

Setting the 318 effect to block the whole .ITM file will work, but if the .ITM has any other effects then those will be blocked as well. 

What I was trying to get across was:

  • ITM: 318 effect blocking a spell named "myspell.spl" if the condition is not met
  • ITM: 177 effect with a while-equipped .EFF
  • EFF: increases APR with while-equipped timing, and identifies itself as a spell named "myspell."

There is no actual spell named "myspell.spl," but if the .EFF file identifies itself that way (via the values in offsets 0x90 and 0x94), then the .EFF can be blocked by opcodes 206, 318, and 324. In this way you can use opcodes 318/324 for while-equipped item effects, which is usually impossible. (And if you get cute with the condition's negation, you can simulate while-equipped 326 effects.)

EDIT - possibly the reason your test failed is because I was stupid in my first post - of course the 318 effect needs to be before the 177 effect - not after it.  Duh.  My bad!

Edited by subtledoctor
Link to post
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...