View Single Post
  #7  
Old 06-26-2015, 12:37 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Heres an example of a quest where the mob just runs around killing stuff :p

Code:
sub EVENT_SPAWN {
	quest::settimer("fuck_shit_up", 5);
}

sub EVENT_TIMER {
	if($timer eq "fuck_shit_up" && !$npc->IsEngaged()) {
		KillMode();
	}
}

sub KillMode {
    my @npc_list = $entity_list->GetNPCList();
    foreach $npc_ent (@npc_list) {
		next if $npc_ent->GetID() == $npc->GetID(); #Lets not kill ourself
		next if $npc_ent->GetOwnerID(); #skip pets
		next if ($npc_ent->GetSpecialAbility(19) || $npc_ent->GetSpecialAbility(20) || $npc_ent->GetSpecialAbility(24) || $npc_ent->GetSpecialAbility(35)); #Immune to melee / magic / aggro / noharm SKIP
		next if $npc_ent->GetBodyType() == 11; #Skip untargetable NPCs
		next if $npc_ent->CalculateDistance($x, $y, $z) > 1000; #skip mobs over 1000 Distance
		quest::shout("I am coming for you, " . $npc_ent->GetCleanName() . "!");
		quest::SetRunning(1);
		$npc->AddToHateList($npc_ent, 1); #We now HATE HIM!
		last; #we found a valid target jump out of the loop
    }
}
Reply With Quote