aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorBill Blight2018-12-10 21:52:36 -0800
committerUbitUmarov2018-12-11 17:32:50 +0000
commit0881840946019caddffd89311416606e19c3cf3b (patch)
treed8f08ddf977b307c0b2cb1ed273cd2950b7055bb /OpenSim/Region/ScriptEngine/Shared
parentmantis 8420: ubOde awake up lazy body (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs26
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs6
3 files changed, 31 insertions, 2 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");
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index cfdc7d5..2f800bc 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -358,6 +358,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
358 void osNpcSetProfileImage(LSL_Key npc, string image); 358 void osNpcSetProfileImage(LSL_Key npc, string image);
359 void osNpcSay(key npc, string message); 359 void osNpcSay(key npc, string message);
360 void osNpcSay(key npc, int channel, string message); 360 void osNpcSay(key npc, int channel, string message);
361 void osNpcSayTo(LSL_Key npc, string target, int channel, string msg);
361 void osNpcShout(key npc, int channel, string message); 362 void osNpcShout(key npc, int channel, string message);
362 void osNpcSit(key npc, key target, int options); 363 void osNpcSit(key npc, key target, int options);
363 void osNpcStand(LSL_Key npc); 364 void osNpcStand(LSL_Key npc);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index a55dc77..ba899b0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -682,8 +682,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
682 { 682 {
683 m_OSSL_Functions.osNpcSay(npc, channel, message); 683 m_OSSL_Functions.osNpcSay(npc, channel, message);
684 } 684 }
685 685 public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg)
686 686 {
687 m_OSSL_Functions.osNpcSayTo(npc, target, channel, msg);
688 }
687 public void osNpcShout(key npc, int channel, string message) 689 public void osNpcShout(key npc, int channel, string message)
688 { 690 {
689 m_OSSL_Functions.osNpcShout(npc, channel, message); 691 m_OSSL_Functions.osNpcShout(npc, channel, message);