Jump to content

Is preventing weapon from using it offhand possible?


SparrowJacek

Recommended Posts

Hey, just like the topic says, I want to introduce a powerful weapon, but I don't want it to be usable as an offhand weapon. I want it to be 1-handed, since it should be a sword usable with shields. Is that possible without some tricky modifications? If it helps, then the weapon should be usable only by a single kit, so maybe there's something that can be done to the kit instead, if changing the weapon does not help?

Link to comment

I tested some item flags ... they didn't seem to help, but there might be something there in combination with other elements.

There is one simple way to keep a weapon out of the off hand: give it item type 57 ("Greatswords") or 69 ("Bastard swords"). That's the field at offset 1c in the .itm file, by the way. No bearing on the proficiency used. Neither of those types is used by any items in the base game, but unlike other weapon types they can only be used in the main hand (enforced by entries in itemtype.2da). If it's a one-handed weapon, it can be used with an off-hand weapon or shield.

This may cause compatibility problems with other mods that use the types, of course.

Link to comment

Yes, that'll come up too; BG2 stores (including bags) generally only accept the item types that are actually used. If you go that route, I recommend patching every STO that "purchases" type 20 "large swords" (or whichever type this item would normally have) to also "purchase" the new type.

Link to comment

A bit more on the item type stuff ...

Most of the "which slot does it go in" rules for item types are hard-coded. The exceptions to this are in itemtype.2da; a nonnegative entry in the "SLOT" column means that the row's item type can only go in the designated slot. Item types 57 and 69 have entries of 35 here, which translates to SLOT_WEAPON and SLOT_WEAPON0 (see slots.ids). In practice that means you can put those types in any of the main-hand weapon slots, but not into the off-hand shield slot. And of course, the general hard-coding means that you're basically stuck with repurposing stuff that's already a "weapon" type rather than creating something new.

Many enemies use the old BG1 proficiency system, which keys off this item type rather than the BG2-style proficiency elsewhere in the .itm. If you're letting an enemy use this (until they're defeated and drop it), make sure they're set up for BG2-style proficiencies (opcode 233 effects) rather than BG1-style proficiencies (nonzero entries in the fields at 0x6e to 0x75).

Link to comment
12 minutes ago, jmerry said:

And of course, the general hard-coding means that you're basically stuck with repurposing stuff that's already a "weapon" type rather than creating something new.

Actually on the EEs, I’m pretty sure you can add entries to itemtype.2da to create new types that can go in the slots of your choosing. (But some hardcoded behaviors cannot be reproduced.)

Link to comment

Respect the flags: I've not bothered to try it myself, but I've always assumed that it is not possible, or someone would have proposed a tweak to make Belm, Kundane or Defender of Easthaven a right-handed weapon only. But if someone finds a combination of them that works, I'll surely would like to use it for exactly that purpose. 😛

That said, there is a workaround that it has not been mentioned (maybe because it's ugly): add a ranged component to the weapon. Thrown axes/daggers can't be equipped in the left hand because of that reason.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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...