OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osNpcSetProfileImage C# (CSharp) Method

osNpcSetProfileImage() public method

public osNpcSetProfileImage ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString npc, string image ) : void
npc OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
image string
return void
        public void osNpcSetProfileImage(LSL_Key npc, string image)
        {
            CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage");
            m_host.AddScriptLPS(1);

            INPCModule module = World.RequestModuleInterface<INPCModule>();
            if (module != null)
            {
                UUID npcId = new UUID(npc.m_string);

                if (!module.CheckPermissions(npcId, m_host.OwnerID))
                    return;

                UUID ImageID = new UUID();

                ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture);

                if (ImageID == null || ImageID == UUID.Zero)
                {
                    if (!UUID.TryParse(image, out ImageID))
                        return;
                }

                ScenePresence sp = World.GetScenePresence(npcId);
                if (sp != null)
                    ((INPC)(sp.ControllingClient)).profileImage = ImageID;
            }
        }
OSSL_Api