Shield and Twohander BP

09/06/2011 02:45 Andrew.A#1
When I wear a 2hander I get double BP from it, when I wear a wear a shield it says the double bp is gone but it is still there as hidden bp when you whisper.


Code:
                if (ID / 1000 == 421 || PacketHandler.IsTwoHand(ID))
                {
                    
                    potBase *= 2;
                    
                }
                return potBase
That is the code that doubles the BP, I tried multiple things but none worked

How could i fix this?
09/06/2011 03:13 marlyandedsel#2
IF you wear Two-handed weapon you will get times 2 of the bp of the weapon, but if you wear Two-handed weapon together with shield of course the two handed weapon will be now consider as 1 handed weapon(even though it is Two-Handed) so that you can wear the shield so the double bp of it will be gone its now consider as 1 handed........ :) hope you understand that.
09/06/2011 04:15 Andrew.A#3
I get it, but the fact is that it isn't gone. It shows when I whisper but when I examine gears it doesn't show.
09/06/2011 06:05 pro4never#4
Right in that code you are saying if I'm wearing a 2 hander or backsword double my bp from that item... you NEED to check what's in the other hand. it an item is equipped into it then do not double your bp.

If anything exists in 2nd hand then do not double bp from first hand.


Simple as that.
09/06/2011 13:37 Andrew.A#5
This is what I tried before and it didn't make a difference. I know I needed to add a check but whatever I try doesn't seem to work

Code:
if (ID / 1000 == 421 || PacketHandler.IsTwoHand(ID))
                {
                   If (LeftWeapon / 1000 != 900)
                    {
                    potBase *= 2;
                    }
                }
                return potBase
09/06/2011 16:03 pro4never#6
When is left weapon considered 900? What I would be more likely to check for would be...

if(LeftWeaponType == Backsword || LeftWeaponType == Twohander/Bow)
if(LefWeapon == null (or zero as it seems you are using item id and not item structure) || IsArrow(LeftWeapon)
basePot *= 2;

That way you first check if ANYTHING exists in second slot. If nothing exists there you KNOW you can do your double pot

Then check if the item in 2nd slot is an arrow type item. If it IS an arrow you can STILL do your double pot.
09/06/2011 23:24 Andrew.A#7
Ive tried the whole if(LeftWeapon ==0) before and I get Unreachable code detected