Advertisement
Terrah

nwnx_names

Nov 23rd, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. //void main(){}
  2.  
  3. //Sets a dynamic display name for oPC on oNamer
  4. //if oPC is the module oNamers name will be set as its default name
  5. //default name affects all display name functions!
  6. //Returns true/false depending on success or not
  7. int NWNX_Names_SetName( object oPC, object oNamer, string sNewName );
  8.  
  9. //Gets the display name oPC currently sees oNamer as
  10. //if oPC is the module it will return the set default dynamic name
  11. //Returns an empty string if there is no dynamic name set
  12. string NWNX_Names_GetName( object oPC, object oNamer );
  13.  
  14. //Removes the dynamic display name oPC sees oNamer as
  15. //if oPC is the module it will remove the set default dynamic name
  16. //Returns true/false depending or success or not
  17. int NWNX_Names_RemoveName( object oPC, object oNamer );
  18.  
  19. //Sets the name of oCreature to sNewName, this will update the object for all PCs
  20. //This also works persistantly on playerobjects
  21. //if nLastName = 1 the lastname will be set instead of the firstname
  22. //Returns true false depending on success or not
  23. int NWNX_Names_SetPermanentName( object oCreature, string sNewName, int nLastName );
  24.  
  25. //Get the first or lastname of oCreature, returns an empty string on failure
  26. string NWNX_Names_GetPermanentName( object oCreature, int nLastName );
  27.  
  28. //This will update oObject for all logged in pcs
  29. //Only works on creature objects
  30. void NWNX_Names_UpdateObject( object oObject );
  31.  
  32. //Set the name of oMasters familiar or (nType=1)animal companion
  33. //This can be done eventhough oMaster has no animal companion set
  34. //This will not update on summoned familiar or companions!
  35. void NWNX_Names_SetFamiliarCompanionName( object oMaster, string sNewName, int nType );
  36.  
  37. //Get the name of oMasters familiar or (nType=1)animal companion
  38. //Returns an empty string if there are no name set
  39. string NWNX_Names_GetFamiliarCompanionName( object oMaster, string sNewName, int nType );
  40.  
  41. //Sends a message from oSender to oReceiver
  42. //This uses the talk channel but only the receiver will see sMessage
  43. //oReceiver must be a player controlled object and oSender must be a creature
  44. //This works cross areas and reguardless of vision between the two unlike normal talk
  45. //Returns false if the message wasnt sent
  46. int NWNX_Names_SendMessage( object oSender, object oReceiver, string sMessage );
  47.  
  48. int NWNX_Names_SendMessage( object oSender, object oReceiver, string sMessage ){
  49.  
  50. SetLocalString( oReceiver, "NWNX!NAMES!Text", ObjectToString( oSender )+" "+sMessage );
  51. int nRet = StringToInt( GetLocalString( oReceiver, "NWNX!NAMES!Text" ) );
  52. DeleteLocalString( oReceiver, "NWNX!NAMES!Text" );
  53. return nRet;
  54. }
  55.  
  56. string NWNX_Names_GetFamiliarCompanionName( object oMaster, string sNewName, int nType ){
  57.  
  58. SetLocalString( GetModule(), "NWNX!NAMES!GetFamilarCompanionName", ObjectToString( oMaster )+" "+IntToString( nType )+" ~ " );
  59. string nReturn = GetLocalString( GetModule(), "NWNX!NAMES!GetFamilarCompanionName" );
  60. DeleteLocalString( GetModule(), "NWNX!NAMES!GetFamilarCompanionName" );
  61.  
  62. return nReturn;
  63. }
  64.  
  65. void NWNX_Names_SetFamiliarCompanionName( object oMaster, string sNewName, int nType ){
  66.  
  67. SetLocalString( GetModule(), "NWNX!NAMES!SetFamilarCompanionName", ObjectToString( oMaster )+" "+IntToString( nType )+" "+sNewName );
  68. DeleteLocalString( GetModule(), "NWNX!NAMES!SetFamilarCompanionName" );
  69. }
  70.  
  71. void NWNX_Names_UpdateObject( object oObject ){
  72.  
  73. SetLocalString( GetModule(), "NWNX!NAMES!UpdateObject", ObjectToString( oObject ) );
  74. DeleteLocalString( GetModule(), "NWNX!NAMES!UpdateObject" );
  75. }
  76.  
  77. string NWNX_Names_GetPermanentName( object oCreature, int nLastName ){
  78.  
  79. SetLocalString( oCreature, "NWNX!NAMES!GetPermanentName", IntToString( nLastName )+" ~ " );
  80. string nReturn = GetLocalString( oCreature, "NWNX!NAMES!GetPermanentName" );
  81. DeleteLocalString( oCreature, "NWNX!NAMES!GetPermanentName" );
  82.  
  83. return nReturn;
  84. }
  85.  
  86. int NWNX_Names_SetPermanentName( object oCreature, string sNewName, int nLastName ){
  87.  
  88. SetLocalString( oCreature, "NWNX!NAMES!SetPermanentName", IntToString( nLastName )+" "+sNewName );
  89. int nReturn = StringToInt( GetLocalString( oCreature, "NWNX!NAMES!SetPermanentName" ) );
  90. DeleteLocalString( oCreature, "NWNX!NAMES!SetPermanentName" );
  91.  
  92. return nReturn;
  93. }
  94.  
  95. int NWNX_Names_RemoveName( object oPC, object oNamer ){
  96.  
  97. SetLocalString( oPC, "NWNX!NAMES!RemoveName", ObjectToString( oNamer ) );
  98. int nReturn = StringToInt( GetLocalString( oPC, "NWNX!NAMES!RemoveName" ) );
  99. DeleteLocalString( oPC, "NWNX!NAMES!RemoveName" );
  100.  
  101. return nReturn;
  102. }
  103.  
  104. string NWNX_Names_GetName( object oPC, object oNamer ){
  105.  
  106. SetLocalString( oPC, "NWNX!NAMES!GetName", ObjectToString( oNamer )+" ~ " );
  107. string nReturn = GetLocalString( oPC, "NWNX!NAMES!GetName" );
  108. DeleteLocalString( oPC, "NWNX!NAMES!GetName" );
  109.  
  110. return nReturn;
  111. }
  112.  
  113. int NWNX_Names_SetName( object oPC, object oNamer, string sNewName ){
  114.  
  115. SetLocalString( oPC, "NWNX!NAMES!SetName", ObjectToString( oNamer )+" "+sNewName );
  116. int nReturn = StringToInt( GetLocalString( oPC, "NWNX!NAMES!SetName" ) );
  117. DeleteLocalString( oPC, "NWNX!NAMES!SetName" );
  118.  
  119. return nReturn;
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement