Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

36 lines
956 B
Plaintext

// dn_w_name_onconv
//
// Wand of Naming - Name Fairy On Conversation Event
//
#include "dn_inc_dm"
void main()
{
object oDM = GetLastSpeaker();
// only allow DMs to use this tool
if( !DN_GetIsDM( oDM ) ||
oDM != GetMaster() ) {
//SpeakString( "Nothing happens!" );
//SetListening( OBJECT_SELF, FALSE );
return;
}
string sName = GetMatchedSubstring( 0 );
object oTarget = GetLocalObject( oDM, "oNamingWandTarget" );
// using "." reset's the target's name to the default orignial
if( "." == sName ) {
AssignCommand( oTarget, SpeakString( "I am reverting to my original name." ) );
SetName( oTarget, "" );
} else {
AssignCommand( oTarget, SpeakString( "My new name is changed to: " + sName ) );
SetName( oTarget, sName );
}
//cleanup
DeleteLocalObject( oDM, "oNamingWandTarget" );
SetListening( OBJECT_SELF, FALSE );
}