From d4e285b1a1da036220d9b3a7141ebe1b865c5d35 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Dec 2016 17:05:02 +0000 Subject: add osNpcSetProfileAbout(LSL_Key npc, string about) to set NPCs profile About text. requires OsNpcCreate rights --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 +++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 25 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 19f2d09..b101cf9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2999,6 +2999,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void osNpcSetProfileAbout(LSL_Key npc, string about) + { + CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + m_host.AddScriptLPS(1); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + UUID npcId = new UUID(npc.m_string); + + if (!module.CheckPermissions(npcId, m_host.OwnerID)) + return; + + ScenePresence sp = World.GetScenePresence(npcId); + if (sp != null) + ((INPC)(sp.ControllingClient)).profileAbout = about; + } + } + public void osNpcSay(LSL_Key npc, string message) { osNpcSay(npc, 0, message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 5ce859e..87b0967 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -343,6 +343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces rotation osNpcGetRot(key npc); void osNpcSetRot(LSL_Key npc, rotation rot); void osNpcStopMoveToTarget(LSL_Key npc); + void osNpcSetProfileAbout(LSL_Key npc, string about); void osNpcSay(key npc, string message); void osNpcSay(key npc, int channel, string message); void osNpcShout(key npc, int channel, string message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index c5cb88e..5bc998e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -637,6 +637,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osNpcStopMoveToTarget(npc); } + public void osNpcSetProfileAbout(LSL_Key npc, string about) + { + m_OSSL_Functions.osNpcSetProfileAbout(npc, about); + } + public void osNpcSay(key npc, string message) { m_OSSL_Functions.osNpcSay(npc, message); -- cgit v1.1