add osNpcSetProfileAbout(LSL_Key npc, string about) to set NPCs profile About text. requires OsNpcCreate rights

This commit is contained in:
UbitUmarov
2016-12-06 17:05:02 +00:00
parent 240ab951b5
commit d4e285b1a1
6 changed files with 40 additions and 3 deletions

View File

@@ -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<INPCModule>();
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);

View File

@@ -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);

View File

@@ -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);