aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorMelanie2012-01-06 22:59:08 +0000
committerMelanie2012-01-06 22:59:08 +0000
commita47aa46962965717ff038e2e74d31e1bf5de2276 (patch)
treeaf2084e82fea5a0b419e5da0f0f403b589d9011d /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-a47aa46962965717ff038e2e74d31e1bf5de2276.zip
opensim-SC_OLD-a47aa46962965717ff038e2e74d31e1bf5de2276.tar.gz
opensim-SC_OLD-a47aa46962965717ff038e2e74d31e1bf5de2276.tar.bz2
opensim-SC_OLD-a47aa46962965717ff038e2e74d31e1bf5de2276.tar.xz
Add osNpcPlayAnimation and osNpcStopAnimation which respect ownership as well
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-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 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>