diff options
Diffstat (limited to 'OpenSim')
3 files changed, 25 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 204f73e..072d10d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3469,6 +3469,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3469 | } | 3469 | } |
3470 | } | 3470 | } |
3471 | 3471 | ||
3472 | public void osSetHealth(string avatar, double health) | ||
3473 | { | ||
3474 | CheckThreatLevel(ThreatLevel.High, "osSetHealth"); | ||
3475 | m_host.AddScriptLPS(1); | ||
3476 | |||
3477 | UUID avatarId = new UUID(avatar); | ||
3478 | ScenePresence presence = World.GetScenePresence(avatarId); | ||
3479 | |||
3480 | if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition())) | ||
3481 | { | ||
3482 | if (health > 100.0) | ||
3483 | health = 100.0; | ||
3484 | else if (health < 1.0) | ||
3485 | health = 1.0; | ||
3486 | |||
3487 | presence.setHealthWithUpdate((float)health); | ||
3488 | } | ||
3489 | } | ||
3490 | |||
3472 | public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) | 3491 | public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) |
3473 | { | 3492 | { |
3474 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); | 3493 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c1a177a..a018bac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -368,6 +368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
368 | void osSetSpeed(string UUID, LSL_Float SpeedModifier); | 368 | void osSetSpeed(string UUID, LSL_Float SpeedModifier); |
369 | LSL_Float osGetHealth(string avatar); | 369 | LSL_Float osGetHealth(string avatar); |
370 | void osCauseHealing(string avatar, double healing); | 370 | void osCauseHealing(string avatar, double healing); |
371 | void osSetHealth(string avatar, double health); | ||
371 | void osCauseDamage(string avatar, double damage); | 372 | void osCauseDamage(string avatar, double damage); |
372 | void osForceOtherSit(string avatar); | 373 | void osForceOtherSit(string avatar); |
373 | void osForceOtherSit(string avatar, string target); | 374 | void osForceOtherSit(string avatar, string target); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index d586290..c55ff8e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -945,6 +945,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
945 | m_OSSL_Functions.osCauseHealing(avatar, healing); | 945 | m_OSSL_Functions.osCauseHealing(avatar, healing); |
946 | } | 946 | } |
947 | 947 | ||
948 | public void osSetHealth(string avatar, double health) | ||
949 | { | ||
950 | m_OSSL_Functions.osSetHealth(avatar, health); | ||
951 | } | ||
952 | |||
948 | public void osForceOtherSit(string avatar) | 953 | public void osForceOtherSit(string avatar) |
949 | { | 954 | { |
950 | m_OSSL_Functions.osForceOtherSit(avatar); | 955 | m_OSSL_Functions.osForceOtherSit(avatar); |