add osGetHealRate(avatarkey) and osSetHealRate(avatarkey, healrate); healrate from 0 (disables auto heal) to 100 (maybe too fast) % per second. (untested)

LSLKeyTest
UbitUmarov 2016-07-25 02:05:53 +01:00
parent e60dc305a4
commit 4b832f0f8e
4 changed files with 38 additions and 0 deletions

View File

@ -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) public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
{ {
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");

View File

@ -369,6 +369,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Float osGetHealth(string avatar); LSL_Float osGetHealth(string avatar);
void osCauseHealing(string avatar, double healing); void osCauseHealing(string avatar, double healing);
void osSetHealth(string avatar, double health); void osSetHealth(string avatar, double health);
void osSetHealRate(string avatar, double health);
LSL_Float osGetHealRate(string avatar);
void osCauseDamage(string avatar, double damage); void osCauseDamage(string avatar, double damage);
void osForceOtherSit(string avatar); void osForceOtherSit(string avatar);
void osForceOtherSit(string avatar, string target); void osForceOtherSit(string avatar, string target);

View File

@ -950,6 +950,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osSetHealth(avatar, health); 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) public void osForceOtherSit(string avatar)
{ {
m_OSSL_Functions.osForceOtherSit(avatar); m_OSSL_Functions.osForceOtherSit(avatar);

View File

@ -158,6 +158,8 @@
Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osCauseDamage = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osCauseHealing = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osSetHealth = ${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_osForceAttachToAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osForceAttachToAvatarFromInventory = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osForceCreateLink = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER