View Single Post
  #3  
Old 06-23-2015, 08:43 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,604
Default

A better way of writing it would be this:
Code:
sub killthings {
    my @nlist = $entity_list->GetMobList();
    foreach my $npc (@nlist) {
        if ($npc->GetEnt()->CastToNPC()->GetNPCTypeID() == FIRSTID) {
            quest::SetRunning(1);
            my $at = $entity_list->GetNPCByNPCTypeID(SECONDID);
            quest::moveto($at->GetX(), $at->GetY(), $at->GetZ(), 1.2);
            $npc->GetEnt()->CastToNPC()->Attack($at);
        }
    }
}

Last edited by Kingly_Krab; 06-23-2015 at 08:51 PM..
Reply With Quote