HoS_PRC8/_mod/_module/nss/magic_mouth_trig.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

23 lines
646 B
Plaintext

void main()
{
object oPC=GetEnteringObject();
object oWP;
string sSay;
object oSpeaker;
if (GetIsPC(oPC)==TRUE)
{ // speak
oWP=GetNearestObjectByTag("MAGIC_MOUTH",OBJECT_SELF,1);
if (oWP!=OBJECT_INVALID)
{ // sayings gotten
sSay=GetName(oWP);
oSpeaker=GetNearestObjectByTag("MAGIC_MOUTH_SPEAKER",OBJECT_SELF,1);
if (oSpeaker!=OBJECT_INVALID)
{ // speak through object
AssignCommand(oSpeaker,SpeakString(sSay));
} // speak through object
else
{ SendMessageToPC(oPC,"You hear a disembodied voice say '"+sSay+"'"); }
} // sayings gotten
} // speak
}