diff options
author | UbitUmarov | 2016-07-24 16:31:29 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-24 16:31:29 +0100 |
commit | 2bb467e358c0e9e1055a077e9da8c4ddf773707d (patch) | |
tree | a188669fcd4d322288ceed99ed51134f39cf21af | |
parent | reOoops ... (diff) | |
download | opensim-SC-2bb467e358c0e9e1055a077e9da8c4ddf773707d.zip opensim-SC-2bb467e358c0e9e1055a077e9da8c4ddf773707d.tar.gz opensim-SC-2bb467e358c0e9e1055a077e9da8c4ddf773707d.tar.bz2 opensim-SC-2bb467e358c0e9e1055a077e9da8c4ddf773707d.tar.xz |
add osSetHealth() value from 1 to 100; (mantis 7973)
4 files changed, 26 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); |
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index 0a03d4c..a31dd17 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini | |||
@@ -157,6 +157,7 @@ | |||
157 | ; ThreatLevel High | 157 | ; ThreatLevel High |
158 | Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | 158 | Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
159 | Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | 159 | Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
160 | Allow_osSetHealth = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | ||
160 | Allow_osForceAttachToAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | 161 | Allow_osForceAttachToAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
161 | Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | 162 | Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
162 | Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | 163 | Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |