Gxz Posted May 11, 2010 Posted May 11, 2010 Ok guys i need a code that removes your armor when you make subclass.. i guess it must be here in L2VillageMasterInstance player.setActiveClass(paramOne); content.append("Change Subclass:<br>Your active sub class is now a <font color=\"LEVEL\">" + CharTemplateTable.getClassNameById(player.getActiveClass()) + "</font>."); player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_TRANSFER_COMPLETED)); // Transfer completed. and for (L2Effect e : player.getAllEffects()) is for buffs, whats for armor?
0 B1ggBoss Posted May 11, 2010 Posted May 11, 2010 player.getInventory().unEquipItemInSlot(int slot) You can get all slots numbers from com.l2jserver.gameserver.itemcontainer.Inventory (they are final int fields) you may need to broadcast char & userinfo
0 Gxz Posted May 11, 2010 Author Posted May 11, 2010 player.getInventory().unEquipItemInSlot(int slot) You can get all slots numbers from com.l2jserver.gameserver.itemcontainer.Inventory (they are final int fields) you may need to broadcast char & userinfo so what slot is for armor(chest), cant find this thing: com.l2jserver.gameserver.itemcontainer.Inventory
0 xAddytzu Posted May 11, 2010 Posted May 11, 2010 L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
0 Gxz Posted May 11, 2010 Author Posted May 11, 2010 L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); this just gets it doesnt disarm it..
0 xAddytzu Posted May 11, 2010 Posted May 11, 2010 L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); if (chest != null) { L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart()); InventoryUpdate iu = new InventoryUpdate(); for (L2ItemInstance element : unequipped) iu.addModifiedItem(element); sendPacket(iu); }
0 Gxz Posted May 11, 2010 Author Posted May 11, 2010 L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); if (chest != null) { L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart()); InventoryUpdate iu = new InventoryUpdate(); for (L2ItemInstance element : unequipped) iu.addModifiedItem(element); sendPacket(iu); } and where i paste this?
0 Gxz Posted May 11, 2010 Author Posted May 11, 2010 setActiveClass method from PcInstance ok done, works perfect. Thanks another one time xAddytzu! Request to lock.
Question
Gxz
Ok guys i need a code that removes your armor when you make subclass.. i guess it must be here in L2VillageMasterInstance
player.setActiveClass(paramOne);
content.append("Change Subclass:<br>Your active sub class is now a <font color=\"LEVEL\">"
+ CharTemplateTable.getClassNameById(player.getActiveClass()) + "</font>.");
player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_TRANSFER_COMPLETED)); // Transfer completed.
and
for (L2Effect e : player.getAllEffects()) is for buffs, whats for armor?
9 answers to this question
Recommended Posts