Loading...   

  • Created By VSAB On: 02:42 PM June 09, 2014
  • Link

RoF::structs::ItemSerializationHeader hdr;
	snprintf( hdr.unknown000, sizeof(hdr.unknown000), "%012d", item->ID );
	ss.write((const char*)hdr.unknown000, strlen(hdr.unknown000));
	ss.write((const char*)&null_term, sizeof(uint8));

	hdr.stacksize = stackable ? charges : 1;
	ss.write((const char*)&hdr.stacksize, sizeof(uint32));
	hdr.unknown004 = 0;
	ss.write((const char*)&hdr.unknown004, sizeof(uint32));
	structs::ItemSlotStruct slot_id = TitaniumToRoFSlot(slot_id_in);
	hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items?
	ss.write((const char*)&hdr.slot_type, sizeof(uint8));
	hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot;
	ss.write((const char*)&hdr.main_slot, sizeof(uint16));
	hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff;
	ss.write((const char*)&hdr.sub_slot, sizeof(uint16));
	hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff;
	ss.write((const char*)&hdr.unknown013, sizeof(uint16));
	hdr.price = inst->GetPrice();
	ss.write((const char*)&hdr.price, sizeof(uint32));
	hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
	ss.write((const char*)&hdr.merchant_slot, sizeof(uint32));
	hdr.unknown020 = 0;
	ss.write((const char*)&hdr.unknown020, sizeof(uint32));
	hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
	ss.write((const char*)&hdr.instance_id, sizeof(uint32));
	hdr.unknown028 = 0;
	ss.write((const char*)&hdr.unknown028, sizeof(uint32));
	hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
	ss.write((const char*)&hdr.last_cast_time, sizeof(uint32));
	hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
	ss.write((const char*)&hdr.charges, sizeof(uint32));
	hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0;
	ss.write((const char*)&hdr.inst_nodrop, sizeof(uint32));
	hdr.unknown044 = 0;
	ss.write((const char*)&hdr.unknown044, sizeof(uint32));
	hdr.unknown048 = 0;
	ss.write((const char*)&hdr.unknown048, sizeof(uint32));
	hdr.unknown052 = 0;
	ss.write((const char*)&hdr.unknown052, sizeof(uint32));
	hdr.unknown056 = 0;
	ss.write((const char*)&hdr.unknown056, sizeof(uint32));
	hdr.unknown060 = 0;
	ss.write((const char*)&hdr.unknown044, sizeof(uint32));
	hdr.unknown061 = 0;
	ss.write((const char*)&hdr.unknown061, sizeof(uint8));
	hdr.unknown062 = 0;
	ss.write((const char*)&hdr.unknown062, sizeof(uint8));
	hdr.unknowna1 = 0xffffffff;
	ss.write((const char*)&hdr.unknowna1, sizeof(uint32));
	hdr.unknowna2 = 0;
	ss.write((const char*)&hdr.unknowna2, sizeof(uint32));
	hdr.unknown063 = 0;
	ss.write((const char*)&hdr.unknown063, sizeof(uint8));
	hdr.unknowna3 = 0;
	ss.write((const char*)&hdr.unknowna3, sizeof(uint32));
	hdr.unknowna4 = 0xffffffff;
	ss.write((const char*)&hdr.unknowna4, sizeof(uint32));
	hdr.unknowna5 = 0;
	ss.write((const char*)&hdr.unknowna5, sizeof(uint32));
	hdr.ItemClass = item->ItemClass;
	ss.write((const char*)&hdr.ItemClass, sizeof(uint8));

Raw Paste Data