Add a version of osNpcSay that takes a channel number Mantis 5747

osNpcSay(UUID npc, string message) left untouched

New functions:-
osNpcSay(UUID npc, int channel, string message)
osNpcShout(UUID npc, int channel, string message)
osNpcWhisper(UUID npc, int channel, string message)

Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
This commit is contained in:
Talun
2012-04-24 21:54:13 +01:00
committed by BlueWall
parent 679da63da6
commit b8114d2b67
6 changed files with 144 additions and 10 deletions

View File

@@ -2530,6 +2530,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
public void osNpcSay(LSL_Key npc, string message)
{
osNpcSay(npc, 0, message);
}
public void osNpcSay(LSL_Key npc, int channel, string message)
{
CheckThreatLevel(ThreatLevel.High, "osNpcSay");
m_host.AddScriptLPS(1);
@@ -2542,7 +2547,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.Say(npcId, World, message);
module.Say(npcId, World, message, channel);
}
}
public void osNpcShout(LSL_Key npc, int channel, string message)
{
CheckThreatLevel(ThreatLevel.High, "osNpcShout");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.Shout(npcId, World, message, channel);
}
}
@@ -2627,6 +2649,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osNpcWhisper(LSL_Key npc, int channel, string message)
{
CheckThreatLevel(ThreatLevel.High, "osNpcWhisper");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.Whisper(npcId, World, message, channel);
}
}
/// <summary>
/// Save the current appearance of the script owner permanently to the named notecard.
/// </summary>

View File

@@ -203,11 +203,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osNpcSetRot(LSL_Key npc, rotation rot);
void osNpcStopMoveToTarget(LSL_Key npc);
void osNpcSay(key npc, string message);
void osNpcSay(key npc, int channel, string message);
void osNpcShout(key npc, int channel, string message);
void osNpcSit(key npc, key target, int options);
void osNpcStand(LSL_Key npc);
void osNpcRemove(key npc);
void osNpcPlayAnimation(LSL_Key npc, string animation);
void osNpcStopAnimation(LSL_Key npc, string animation);
void osNpcWhisper(key npc, int channel, string message);
LSL_Key osOwnerSaveAppearance(string notecard);
LSL_Key osAgentSaveAppearance(key agentId, string notecard);

View File

@@ -569,6 +569,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcSay(npc, message);
}
public void osNpcSay(key npc, int channel, string message)
{
m_OSSL_Functions.osNpcSay(npc, channel, message);
}
public void osNpcShout(key npc, int channel, string message)
{
m_OSSL_Functions.osNpcShout(npc, channel, message);
}
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
{
m_OSSL_Functions.osNpcSit(npc, target, options);
@@ -594,6 +605,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcStopAnimation(npc, animation);
}
public void osNpcWhisper(key npc, int channel, string message)
{
m_OSSL_Functions.osNpcWhisper(npc, channel, message);
}
public LSL_Key osOwnerSaveAppearance(string notecard)
{
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);