Yeah, I was dealing with that, but "70 m_equippedItemInvTypes " show no use in my experience. Attributes had a more protagonic role than I though...
The basic "shoot" spell have:
SPELL_ATTR0_REQ_AMMO = 0x00000002
SPELL_ATTR0_ABILITY = 0x00000010
SPELL_ATTR0_CAST_TRACK_TARGET = 0x00400000
wich, combined as a bitmask, looks like this: 0x400012
So, i remove the first one (0x2) (because that was using the ammo sheet and forcing to loot at the ranged weapon slot) and I have this one:
SPELL_ATTR0_DONT_AFFECT_SHEATH_STATE = 0x00040000
Now the spell looks good, but it's still a little buggy: if you doesn't have the weapon in your hands, your character will do the shoot animation without it.
So I try to add this:
SPELL_ATTR0_ON_NEXT_SWING_2 = 0x00000400
Works pretty well with the bow animation, but the swing interrupts it in the bow and crossbow, so I made a dummy spell with this only attribute in solitary, go to spell_linked_spell in World's SQL folder and associate the dummy spell with the new shoot.
Now the only issues are:
- There's not auto attack
- The proyectile of the shoot borns from a almost random place than from the tip of the gun.
- Some combinations of gender/race have more visual issues than others.
PS: Of course, I merge all double handed weapons (mace, axe, sword) as a single subtype and I use the other two as Shoot Weapon (crossbow/rifle) and Bow.
PS2:
Bitmask for bow (with 0x400): 0x440410
Bitmask for crossbow and rifle (without 0x400): 0x440010