Itemdesc Hook
Posted: Sat Sep 01, 2007 1:26 am
it is possible to change color of displayed text over item when i 1xClick Left mouse button ? ( without tooltip)
https://www.forums.polserver.com/
Code: Select all
Packet 0x09
{
Length 5
ReceiveFunction singleclick:singleclickhook
}
Code: Select all
use uo;
program singleclick ( )
print("Hooking singleclickpacket");
return 1;
endprogram
exported function singleclickhook( who, byref packet )
// Packet contains only the serial
var object := SystemFindObjectBySerial(packet.GetInt32(1));
if (object.isa(POLCLASS_ITEM))
// So player clicked an item. Change text color to item's color.
// Of course color can be anything, this is just an example.
var color := object.color;
PrintTextAbovePrivate(object, object.desc, who, _DEFAULT_TEXT_FONT, color);
// --> player clicks green axe, he/she will get 'an axe' with green color.
// Return 1 so core won't react.
return 1;
endif
// If it was not an item, core will do.
return 0;
endfunction