INPCModule.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using OpenMetaverse;
  28. using OpenSim.Framework;
  29. using OpenSim.Region.Framework.Scenes;
  30. namespace OpenSim.Region.Framework.Interfaces
  31. {
  32. public interface INPCModule
  33. {
  34. /// <summary>
  35. /// Create an NPC
  36. /// </summary>
  37. /// <param name="firstname"></param>
  38. /// <param name="lastname"></param>
  39. /// <param name="position"></param>
  40. /// <param name="scene"></param>
  41. /// <param name="appearance">The avatar appearance to use for the new NPC.</param>
  42. /// <returns>The UUID of the ScenePresence created.</returns>
  43. UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance);
  44. /// <summary>
  45. /// Check if the agent is an NPC.
  46. /// </summary>
  47. /// <param name="agentID"></param>
  48. /// <param name="scene"></param>
  49. /// <returns>True if the agent is an NPC in the given scene. False otherwise.</returns>
  50. bool IsNPC(UUID agentID, Scene scene);
  51. /// <summary>
  52. /// Set the appearance for an NPC.
  53. /// </summary>
  54. /// <param name="agentID"></param>
  55. /// <param name="appearance"></param>
  56. /// <param name="scene"></param>
  57. /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
  58. bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene);
  59. /// <summary>
  60. /// Move an NPC to a target over time.
  61. /// </summary>
  62. /// <param name="agentID">The UUID of the NPC</param>
  63. /// <param name="scene"></param>
  64. /// <param name="pos"></param>
  65. /// <param name="noFly">
  66. /// If true, then the avatar will attempt to walk to the location even if it's up in the air.
  67. /// This is to allow walking on prims.
  68. /// </param>
  69. /// <param name="landAtTarget">
  70. /// If true and the avatar is flying when it reaches the target, land.
  71. /// </param>
  72. /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
  73. bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget);
  74. /// <summary>
  75. /// Stop the NPC's current movement.
  76. /// </summary>
  77. /// <param name="agentID">The UUID of the NPC</param>
  78. /// <param name="scene"></param>
  79. /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
  80. bool StopMoveToTarget(UUID agentID, Scene scene);
  81. /// <summary>
  82. /// Get the NPC to say something.
  83. /// </summary>
  84. /// <param name="agentID">The UUID of the NPC</param>
  85. /// <param name="scene"></param>
  86. /// <param name="text"></param>
  87. /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
  88. bool Say(UUID agentID, Scene scene, string text);
  89. /// <summary>
  90. /// Delete an NPC.
  91. /// </summary>
  92. /// <param name="agentID">The UUID of the NPC</param>
  93. /// <param name="scene"></param>
  94. /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
  95. bool DeleteNPC(UUID agentID, Scene scene);
  96. }
  97. }