Jump to content

Opcode 301: Critical Hit modifier


kreso

Recommended Posts

My 2 cents: saves should be determined by the *effect* - not by the *source* of the effect.

 

So:

- elemental/area effects = save vs. breath. (E.g. Fireball - whether from a spell it a wand.)

- mental or "pure magic" effects like Hold or Charm or illusions = save vs. spells

- transformational effects like petrify/polymorph = save vs. petrify/polymorph (duh)

- health effects like death magic or poison = save vs. death/poison.

 

I couldn't figure out what kind of effects to use saves vs. wands for... but in the back of my mind I was definitely thinking it would be nice to leave it open for some other mod to take advantage of. Using them for this kind of on-hit weapon effect fits the bill nicely.

 

Alternatively, it might make sense to use saves vs. breath for these effects. Something like dodging/twisting out of the way.

I think it would be nice if players had to concern themselves with wand saves. This doesn't really seem to be the case if the ai doesn't really use wands (though, kreso's idea re wand changes sounds interesting). But the ai will, at least, make general attacks with weapons, and so my thought is, why not use wands. It would be nice if that stat meant something...

 

*looking around*

This thread really seems like it should be in the mod discussion forum...

Link to comment

I hope that kreso won't mind me highjacking his thread for a little while. I want to share some research on Opcode 301 that I inadvertently did.

 

Fun fact #1. If a char has a permanent Opcode 301 set (via AP_* ability, for instance), and later another permanent 301 effect is applied, it takes precedence. I.e., if character had critical range on a roll of 18-20 with the first effect, whatever is the new effect (19-20, for example), it'll take over. Sounds pretty logical.

 

Fun fact #2. I have two chars, one with critical range of 19-20 and another one with 17-20, both applied via opcode 301 in a permanent manner. They both have a weapon that sets the 301 opcode with the value of 2 (i.e., critical range of 18-20) when equipped. Result: both chars still strike a critical with the chance provided by their permanent 301 opcode (17-20 in case of one and 19-20 in case of another). OK, this still might appear to be logical, permanent effect takes precedence over a temporary one.

 

If neither of characters have a permanent 301 opcode then the weapon works properly and they strike a critical on a roll of 18-20.

 

What I don't understand is how, in that case, the Critical Strike ability manages to override characters' embedded 301 opcode for the spell duration? What am I missing here?

 

PS: everything written above tested extensively on BG2:EE, didn't do any tests in ToB

 

EDIT: one more thing that I completely forgot about earlier when I was writing this post. I have no idea either how would all that is described above behave in case of two-handed or single weapons. Proficiency in those weapon styles gives characters a bonus to critical range. I only know that it is hard-coded in ToB and exported to a 2da table with values in EE. Beyond that, I did no tests.

Link to comment

What I don't understand is how, in that case, the Critical Strike ability manages to override characters' embedded 301 opcode for the spell duration? What am I missing here?

 

PS: everything written above tested extensively on BG2:EE, didn't do any tests in ToB

 

EDIT: one more thing that I completely forgot about earlier when I was writing this post. I have no idea either how would all that is described above behave in case of two-handed or single weapons. Proficiency in those weapon styles gives characters a bonus to critical range. I only know that it is hard-coded in ToB and exported to a 2da table with values in EE. Beyond that, I did no tests.

Critical Strike HLA thingie is probably due to the fact it's a spell. I once created (substituted Imp.Haste, to be exact) a spell that granted +5 to critical roll, and it worked by overriding any weapons that gave critical strike bonus. So I'd say it's tied to the fact that spell takes predecence over an item ability, at least in this case.

 

Iirc, the critical range bonus from weapon styles is the only way you can actually stack these bonuses (a keen weapon + AP_***/spell won't stack, but single-weapon style + keen weapon/AP should I think). How it works on EE I don't know.

It would be interesting to check if your AP_**** ability would work differently if you'd code it so when gained it casts a spell on character that grants +x to critical roll.

 

Just checked - yes, weapon style bonus unlike anything else does stack with other sources.

 

By "spell" I mean a spell, not an AP_ ability.

Link to comment

OK, did more tests with weapon proficiencies.

 

Char, no innate pre-set bonus to critical range via AP_*. One star in single weapon proficiency. Does crit on a roll of 19-20. Grabs a weapon with opcode 301, parameter1 value of 2 (18-20). Now the critical happens on a roll of 17-20.

 

Now the char gets a permanent 301 code via a spell applied on him. It is a spl resource that has 301 opcode with targeting mode set to 9 (permanent), cast on char by a creature via ReallyForceSpellRES. Now the char always does a critical on a roll of 18-20, be at a weapon with a 301 opcode or not. The weapon choice has no effect anymore on the overall critical range, because the char has gotten his "permanent setting" for the critical range.

 

Conclusions: whatever the weapon proficiency does is treated like a modifier to "base" critical bonus. I.e., it gets to a base value of 19 instead of 20. All other applications of the 301 opcode result in deduction of parameter1 value from that new base of 19. The rest of what was written above by me still seem to apply as described.

 

 

It would be interesting to check if your AP_**** ability would work differently if you'd code it so when gained it casts a spell on character that grants +x to critical roll.

 

You mean use an opcode that casts spell instead of straight-up application of 301 opcode? As you can see from description above, this is how the new permanent bonus is applied. I think that no matter how the char receives his permanent bonus, the last one applied would be the one used by the game (and stacked with weapon proficiency, as proved by the tests above).

 

The Critical Strike spell works on top of any permanent bonus that the char may already have. It is applied by a spell, becomes the last one applied and treated by the game as the new critical range value, even if it's only for a round of duration. Timing mode is the only difference that Critical Strike and the spell I described above have.

 

I did the test. Gave Critical Strike long duration (6k seconds), char started to crit on any attack roll. Then, the spell I described above was applied and the char has lost his ability to do crit on any roll and started doing it on a roll of 19 to 20 (with two weapons equipped), on a roll of 18 to 20 with single weapon (due to a star in respective style). The Critical Strike mattered no more even though it was still technically active.

 

EDIT: once again, this is only tested on BG2:EE

Link to comment

Char, no innate pre-set bonus to critical range via AP_*. One star in single weapon proficiency. Does crit on a roll of 19-20. Grabs a weapon with opcode 301, parameter1 value of 2 (18-20). Now the critical happens on a roll of 17-20.

 

Now the char gets a permanent 301 code via a spell applied on him. It is a spl resource that has 301 opcode with targeting mode set to 9 (permanent), cast on char by a creature via ReallyForceSpellRES. Now the char always does a critical on a roll of 18-20, be at a weapon with a 301 opcode or not. The weapon choice has no effect anymore on the overall critical range, because the char has gotten his "permanent setting" for the critical range.

 

Conclusions: whatever the weapon proficiency does is treated like a modifier to "base" critical bonus. I.e., it gets to a base value of 19 instead of 20. All other applications of the 301 opcode result in deduction of parameter1 value from that new base of 19. The rest of what was written above by me still seem to apply as described.

sounds buggy, the weapon style bonus should always apply. Did you reequip the weapon in the second paragraph?

Link to comment

Yes, I did. When the char has gotten a permanent 301 bonus from spell, I de-equipped a weapon with 301 opcode and equipped a plain one. Tested that a critical happened on a roll of 18-20. Then I equipped a weapon with 301 code and tested that the critical still happens on a roll of 18-20 (i.e., the weapon's bonus gets discarded due to a permanent one being present).

Link to comment

Yes, that sounds rather sensible. I suspect that in case of IE, nobody initially had any plans for extra bonuses to critical range. They just kinda piled up changes upon changes, which eventually led to all this weird behaviour. Something is probably hardcoded somewhere as it usually happens in cases such as this :)

 

I did one more test. If a character has two weapons with the 301 opcode, only one bonus applies. I.e., two weapons with +2 bonus to range for critical do not stack, char makes a crit only a roll of 18-20. I haven't tested the order of application, though, but it probably plays out in accordance with the order of effect application listed somewhere in IESDP.

 

By the way, in EE, Beamdog has extended the 301 opcode, it can also apply only to the weapon equipped, not always. I wonder how that functions. Probably, the logic described above still remains and the critical range happens only for the weapon if there are no other 301 opcodes present on the character.

Link to comment

Just telling, EE has a separate opcode for critical effects (361) . Also, 301 opcode works exactly as before if used with 0 as param2.

It works with 'current weapon' (param2 = 1) because the effect 'knows' the current weapon slot.

Link to comment

 

 

Just telling, EE has a separate opcode for critical effects (361) .

You mean, effects that fire when character scores a critical? Does it function as the 177 opcode? Is there a definition somewhere (IESDP only goes up to 321)?

Link to comment

Archived

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

×
×
  • Create New...