Alangara_PRC8/_module/nss/jh_dmsetnametool.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

35 lines
967 B
Plaintext

//This uses the dm consol command dm_setvarstring or SetVarString
//To set the name of an NPC,item,placeable.
//Access this by ##dm_setvarstring sName "Name you want"
// *OR* SetVarString sName "Name you want"
//Make sure you set the string on the creature you want named!
//Then use the item on the object you desire.
//If you want to restore the name back to it's original one, simply reuse
//the item on the creature without resetting sName.
void main()
{
object oObject,oDM,oNamer;
string sName;
oObject = GetItemActivatedTarget();
oDM = GetItemActivator();
oNamer = GetItemPossessedBy(oDM,"jh_dmsetnametool");
if (!GetIsDM(oDM))
{
SendMessageToPC(oDM,"This is to be only used by DMs!");
DestroyObject(oNamer);
return;
}
if (GetIsObjectValid(oObject))
{
sName = GetLocalString(oObject,"sName");
SetName(oObject,sName);
SetLocalString(oObject,sName,"");
}
else
{
SendMessageToPC(oDM,"This is not a valid target.");
}
}