I'm making a script that has a custom NPC completing other quests, so I am trying to make a script to find and attack other npcs.
I tested a simple script on my buddy Waradern_Skymoor in qeytoqrg:
Code:
sub killthings {
my @nlist = $entity_list->GetMobList();
quest::shout($nlist[0]->GetName());
my $x = $nlist[0]->GetX();
my $y = $nlist[0]->GetY();
my $z = $nlist[0]->GetZ();
quest::say($x);
quest::SetRunning(1);
quest::moveto($x,$y,$z,1.2);
$nlist[1]->Attack($npc);
}
it works, and Waradern runs off towards a gnoll.
However, now that I've put this on my custom NPC, GetMobList() only has my PC character as a member. GetNPCList() is completely empty. If I look for $nlist[1], Perl throws an error for calling GetName() on undefined.
I've checked their database entries, and nothing looks too out of place. I inserted my custom NPC using the EOC platform, and the only difference I can see is that I've made my NPC unique by name. Both are the only members of their spawngroups, both have similar values, etc... I would guess that my NPC is on a different entity list than the rest for some reason.
Any thoughts?