l2c_getObjectInfoByObjectId(): return also char/npc/mob title

This commit is contained in:
alexey.min
2012-05-12 19:57:40 +00:00
parent 0506593508
commit 3d260cdc41

View File

@@ -222,6 +222,10 @@ int l2c_getObjectInfoByObjectId( lua_State *L )
sprintf( ansi, "%S", chars_array[idx]->charName );
lua_pushstring( L, ansi );
lua_settable( L, -3 );
lua_pushstring( L, "title" );
sprintf( ansi, "%S", chars_array[idx]->charTitle );
lua_pushstring( L, ansi );
lua_settable( L, -3 );
//
lua_pushstring( L, "curHp" );
lua_pushnumber( L, chars_array[idx]->curHp );
@@ -280,6 +284,10 @@ int l2c_getObjectInfoByObjectId( lua_State *L )
sprintf( ansi, "%S", npc_array[idx]->charName );
lua_pushstring( L, ansi );
lua_settable( L, -3 );
lua_pushstring( L, "title" );
sprintf( ansi, "%S", npc_array[idx]->charTitle );
lua_pushstring( L, ansi );
lua_settable( L, -3 );
//
lua_pushstring( L, "curHp" );
lua_pushnumber( L, npc_array[idx]->curHp );
@@ -322,7 +330,7 @@ int l2c_getObjectInfoByObjectId( lua_State *L )
lua_settable( L, -3 );
//
lua_pushstring( L, "name" );
char itemName[256] = {0};
char itemName[512] = {0};
L2Data_DB_GetItemNamePicByID( a->gi_array[idx]->itemID, itemName, NULL );
lua_pushstring( L, itemName ); // at last
lua_settable( L, -3 );