View Single Post
  #1  
Old 05-16-2014, 02:25 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Akkadius,

Quote:
Originally Posted by Akkadius
quest::follow(EntityID, [Distance]) # Mob starts to follow "EntityID". The second field, Distance, is optional and can be used to set the distance the Mob will follow it's target at.
The 'EntityID' in the quest::follow code, would that be the same ID I'm using to check distances? for example I'm using this right now to check the distance:

Code:
sub EVENT_SPAWN {
	quest::settimer("add_boss_dist", 3);
	quest::shout("I work");
	}
	
sub EVENT_TIMER {	
	my $npc1 = $entity_list->GetNPCByNPCTypeID(4770003);
	my $npc2 = $entity_list->GetNPCByNPCTypeID(4770004);
	if ($timer eq "add_boss_dist"){
		if(plugin::CheckDistBetween2Ents($npc1, $npc2, 10)){
			quest::shout("I'm in distance.");
			}
			else{
			quest::shout("I'm not in distance.");
			}
		}
	}
}
I had added this to the sub EVENT_SPAWN as well

Code:
quest::settimer(1, 1);
and then plugged in the following to try to make the npc follow and it isn't working.

Code:
if($timer == 1){
		quest::shout("timer works");
		quest::follow($npc1, 10);
		quest::stopttimer(1);
		}
Reply With Quote