18 #include "../clib/clib_endian.h" 19 #include "../clib/rawtypes.h" 36 using namespace Network::PktHelper;
45 if ( item !=
nullptr )
48 if ( !
id.tooltip.empty() )
53 const char*
string =
id.tooltip.c_str();
55 msg->Write<
u16>(
static_cast<u16>( ( *
string++ ) << 8 ) );
57 u16 len = msg->offset;
59 msg->WriteFlipped<
u16>( len );
60 msg.
Send( client, len );
73 pkt_rev.
Send( client );
85 pkt_rev.Send( chr->client );
99 desc = ( !chr->has_title_prefix() ?
" \t" : chr->title_prefix() +
" \t" ) + chr->
name() +
100 ( !chr->has_title_suffix() ?
"\t " :
"\t " + chr->title_suffix() );
101 if ( chr->has_title_race() )
102 desc +=
" (" + chr->title_race() +
")";
103 if ( chr->has_title_guild() )
104 desc +=
" [" + chr->title_guild() +
"]";
106 else if ( vendor_content )
116 msg->WriteFlipped<
u16>( 1u );
119 msg->WriteFlipped<
u32>( obj->
rev() );
121 msg->WriteFlipped<
u32>( 1050045u );
123 msg->WriteFlipped<
u32>( 1042971u );
125 u16 textlen =
static_cast<u16>( desc.size() );
126 if ( ( textlen * 2 ) > ( 0xFFFF - 22 ) )
128 textlen = 0xFFFF / 2 - 22;
130 msg->WriteFlipped<
u16>( textlen * 2u );
131 const char*
string = desc.c_str();
133 while ( *
string && textlen-- )
134 msg->Write<
u16>(
static_cast<u16>( *
string++ ) );
136 u16 len = msg->offset;
138 msg->WriteFlipped<
u16>( len );
139 msg.
Send( client, len );
virtual void Send(Client *client) POL_OVERRIDE
std::string merchant_description() const
Item * find_legal_item(const Character *chr, u32 serial, bool *additlegal, bool *isRemoteContainer)
void Send(Client *client, int len=-1) const
void SendAOSTooltip(Network::Client *client, UObject *obj, bool vendor_content)
unsigned short uo_feature_enable
virtual UObject * toplevel_owner()
SettingsManager settingsManager
static void InVisualRange(const UObject *obj, F &&f)
void handle_request_tooltip(Network::Client *client, PKTIN_B6 *msgin)
bool IsCharacter(u32 serial)
bool isa(UOBJ_CLASS uobj_class) const
const ItemDesc & itemdesc() const
void send_object_cache_to_inrange(const UObject *obj)
void send_object_cache(Network::Client *client, const UObject *obj)
virtual std::string description() const
virtual std::string name() const