aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c1a700a..efb77ae 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -888,6 +888,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
888 { 888 {
889 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation"); 889 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation");
890 890
891 AvatarPlayAnimation(avatar, animation);
892 }
893
894 private void AvatarPlayAnimation(string avatar, string animation)
895 {
891 UUID avatarID = (UUID)avatar; 896 UUID avatarID = (UUID)avatar;
892 897
893 m_host.AddScriptLPS(1); 898 m_host.AddScriptLPS(1);
@@ -921,6 +926,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
921 { 926 {
922 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation"); 927 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation");
923 928
929 AvatarStopAnimation(avatar, animation);
930 }
931
932 private void AvatarStopAnimation(string avatar, string animation)
933 {
924 UUID avatarID = (UUID)avatar; 934 UUID avatarID = (UUID)avatar;
925 935
926 m_host.AddScriptLPS(1); 936 m_host.AddScriptLPS(1);
@@ -2332,6 +2342,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2332 } 2342 }
2333 } 2343 }
2334 2344
2345 public void osNpcPlayAnimation(LSL_Key npc, string animation)
2346 {
2347 CheckThreatLevel(ThreatLevel.High, "osPlayAnimation");
2348
2349 INPCModule module = World.RequestModuleInterface<INPCModule>();
2350 if (module != null)
2351 {
2352 UUID npcID = new UUID(npc.m_string);
2353 if (module.IsNPC(npcID))
2354 {
2355 UUID ownerID = module.GetOwner(npcID);
2356 if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
2357 AvatarPlayAnimation(npcID.ToString(), animation);
2358 }
2359 }
2360 }
2361
2362 public void osNpcStopAnimation(LSL_Key npc, string animation)
2363 {
2364 CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation");
2365
2366 INPCModule module = World.RequestModuleInterface<INPCModule>();
2367 if (module != null)
2368 {
2369 UUID npcID = new UUID(npc.m_string);
2370 if (module.IsNPC(npcID))
2371 {
2372 UUID ownerID = module.GetOwner(npcID);
2373 if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
2374 AvatarStopAnimation(npcID.ToString(), animation);
2375 }
2376 }
2377 }
2378
2335 /// <summary> 2379 /// <summary>
2336 /// Save the current appearance of the script owner permanently to the named notecard. 2380 /// Save the current appearance of the script owner permanently to the named notecard.
2337 /// </summary> 2381 /// </summary>