me again
Affected cores:
both 096 and 097, all versions, only when using >=aos accounts
bug:
when you trade an item to someone, pol does not send the 0xD6 packet relative to the item's name.
for example:
A trades B "a robe"
in the trade window A sees the name "a robe" when single clicking it, B does not see the name when clicking.
this happens because if the client has not seen this item before, pol does not send the item name (the aos way) when showing it in the secure trade window
here is how i fixed it with packethooks. downside is that packet is sent to both client (one of them does not really need the data) but that's not a great problem
Code:
//Packet Hook for Secure Trade fix with AOS Tooltips
Packet 0x25
{
Length 20
SendFunction packethooks:s_AddSingleItemToContainer
}
Code:
exported function s_AddSingleItemToContainer(char, byref packet)
if((char.acct.uo_expansion == "AOS") || (char.acct.uo_expansion == "SE") || (char.acct.uo_expansion == "ML"))
var container := SystemFindObjectBySerial(packet.getint32(14));
if (container.objtype==0xFF01)
var seriale := packet.getint32(1);
var item := SystemFindObjectBySerial(seriale);
var i;
// conversion from string to unicode array
var name:=cascz(item.desc);
for (i:=1;i<=name.size();i:=i+1)
name[i]:=CInt(name[i])*256;
endfor
//Size precalculated because of a bug in variable length packets ?
var size:=25+((name.size())*2);
var tooltip:=CreatePacket(0xD6, size);
tooltip.setint16(3,1);
tooltip.setint32(5,Cint(seriale));
tooltip.setint16(9,0);
tooltip.setint32(11,1);
tooltip.setint32(15,1042971); // constant for POL's tooltip?
tooltip.setint16(19,((name.size())*2));
tooltip.setunicodestring(21,name,0);
tooltip.setint32(size,0);
tooltip.setint16(1,size);
tooltip.sendpacket(char);
endif
endif
return 0;
endfunction