Initial MSVC 2008 projects workspace
This commit is contained in:
30
l2ooghelper/packet_handlers/ph_NpcHtmlMessage.cpp
Normal file
30
l2ooghelper/packet_handlers/ph_NpcHtmlMessage.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "stdafx.h"
|
||||
#include "Logger.h"
|
||||
#include "L2Client.h"
|
||||
|
||||
void L2Client::ph_NpcHtmlMessage( class L2Client *pcls, L2GamePacket *p )
|
||||
{
|
||||
p->getPacketType();
|
||||
unsigned int npcObjectID = p->readUInt(); // DO NOT TRUST THIS VALUE
|
||||
const wchar_t *html = p->readUnicodeStringPtr(); // no malloc()
|
||||
unsigned int itemID = p->readUInt();
|
||||
// parse end
|
||||
|
||||
// get NPC info
|
||||
L2Npc *pNpc = NULL;
|
||||
WorldObjectTreeNode node;
|
||||
if( pcls->world_tree.GetInfoByObjectID( npcObjectID, &node ) )
|
||||
{
|
||||
if( node.getObjectType() == L2OT_NPC )
|
||||
{
|
||||
int idx = node.getArrayIdx();
|
||||
pNpc = pcls->world_npcs.npcs_array[idx];
|
||||
}
|
||||
}
|
||||
|
||||
// set copy of last NPC html to script engine to allow script to talk to NPCs
|
||||
pcls->getInterface()->set_last_NPC_HTML( html, pcls->usr.targetObjectID );
|
||||
|
||||
// display UI dialog
|
||||
pcls->npcHtmlDlg->displayNPCHTML( html, pNpc, itemID, 0 );
|
||||
}
|
Reference in New Issue
Block a user