Advertisement
NatedogServer

ornaments

Nov 8th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.81 KB | None | 0 0
  1.         hdr.slot = (merchant_slot == 0) ? slot_id : merchant_slot;
  2.         hdr.price = inst->GetPrice();
  3.         hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
  4.         hdr.unknown020 = 0;
  5.         hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
  6.         hdr.unknown028 = 0;
  7.         hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
  8.         hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
  9.         hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0;
  10.         hdr.unknown044 = 0;
  11.         hdr.unknown048 = 0;
  12.         hdr.unknown052 = 0;
  13.  
  14.         if (item->EvolvingLevel > 0) {
  15.             hdr.isEvolving = item->EvolvingLevel > 0 ? 1 : 0; //Send evolve -- Not correct but there is no field for MaxEvolve yet..
  16.             hdr.unknown057 = 0;
  17.             hdr.ornaIcon = 0;
  18.             ss.write((const char*)&hdr, sizeof(Underfoot::structs::ItemSerializationHeader));
  19.            
  20.             Underfoot::structs::EvolvingItem evotop;
  21.             evotop.unknown01 = 0;
  22.             evotop.evoLevel = item->EvolvingLevel;
  23.             evotop.progress = 95.512;
  24.             evotop.Activated = 1;
  25.             evotop.evomaxlevel = 7;
  26.             //evotop.unknown02[0] = 0;
  27.             ss.write((const char*)&evotop, sizeof(Underfoot::structs::EvolvingItem));
  28.  
  29.  
  30.             Underfoot::structs::EvolvingIcon evobottom;
  31.             //ORNAMENT IDFILE / ICON
  32.             if (inst->GetOrnamentationAug(ornamentationAugtype)) {
  33.                 const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
  34.                 ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
  35.                 ss.write((const char*)&null_term, sizeof(uint8));
  36.                 evobottom.evoIcon = aug_weap->Icon;
  37.             }
  38.             else {
  39.                 ss.write((const char*)&null_term, sizeof(uint8));
  40.                 evobottom.evoIcon = 0;
  41.             }
  42.             ss.write((const char*)&evobottom, sizeof(Underfoot::structs::EvolvingIcon));
  43.             ss.write((const char*)&null_term, sizeof(uint8)); //unknown060
  44.        
  45.         }
  46.         else {
  47.             hdr.isEvolving = 0;
  48.             hdr.unknown057 = 0;
  49.  
  50.             if (inst->GetOrnamentationAug(ornamentationAugtype)) {
  51.                 const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
  52.                 hdr.ornaIcon = aug_weap->Icon;
  53.                 ss.write((const char*)&hdr, sizeof(Underfoot::structs::ItemSerializationHeader));
  54.                 ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
  55.                 ss.write((const char*)&null_term, sizeof(uint8));
  56.             }
  57.             else {
  58.                 hdr.ornaIcon = 0;
  59.                 ss.write((const char*)&hdr, sizeof(Underfoot::structs::ItemSerializationHeader));
  60.                 ss.write((const char*)&null_term, sizeof(uint8)); //unknown060
  61.             }
  62.         }
  63.        
  64.         Underfoot::structs::ItemSerializationHeaderFinish hdrf;
  65.         //hdrf.unknown060 = 0; //possibly ornament / special ornament
  66.         hdrf.unknown061 = 0; //possibly ornament / special ornament
  67.         hdrf.isCopied = 0; //Flag for item to be 'Copied'
  68.         hdrf.ItemClass = item->ItemClass;
  69.         ss.write((const char*)&hdrf, sizeof(Underfoot::structs::ItemSerializationHeaderFinish));
  70.  
  71.         if (strlen(item->Name) > 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement