View Full Version : Linking mob spawns/pulls
Jeknos
02-14-2012, 02:24 AM
I have been trying to come up with a way to implement linked mob pulls (a set of mobs will always aggro when one does) and respawns (when one of the mobs respawns, they all do). My first thoughts were to do this in a quest script (as I'm not familiar enough with the server source to code it there) but I'm not sure how to go about implementing this. If anyone has done this before or knows what quest functions or source code locations this stuff would use I'd appreciate the assistance.
joligario
02-14-2012, 01:35 PM
There are quite a few examples in the quest repository. Check out the emperor in SSRA for a more involved version. I think NTOV had a few scripts as well.
chrsschb
02-14-2012, 07:02 PM
Linking mobs:
sub EVENT_AGGRO {
my $enraged_corflunk = $entity_list->GetMobByNpcTypeID(999270);
my $enraged_zarchoomi = $entity_list->GetMobByNpcTypeID(999269);
if ($enraged_corflunk) {
my $enraged_corflunknpc = $enraged_corflunk->CastToNPC();
$enraged_corflunknpc->AddToHateList($client, 1);
}
if ($enraged_zarchoomi) {
my $enraged_zarchoominpc = $enraged_zarchoomi->CastToNPC();
$enraged_zarchoominpc->AddToHateList($client, 1);
}
}
Spawning mobs at the same time (only the one npc has a respawn timer):
sub EVENT_SPAWN
{
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(1241,0,0,$x + 15,$y,$z,$h);
quest::spawn2(1242,0,0,$x - 15,$y,$z,$h);
}
Jeknos
02-14-2012, 08:02 PM
Thanks for the replies. They helped a bunch.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.