Jump to content

Opcode 326 for Kits


Aquadrizzt

Recommended Posts

So I'm curious how the functionality of Opcode 326 (Apply Effects List) interacts with parameter 2 = 109 (Kit bit eq param1).

 

I added an effect to a shared clab file, with the Opcode 326 targeting one of the kits using the clab file. Curiously, I found that the effect (an armor class bonus effect) was applied to both the targeted kit and the untargeted kit.

 

I'm wondering if there was something special about how the "bit eq" (as opposed to regular equality) affects the ability to recognize specific kits.

Link to comment

The good thing is that you can define your own checks simply by adding a new line to SPLPROT.2DA.

If you want to compare the KIT value on numeric level you can simply duplicate the respective line in SPLPROT.2DA with a new operator:

            STAT  VALUE   RELATION
KIT_EQ      152   -1      1         <- Translation: STAT KIT = Parameter 1

 

You can also create new and creative target checks. Let's say you only want to affect targets with a certain proficiency level in Katanas? Then add the following line to SPLPROT.2DA:

            STAT  VALUE   RELATION
PROFKATANA  94    -1      4         <- Translation: STAT PROFICIENCYKATANA >= Parameter 1

and set the minimum proficiency value in Parameter 1 of opcode 326. (You may have to use a binary operator to consider dual classed characters as well.)

(The tricky part is to determine the index of the added line so you can update Parameter 2 of opcode 326 accordingly.)

Link to comment

Off-topic, it seems we could use this to make checks for "stat = X" instead of "stat >= X"... that way for something like monks' WIS-based AC bonus, it would only ever have to cast one spell per round, regardless of your WIS score.

 

(The tricky part is to determine the index of the added line so you can update Parameter 2 of opcode 326 accordingly.)

That should be a simple matter of COUNT_2DA_ROWS at the time you append your new line to splprot.2da... no?
Link to comment

You can even group entries by using stat 0x103 (match x and y) or negate the group with stat 0x104 (match all except x and y). Or combine several 0x103 or 0x104 entries to create even more complex groups. This feature is very powerful if used right.

(The tricky part is to determine the index of the added line so you can update Parameter 2 of opcode 326 accordingly.)

That should be a simple matter of COUNT_2DA_ROWS at the time you append your new line to splprot.2da... no?

Yes, and for existing entries scanning the table for regular expression matches should work.

Link to comment

Wow, I didn't realize how flexible and powerful Opcode 326 was until now. I figured out a solution to the problem that prompted me to ask already, but I'm definitely already contemplating ways I can use stat checks in my various mods.

Link to comment

The spell protection system cannot use local variables. It can use ALL stats and spell states. Splprot.2da has no string fields to give the variable name and this didn't seem to be important with all the stats/states already available.

Link to comment

I'm pretty sure you can set it up for a chr >=18 safely. Also, obviously none of the spell protection checks are 'permanent' since they are checked once, when the effect is being applied.

If you want a condition to be continuously checked, you need to run periodic applies with each effect's duration the same as the checking periods (much like bard songs work).

Link to comment

Archived

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

×
×
  • Create New...