Jump to content

Using negative numbers in Effect Parameters (THAC0 penalty)


khelban12

Recommended Posts

Greetings.

 

Is there a way to use negative numbers in effect parameters ? Maybe i have done some silly mistake (i have zero modding experience) but i cannot get THAC0 penalties to work. Let me describe what i want to do.

 

I tried to modify the Called Shot ability that the Archer kit gets and give it different abilities and also extend it beyond L16. The abilities i chose work fine but i cannot grant a THAC0 penalty. I wanted to do that because, in PnP, when a CS is activated, there is a penalty (i think -4) to signify the greater difficulty of aiming the specific body part and an additional penalty on top of that if the part is small (like an eye).

 

The Archer kit achieves very low THAC0 so maybe the penalty will not make any difference but i would like to do it. I thought to give -2 THAC0 penalty per CS ability (-4 at L8, -6 at L12, up to -16 at L32). Because there might be many opcodes for this thing, i opened the spell that grants the archer bonuses (spcl122) to see what opcode it uses. It is the "Stat: THAC0 modifier with Missile Weapons" effect with opcode 167. So i modified the CS spell (spcl121) and added on each extended header a new effect with opcode 167 and parameters target = self, timing = duration, duration = 12, type = 0 (cumulative), modifier = -2 (and -4, -6, etc).

 

The problem is that the negative penalty gets wrapped to a positive bonus. If i enable the extra combat info, for a L10 archer i get:

 

Normal Shot: Bonus 12 (Weapon:1 + Proficiency:3 + Dexterity:4 + Racial:1 + Missile:3)

Called Shot: Bonus 264 (Weapon:1 + Proficiency:3 + Dexterity:4 + Racial:1 + Missile:255)

 

After failing to find what i did wrong, i remembered that Whirlwind gives a -4 THAC0 penalty, so i opened it in DLTCEP to see what it does. It has the same effect parameters like mine but with opcode 54 "Stat:THAC0 modifier". I modified CS to use this opcode to test if it works and i see that it doesn't do anything. Normal Shot and Called shot have the same bonus.

 

I also tried the vanilla Whirlwind and it doesn't have any effect either. Both melee and ranged weapons give the same THAC0 before and after Whirlwind. I tried removing all mods and even TobEX but with every combination i get the same result. Whirlwind does not give a penalty.

 

Long Story Short: It seems to me that opcode 54 doesn't have any effect when given negative numbers and opcode 167 wraps to big positive.

 

I doubt that such a widely used ability like Whirlwind is bugged so either i haven't understood the extra combat information correctly and the penalty is there somewhere or it must be my installation's fault (i run BG2 on linux through wine). Has anyone else noticed this behavior before ?

 

Thank you for your time.

Link to comment

Opcode #54 alters base THAC0, you'll see a change in the character sheet but not in the attack rolls in the combat log.

 

It's true that opcode #167 can't be used with a negative value because of the wraparound bug, you need to use negative #278 and positive #285 - thus cancelling each other out for melee attacks - to apply a penalty with missile weapons.

 

Btw. Archer is OP, but -16 THAC0 penalty on CS looks too much. I'd rather nerf their no-save strength drain (it kills certain creatures like the Ravager way too fast).

Link to comment

Thank you for replying.

 

Opcode #54 alters base THAC0, you'll see a change in the character sheet but not in the attack rolls in the combat log.

I knew i misunderstood something. There is indeed a change in the sheet when i enable Whirlwind.

 

It's true that opcode #167 can't be used with a negative value because of the wraparound bug, you need to use negative #278 and positive #285 - thus cancelling each other out for melee attacks - to apply a penalty with missile weapons.

I did it as you say using 278 and 284 and it works perfectly. Thank you. I am sorry i bothered you with such a trivial question but it didn't occur to me that some opcodes accept negative numbers and some do not.

 

Btw. Archer is OP, but -16 THAC0 penalty on CS looks too much. I'd rather nerf their no-save strength drain (it kills certain creatures like the Ravager way too fast).

I do not have strength drain. I didn't like the vanilla effects and i don't remember myself using CS much because of that. Why does it lower the saves vs spell ? The only explanation i can think of is that the spell blocking is done with a hand gesture and the called shot aims for the hands.

 

The effects i have given are:

 

L4 (arm): Same -1 THAC0

L8 (leg): half movement (vanilla effect is named archmov)

L12(elbow): -1 to AC (i cannot justify the elbow-ac combination but i couldn't think of anything else since the vanilla effect is named archslow and slow has pretty much the same behavior as movement rate)

L16(kidney): Stun target for 1 round unless save (vanilla effect is named archstun)

 

L20(Eye): Blind target for 1 round unless save

L24(Throat): Silence target for 1 round unless save

L28(do not know): Dispel magic on target

L32(heart): Kill Target unless save.

 

I got the idea for the new effects from this forum post but the effects Improved Illasera uses were too OP even though i didn't implement the -4 and -6 save penalties that she imposes on the target. I changed them a bit to the ones mentioned above and i am now playtesting them but they still read OP and because they are cumulative i gave the large THAC0 penalty.

 

My goal is, at some point, to make it let the player choose where he wants to aim (something like the spell immunity spell i guess) and then the duration of the effect will be a little longer and it will only have the normal PnP THAC0 penalty.

 

Thank you again for replying.

Link to comment

Archived

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

×
×
  • Create New...