aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs44
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs10
3 files changed, 56 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 120ae2c..fe5f198 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -897,6 +897,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
897 { 897 {
898 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation"); 898 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation");
899 899
900 AvatarPlayAnimation(avatar, animation);
901 }
902
903 private void AvatarPlayAnimation(string avatar, string animation)
904 {
900 UUID avatarID = (UUID)avatar; 905 UUID avatarID = (UUID)avatar;
901 906
902 m_host.AddScriptLPS(1); 907 m_host.AddScriptLPS(1);
@@ -929,6 +934,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
929 { 934 {
930 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation"); 935 CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation");
931 936
937 AvatarStopAnimation(avatar, animation);
938 }
939
940 private void AvatarStopAnimation(string avatar, string animation)
941 {
932 UUID avatarID = (UUID)avatar; 942 UUID avatarID = (UUID)avatar;
933 943
934 m_host.AddScriptLPS(1); 944 m_host.AddScriptLPS(1);
@@ -2341,6 +2351,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2341 } 2351 }
2342 } 2352 }
2343 2353
2354 public void osNpcPlayAnimation(LSL_Key npc, string animation)
2355 {
2356 CheckThreatLevel(ThreatLevel.High, "osPlayAnimation");
2357
2358 INPCModule module = World.RequestModuleInterface<INPCModule>();
2359 if (module != null)
2360 {
2361 UUID npcID = new UUID(npc.m_string);
2362 if (module.IsNPC(npcID))
2363 {
2364 UUID ownerID = module.GetOwner(npcID);
2365 if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
2366 AvatarPlayAnimation(npcID.ToString(), animation);
2367 }
2368 }
2369 }
2370
2371 public void osNpcStopAnimation(LSL_Key npc, string animation)
2372 {
2373 CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation");
2374
2375 INPCModule module = World.RequestModuleInterface<INPCModule>();
2376 if (module != null)
2377 {
2378 UUID npcID = new UUID(npc.m_string);
2379 if (module.IsNPC(npcID))
2380 {
2381 UUID ownerID = module.GetOwner(npcID);
2382 if (ownerID == UUID.Zero || ownerID == m_host.OwnerID)
2383 AvatarStopAnimation(npcID.ToString(), animation);
2384 }
2385 }
2386 }
2387
2344 /// <summary> 2388 /// <summary>
2345 /// Save the current appearance of the script owner permanently to the named notecard. 2389 /// Save the current appearance of the script owner permanently to the named notecard.
2346 /// </summary> 2390 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index a815c5b..e9e7605 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -185,6 +185,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
185 void osNpcSit(key npc, key target, int options); 185 void osNpcSit(key npc, key target, int options);
186 void osNpcStand(LSL_Key npc); 186 void osNpcStand(LSL_Key npc);
187 void osNpcRemove(key npc); 187 void osNpcRemove(key npc);
188 public void osNpcPlayAnimation(LSL_Key npc, string animation);
189 public void osNpcStopAnimation(LSL_Key npc, string animation);
188 190
189 LSL_Key osOwnerSaveAppearance(string notecard); 191 LSL_Key osOwnerSaveAppearance(string notecard);
190 LSL_Key osAgentSaveAppearance(key agentId, string notecard); 192 LSL_Key osAgentSaveAppearance(key agentId, string notecard);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 6572def..a94392a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -553,6 +553,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
553 m_OSSL_Functions.osNpcRemove(npc); 553 m_OSSL_Functions.osNpcRemove(npc);
554 } 554 }
555 555
556 public void osNpcPlayAnimation(LSL_Key npc, string animation)
557 {
558 m_OSSL_Functions.osNpcPlayAnimation(npc, animation);
559 }
560
561 public void osNpcStopAnimation(LSL_Key npc, string animation)
562 {
563 m_OSSL_Functions.osNpcStopAnimation(npc, animation);
564 }
565
556 public LSL_Key osOwnerSaveAppearance(string notecard) 566 public LSL_Key osOwnerSaveAppearance(string notecard)
557 { 567 {
558 return m_OSSL_Functions.osOwnerSaveAppearance(notecard); 568 return m_OSSL_Functions.osOwnerSaveAppearance(notecard);