View Single Post
  #11  
Old 04-04-2015, 08:28 PM
Asylum
Sarnak
 
Join Date: Jun 2013
Posts: 81
Default

Modified for use as a "guard" without using faction. Basically you can change the target NPCIDs to have the guard attack specific npcs that come close enough.

Code:
#2211 Enclave_Protector in postorms v.1

sub EVENT_SPAWN {
	quest::settimer(1,6);
}

sub EVENT_TIMER {
	if($timer == 1) {
		my @nlist = $entity_list->GetNPCList(); 
		foreach my $n(@nlist) {
			my $typeID = $n->GetNPCTypeID();
			if($typeID >= 2213) {
				if(plugin::CheckDistBetween2Ents($npc,$n,50)) {
					$npc->AddToHateList($n);
				}
			}
		}
	}
}
Reply With Quote