Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: Java  |  size: 2.56 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. protected final void writeImpl()
  2.         {
  3.                 writeC(0x30);
  4.         writeD(_objId);
  5.         writeC(_showWindow ? 0x01 : 0x00);
  6.         int count = Math.min(_items.length, ServerConstants.getInstance().getMaxItemCount());
  7.                 writeD(count);   // item count
  8.  
  9.                 for (ItemInstance temp : _items)
  10.                 {
  11.             if (count-- == 0)
  12.             {
  13.                 break;
  14.             }
  15.  
  16.                         if ((temp == null) || (temp.getItem() == null))
  17.             {
  18.                 writeD(0);
  19.                                 continue;
  20.             }
  21.  
  22.             temp.checkMarkTime();
  23.                        
  24.             writeD(temp.getObjectId());
  25.                         writeD(temp.getItemId());
  26.  
  27.                         writeC(temp.getItem().getType1()); // item type1
  28.                         writeC(temp.getItem().getType2());      // item type2
  29.  
  30.             writeD(temp.getCount());
  31.                         writeC(temp.isEquipped() ? 0x01 : 0x00);
  32.                         //writeD(temp.getItemIdByObjId().getBodyPart());
  33.             int slot = Inventory.getSlotFromItem(temp);
  34.  
  35.             writeD(slot);
  36.             writeH(temp.getDurability()); // durability
  37.             writeH(temp.getMaxDurability());
  38.             writeH(temp.calcMaxDurability());
  39.  
  40.             writeC(temp.getTrimmedEnhanceLevel(true));
  41.             writeBool(temp.isPoweredByBattery());
  42.  
  43.             writeC(temp.isMarked() ? (temp.isRent() ? -1 : 1) : 0);
  44.             if (temp.isMarked()) {
  45.                 writeS(temp.getMarkerOwnerName());
  46.                 writeD(temp.getMarkTimeLeft());
  47.             }
  48.             writeC(temp.getEnhanceLevel());
  49.            
  50.             GiftInfo giftInfo = temp.getGiftInfo();
  51.             if(giftInfo != null) {
  52.  
  53.                 writeC(giftInfo.getGiftType().ordinal());
  54.                 writeS(giftInfo.getGifterName());
  55.             }
  56.             else {
  57.                 writeC(-1);
  58.             }
  59.  
  60.             int countModules = temp.getCountInstallModules();
  61.             writeH(countModules);
  62.             if(count > 0){
  63.                 for(int i = 0; i<countModules; i++){
  64.                     ItemInstance module = new ItemInstance(222222222, 3333);
  65.                     writeD(module.getObjectId());
  66.                     writeD(module.getItemId());
  67.                     writeC(module.getItem().getType1()); // item type1
  68.                     writeC(module.getItem().getType2());        // item type2
  69.                     writeD(Inventory.getSlotFromItem(module));
  70.                     writeH(module.getDurability()); // durability
  71.                     writeH(module.getMaxDurability());
  72.                     writeH(module.getInstallSlot());
  73.                     writeD(module.getInstalledOn());
  74.                 }
  75.             }
  76.  
  77.         }
  78.         }