diff options
author | Bill Blight | 2018-12-10 21:52:36 -0800 |
---|---|---|
committer | UbitUmarov | 2018-12-11 17:32:50 +0000 |
commit | 0881840946019caddffd89311416606e19c3cf3b (patch) | |
tree | d8f08ddf977b307c0b2cb1ed273cd2950b7055bb /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | mantis 8420: ubOde awake up lazy body (diff) | |
download | opensim-SC-0881840946019caddffd89311416606e19c3cf3b.zip opensim-SC-0881840946019caddffd89311416606e19c3cf3b.tar.gz opensim-SC-0881840946019caddffd89311416606e19c3cf3b.tar.bz2 opensim-SC-0881840946019caddffd89311416606e19c3cf3b.tar.xz |
Add osNpcSayTo(key npc, key target, integer channel, string message)
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 26 |
1 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 969347a..7c43b6a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3164,7 +3164,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3164 | module.Say(npcId, World, message, channel); | 3164 | module.Say(npcId, World, message, channel); |
3165 | } | 3165 | } |
3166 | } | 3166 | } |
3167 | |||
3168 | public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg) | ||
3169 | { | ||
3170 | CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); | ||
3167 | 3171 | ||
3172 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
3173 | if (module != null) | ||
3174 | { | ||
3175 | UUID npcId = new UUID(npc.m_string); | ||
3176 | |||
3177 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3178 | return; | ||
3179 | |||
3180 | ScenePresence NPCpresence = World.GetScenePresence(npcId); | ||
3181 | if (NPCpresence == null || NPCpresence.IsDeleted) | ||
3182 | return; | ||
3183 | |||
3184 | Vector3 npcPOS = NPCpresence.AbsolutePosition; | ||
3185 | string npcNAME = NPCpresence.Name; | ||
3186 | UUID TargetID; | ||
3187 | UUID.TryParse(target, out TargetID); | ||
3188 | |||
3189 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
3190 | if (wComm != null) | ||
3191 | wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg); | ||
3192 | } | ||
3193 | } | ||
3168 | public void osNpcShout(LSL_Key npc, int channel, string message) | 3194 | public void osNpcShout(LSL_Key npc, int channel, string message) |
3169 | { | 3195 | { |
3170 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | 3196 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); |