Files
Anphillia_PRC8/_module/nss/x3_pl_tool09.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

32 lines
899 B
Plaintext

#include "dev_inc"
#include "chr_inc"
#include "creature_inc"
void main()
{
object oUser = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
// Team members can rename anything..
if (!dev_IsTeamMember(oUser))
{
if (GetObjectType(oTarget) != OBJECT_TYPE_ITEM || GetItemPossessor(oTarget) != oUser)
{
SendMessageToPC(oUser, "This tool is used to rename an item you own. Must target an item in your possession");
return;
}
}
if (oTarget == OBJECT_INVALID)
oTarget = GetAreaFromLocation(GetSpellTargetLocation());
string sOldName = GetName(oTarget);
string sMsg = chr_GetPlayerChatMessage(oUser);
SendMessageToPC(oUser, "Renaming " + sOldName + " to " + sMsg);
SetName(oTarget, sMsg);
// Set new "base name" for the percentage display script
creature_SetOriginalName(oTarget, sMsg);
}