int NpcScript::luaGetPlayerLevel(lua_State* L)
{
const char* name = lua_tostring(L, -1);
lua_pop(L, 1);
Npc* mynpc = getNpc(L);
Creature* creature = mynpc->game->getCreatureByName(name);
Player* player = creature? dynamic_cast<Player*>(creature) : NULL;
if (player)
lua_pushnumber(L, player->getLevel());
else
lua_pushnumber(L, -1);
return 1;
}