I'd do something like this. But of course tweak to your liking.
Actually, I think all you would need is:
Code:
if($signal == 5){
quest::say("Thanks arias, i'm following you.");
$npc->SetFollowID($entity_list->GetMobByNpcTypeID(189490)->GetID());
}
but here's something I wrote up for vindi pets. I need to remove the signal add hate trick, it's too powerful and sees through FD.
Code:
#Shin: Added pet support to Vindi
sub EVENT_SPAWN {
quest::settimer(1, 1); #Initial spawn of pets
}
sub EVENT_TIMER {
if ($timer eq "1") { #initial spawn.
$vindipets[0] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$vindipets[1] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$entity_list->GetMobID($vindipets[0])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
$entity_list->GetMobID($vindipets[1])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
quest::stoptimer(1);
quest::settimer(2, 120); #This is the respawn for pet delay
}
if ($timer eq "2") {
if (!defined @vindipets) { #this happens if someone #reloadpl's. I don't really have a good solution.
$vindipets[0] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$vindipets[1] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$entity_list->GetMobID($vindipets[0])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
$entity_list->GetMobID($vindipets[1])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
}
for ($i = 0; $i < scalar @vindipets; $i++) { #Pet check
if (defined $vindipets[$i]) { #I find this a silly check but scalar size is wierd.
if (!defined $entity_list->GetMobID($vindipets[$i])) {
$vindipets[$i] = quest::spawn2(113120,0,0,$x,$y,$z,$h); #respawn pet.
$entity_list->GetMobID($vindipets[$i])->SetFollowID($npc->GetID()); #set vindi owner.
}
}
}
}
}
sub EVENT_COMBAT {
if ($combat == 1) {
quest::signalwith(113120,$client->GetID(),0); #there's more than pets with this name, need a new npc type id. And this is working too well, I think FD is being seen thru with "pets".
}
}
sub EVENT_ATTACK {
quest::shout("Your kind will not defile the temple of Rallos Zek!");
}
# Quest by mystic414
sub EVENT_SIGNAL { #Pet Aggro'd, this is more uber than EQ live. Put in guardian
$mob->AddToHateList($signal, 1, 0) #This is too much though
}