From 4b832f0f8e32bf265ee13989500fb0559d1a86f7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Jul 2016 02:05:53 +0100 Subject: add osGetHealRate(avatarkey) and osSetHealRate(avatarkey, healrate); healrate from 0 (disables auto heal) to 100 (maybe too fast) % per second. (untested) --- .../Shared/Api/Implementation/OSSL_Api.cs | 24 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 10 +++++++++ bin/config-include/osslEnable.ini | 2 ++ 4 files changed, 38 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 072d10d..7a2b24f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3488,6 +3488,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void osSetHealRate(string avatar, double healrate) + { + CheckThreatLevel(ThreatLevel.High, "osSetHealRate"); + m_host.AddScriptLPS(1); + + UUID avatarId = new UUID(avatar); + ScenePresence presence = World.GetScenePresence(avatarId); + + if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition())) + presence.HealRate = (float)healrate; + } + + public LSL_Float osGetHealRate(string avatar) + { + CheckThreatLevel(ThreatLevel.None, "osGetHealRate"); + m_host.AddScriptLPS(1); + + LSL_Float rate = new LSL_Float(0); + ScenePresence presence = World.GetScenePresence(new UUID(avatar)); + if (presence != null) + rate = presence.HealRate; + return rate; + } + public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) { 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 a018bac..c99679e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -369,6 +369,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float osGetHealth(string avatar); void osCauseHealing(string avatar, double healing); void osSetHealth(string avatar, double health); + void osSetHealRate(string avatar, double health); + LSL_Float osGetHealRate(string avatar); void osCauseDamage(string avatar, double damage); void osForceOtherSit(string avatar); 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 c55ff8e..35eee59 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -950,6 +950,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osSetHealth(avatar, health); } + public void osSetHealRate(string avatar, double health) + { + m_OSSL_Functions.osSetHealRate(avatar, health); + } + + public LSL_Float osGetHealRate(string avatar) + { + return m_OSSL_Functions.osGetHealRate(avatar); + } + public void osForceOtherSit(string avatar) { m_OSSL_Functions.osForceOtherSit(avatar); diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index a31dd17..8f9702d 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -158,6 +158,8 @@ Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osSetHealth = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER + Allow_osSetHealRate = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER + Allow_osGetHealRate = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osForceAttachToAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER -- cgit v1.1