Tooltip packet
Posted: Thu Mar 12, 2009 2:05 am
Hi,
I hooked the 0xD6 packet in order to do custom tooltips, like so:
I specifically did it to change the colour of the item's name in the tooltip, according to its quality. And this works great in 2D and 3D. However, in 3D, the vendor shopping lists display the items, but with the code used to recolor them. In other words, in 2D the item's display correctly in the shopping list WITH their right colors, but in 3D they look like this:
Here is how I change the colour of the name, at the moment:
(Obviously I removed all the specific case statements etc from the above example)
I hooked the 0xD6 packet in order to do custom tooltips, like so:
Code: Select all
Packet 0xD6
{
Length variable
SendFunction toolTips:MegaCliloc
}
However, once you buy it, the tooltip is fine in the bag. It's just the shopping list that's stuffed-up. (see reply post for a screenshot).<BASEFONT COLOR=#FFFFFF><C>Kite Shield
Here is how I change the colour of the name, at the moment:
Code: Select all
use uo;
use cfgfile;
const OFFSET_OBJECT_SERIAL := 0x05;
const OFFSET_CLILOC_ID := 0x0F;
const OFFSET_LENGTH_ID := 0x13;
const OFFSET_UNICODE_TEXT := 0x14;
program Install()
print("INSTALLING: Outgoing Tooltip PH...");
return 1;
endprogram
exported function MegaCliloc( who, byref packet )
var xObject := SystemFindObjectBySerial(packet.GetInt32(OFFSET_OBJECT_SERIAL));
if ( xObject )
packet.SetSize(15);
var Text_Color;
var Object_Name;
Object_Name := xObject.desc;
Text_Color := "FFFFFF";
Object_Name := CAscZ("<BASEFONT COLOR=#" + Text_Color + "><C>" + Object_Name);
packet.SetInt32(OFFSET_CLILOC_ID, 1042971);
packet.SetUnicodeString(OFFSET_UNICODE_TEXT, Object_Name, 1);
packet.SetInt16(OFFSET_LENGTH_ID, Object_Name.Size() * 2);
packet.SetInt32(packet.GetSize(), 0);
endif
return 0;
endfunction

