Add osNpcPlayAnimation and osNpcStopAnimation which respect ownership as well
parent
1cffd8fa03
commit
9668992493
|
@ -888,6 +888,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation");
|
||||||
|
|
||||||
|
AvatarPlayAnimation(avatar, animation);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AvatarPlayAnimation(string avatar, string animation)
|
||||||
|
{
|
||||||
UUID avatarID = (UUID)avatar;
|
UUID avatarID = (UUID)avatar;
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -921,6 +926,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation");
|
||||||
|
|
||||||
|
AvatarStopAnimation(avatar, animation);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AvatarStopAnimation(string avatar, string animation)
|
||||||
|
{
|
||||||
UUID avatarID = (UUID)avatar;
|
UUID avatarID = (UUID)avatar;
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -2332,6 +2342,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osNpcPlayAnimation(LSL_Key npc, string animation)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osPlayAnimation");
|
||||||
|
|
||||||
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (module != null)
|
||||||
|
{
|
||||||
|
UUID npcID = new UUID(npc.m_string);
|
||||||
|
if (module.IsNPC(npcID))
|
||||||
|
{
|
||||||
|
UUID ownerID = module.GetOwner(npcID);
|
||||||
|
if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
|
||||||
|
AvatarPlayAnimation(npcID.ToString(), animation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcStopAnimation(LSL_Key npc, string animation)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation");
|
||||||
|
|
||||||
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (module != null)
|
||||||
|
{
|
||||||
|
UUID npcID = new UUID(npc.m_string);
|
||||||
|
if (module.IsNPC(npcID))
|
||||||
|
{
|
||||||
|
UUID ownerID = module.GetOwner(npcID);
|
||||||
|
if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
|
||||||
|
AvatarStopAnimation(npcID.ToString(), animation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Save the current appearance of the script owner permanently to the named notecard.
|
/// Save the current appearance of the script owner permanently to the named notecard.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -185,6 +185,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
void osNpcSit(key npc, key target, int options);
|
void osNpcSit(key npc, key target, int options);
|
||||||
void osNpcStand(LSL_Key npc);
|
void osNpcStand(LSL_Key npc);
|
||||||
void osNpcRemove(key npc);
|
void osNpcRemove(key npc);
|
||||||
|
public void osNpcPlayAnimation(LSL_Key npc, string animation);
|
||||||
|
public void osNpcStopAnimation(LSL_Key npc, string animation);
|
||||||
|
|
||||||
LSL_Key osOwnerSaveAppearance(string notecard);
|
LSL_Key osOwnerSaveAppearance(string notecard);
|
||||||
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
|
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
|
||||||
|
|
|
@ -553,6 +553,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osNpcRemove(npc);
|
m_OSSL_Functions.osNpcRemove(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osNpcPlayAnimation(LSL_Key npc, string animation)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcPlayAnimation(npc, animation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcStopAnimation(LSL_Key npc, string animation)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcStopAnimation(npc, animation);
|
||||||
|
}
|
||||||
|
|
||||||
public LSL_Key osOwnerSaveAppearance(string notecard)
|
public LSL_Key osOwnerSaveAppearance(string notecard)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
||||||
|
|
Loading…
Reference in New Issue