Jump to content
  • 0

Question

Posted

Hey i'm trying to make a script on pvp unequip an item.

 

i tried this code it works half the way...

 

            if(activeChar.getPvpFlag() > 0)
            {
                        final L2ItemInstance face = activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FACE);
                        if (face != null)
                        {
                            final L2ItemInstance[] unequipped = activeChar.getInventory().unEquipItemInBodySlotAndRecord(face.getItem().getBodyPart());
                            final InventoryUpdate iu = new InventoryUpdate();
                            for (final L2ItemInstance element : unequipped)
                                iu.addModifiedItem(element);
                            sendPacket(iu);
                            
                        }
            }

1 answer to this question

Recommended Posts

  • 0
Posted

Why the for loop, why item Instance array?

 

Search over sources for the unequip method you find some results, compare code, fix your code, enjoy.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock