Page 1 of 1

WS_ShowItemCreation

Posted: Sun Jun 25, 2017 9:24 am
by Ememjr
what is the EQ2_Item type below, how does it show in the packet

Code: Select all

<Struct Name="WS_ShowItemCreation" ClientVersion="1" OpcodeName="OP_ShowItemCreationProcessUIMsg">
<!-- starting durability maybe?-->
<Data ElementName="unknown1" Type="int32" Size="1" />
<Data ElementName="max_possible_progress" Type="int32" Size="1" />
<Data ElementName="unknown2" Type="int32" Size="2" />
<Data ElementName="progress_levels_known" Type="int8" Size="1" />
<Data ElementName="num_process" Type="int16" Size="1" />
<Data ElementName="process_array" Type="Array" ArraySizeVariable="num_process">
  <Data ElementName="progress_needed" Type="int32" Size="1" />
  <Data ElementName="unknown3" Type="int8" Size="1" IfVariableNotSet="progress_needed"/>
  <Data ElementName="item_name" Type="EQ2_16Bit_String" />
  <Data ElementName="item_icon" Type="int16" />
  <Data ElementName="item" Type="EQ2_Item" />
  <Data ElementName="item_byproduct_name" Type="EQ2_16Bit_String" />
  <Data ElementName="item_byproduct_icon" Type="int16" />
  <!-- Another EQ2_Item? Does subtype set to FF prevent the rest of the packet?-->
  <!-- If not an EQ2_item this unknown *might* be quantity-->

Re: WS_ShowItemCreation

Posted: Sun Jun 25, 2017 9:50 am
by Ememjr
I see now its embedding the item packet info within another packet, but its seems the analizer does understand what to do

Re: WS_ShowItemCreation

Posted: Mon Jun 26, 2017 1:30 pm
by John Adams
The PacketAnalyzer should handle substructs okay, unless there is a new mischievous way EQ2 devs have defined data. Some of it has been pretty tricky.

Re: WS_ShowItemCreation

Posted: Mon Jun 26, 2017 3:51 pm
by Jabantiz
EQ2_Item was a type we created to imbed the item examine info into a packet. I do no believe any one ever added support for this type to analyzer though so I have no clue how it will attempt to handle it. Any packet with the EQ2_Item will have to be done by hand for now.

Re: WS_ShowItemCreation

Posted: Mon Jun 26, 2017 3:55 pm
by Ememjr
thats what i figured, this is in the tradeskill stuff, iand i got it figured out i just hope it doesnt break something else

Re: WS_ShowItemCreation

Posted: Mon Jun 26, 2017 3:59 pm
by Ememjr
thats what i figured, this is in the tradeskill stuff, iand i got it figured out i just hope it doesnt break something else in the code below it is duplicating the packet info but it is not supposed to when it sends that item packet embededinthe other packet, i really need to add something to the if statement above it but trying to determine what it affects, so far everthing working as expected

Code: Select all

void PacketStruct::setItem(DataStruct* ds, Item* item, Player* player, int32 index, sint8 offset){
	if(!ds)
		return;
	uchar* ptr = (uchar*)GetStructPointer(ds);
	PacketStruct* packet = item->PrepareItem(client_version);
	int16 item_version = GetItemPacketType(packet->GetVersion());
	if(packet){
		item->serialize(packet, true, player, item_version);
		
		string* generic_string_data = packet->serializeString();
		int32 size = generic_string_data->length();
		if(size <= 13)
			return;
		size -= (9+offset);
		if (item->IsBag() == false && item->IsBauble() == false && item->IsFood() == false && (offset == 0 || offset == -1 || offset == 2))
			size = size;
			//size = (size*2)-5;
		uchar* out_data = new uchar[size+1];
		uchar* out_ptr = out_data;
		memcpy(out_ptr, (uchar*)generic_string_data->c_str() + (9 + offset), generic_string_data->length() - (9 + offset));
		//without these it will prompt for your character name
		if(offset == 0 || offset == -1 || offset == 2){
			out_data[0] = 1;
		}
		//
		out_ptr += generic_string_data->length() - (10 + offset);
		if(item->IsBag() == false && item->IsBauble() == false && item->IsFood() == false && (offset == 0 || offset == -1 || offset == 2)){
			//out_data[4] = 0x80;try to fix TS
			//memcpy(out_ptr, (uchar*)generic_string_data->c_str() + (13 + offset), generic_string_data->length() -(13+offset));try to fix TS
		}
		ds->SetItemSize(size);
		//DumpPacket(out_data, size);
		memcpy(ptr, out_data, size);
		safe_delete_array(out_data);
		delete packet;
	}
	//DumpPacket(ptr2, ds->GetItemSize());
}