Implement osNpcSit(). This is still in development so don't trust it

Format is osNpcSit(<npc-uuid>, <target-uuid>, OS_NPC_SIT_IMMEDIATE)
e.g. osNpcSit(npc, llGetKey(), OS_NPC_SIT_IMMEDIATE);
At the moment, sit only succeeds if the part has a sit target set.
NPC immediately sits on the target even if miles away - they do not walk up to it.
This method is in development - it may change so please don't trust it yet.
Standing will follow shortly since that's kind of important once you're sitting :)
This commit is contained in:
Justin Clark-Casey (justincc)
2011-10-17 01:42:31 +01:00
parent bbd0e68c06
commit 0c041ce12f
10 changed files with 75 additions and 5 deletions

View File

@@ -2351,6 +2351,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
{
CheckThreatLevel(ThreatLevel.High, "osNpcSit");
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
module.Sit(new UUID(npc.m_string), new UUID(target.m_string), World);
}
}
public void osNpcRemove(LSL_Key npc)
{
CheckThreatLevel(ThreatLevel.High, "osNpcRemove");

View File

@@ -178,6 +178,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osNpcSetRot(LSL_Key npc, rotation rot);
void osNpcStopMoveToTarget(LSL_Key npc);
void osNpcSay(key npc, string message);
void osNpcSit(key npc, key target, int options);
void osNpcRemove(key npc);
LSL_Key osOwnerSaveAppearance(string notecard);

View File

@@ -600,6 +600,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OS_NPC_NO_FLY = 1;
public const int OS_NPC_LAND_AT_TARGET = 2;
public const int OS_NPC_SIT_IMMEDIATE = 0;
public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";

View File

@@ -528,6 +528,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcSay(npc, message);
}
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
{
m_OSSL_Functions.osNpcSit(npc, target, options);
}
public void osNpcRemove(key npc)
{
m_OSSL_Functions.osNpcRemove(npc);