Here is how I do that:
NPC1 (the NPC that the client is currently dealing with)
Code:
sub EVENT_SAY {
if ($text=~/Hail/i)
{
quest::say("I think you wanted to speak with my friend over here.");
my $ClientID = $client->GetID(); #Get the client's entity ID
my $CIDSignal = $ClientID + 1000; #Add 1000 to entity ID for signalling
quest::signalwith(2701139, $CIDSignal); #Send the Entity ID of the client +1000 to the other NPC
}
}
NPC2 (the NPC that we are sending the client info to)
Code:
my $ClientName; #Only setting this here so the name can be used in other sub events if needed.
sub EVENT_SIGNAL {
if ($signal > 1000 && $signal < 3000)
{
my $ClientID = $signal - 1000; #Subtract the 1000 we added to the signal before it was sent
my $ClientByID = $entity_list->GetClientByID($ClientID); #Get client by entity ID
$ClientName = $ClientByID->GetCleanName(); #Get Client's name
quest::say("Hello there, $ClientName!");
}
}
Basically, you can add any amount you want to it. Entity IDs only go up to 1502 or so, so you can send different ranges for different things you might want to check just by adding different amounts to them. So, maybe for this response, I want to add 1000 to the entity ID and check on the other NPC for any from 1000-3000, but maybe I want to have a second response for something else too. If so, you can just add a different amount like 5000 and then have the other NPC check for 5000-7000 signal IDs.
BTW, I haven't tested the exact script as I posted it here, because I modified an existing one I use to simplify it. But, I think this should work for you. If not, it should be easy enough to get the idea of what you need to be doing. If you have any issues, just put some say messages in there to debug it, so you can see where it might be failing. Here is an example of what I mean by that:
Code:
if ($text=~/Hail/i)
{
quest::say("I think you wanted to speak with my friend over here.");
my $ClientID = $client->GetID(); #Get the client's entity ID
quest::say("I got Entity ID $ClientID.");
my $CIDSignal = $ClientID + 1000; #Add 1000 to entity ID for signalling
quest::say("Added 1000 to the Entity ID to get $CIDSignal.");
quest::signalwith(2701139, $CIDSignal); #Send the Entity ID of the client +1000 to the other NPC
quest::say("Signal $CIDSignal sent to NPCID 2701139.");
}
If you put say messages like that after each step, it makes it really easy to see where they are failing. Also, I usually add any variables to the say message so I can see what it is actually getting to make sure something isn't wrong with that part.