/** * Remove an item from equipment, add it to inventory * * @param {object} pkt - PACKET.ZC.REQ_TAKEOFF_EQUIP_ACK */ function onEquipementTakeOff( pkt ) { if (pkt.result) { var item = Equipment.unEquip( pkt.index, pkt.wearLocation); if (item) { item.WearState = 0; var it = DB.getItemInfo( item.ITID ); ChatBox.addText( it.identifiedDisplayName + ' ' + DB.getMessage(171), ChatBox.TYPE.ERROR ); if (!(pkt.wearLocation & EquipLocation.AMMO)) { Inventory.addItem(item); } } if (pkt.wearLocation & EquipLocation.HEAD_TOP) Session.Entity.accessory2 = 0; if (pkt.wearLocation & EquipLocation.HEAD_MID) Session.Entity.accessory3 = 0; if (pkt.wearLocation & EquipLocation.HEAD_BOTTOM) Session.Entity.accessory = 0; if (pkt.wearLocation & EquipLocation.WEAPON) Session.Entity.weapon = 0; if (pkt.wearLocation & EquipLocation.SHIELD) Session.Entity.shield = 0; } }
/** * Remove an item from equipment, add it to inventory * * @param {object} pkt - PACKET.ZC.REQ_TAKEOFF_EQUIP_ACK */ function ItemTakeOff( pkt ) { if( pkt.result ) { var item = Equipment.unEquip( pkt.index, pkt.wearLocation ); if( item ) { item.WearState = 0; var it = DB.getItemInfo( item.ITID ); ChatBox.addText( it.identifiedDisplayName + " " + DB.msgstringtable[171], ChatBox.TYPE.ERROR ); Inventory.addItem(item); } } }