View Single Post
  #13  
Old 10-23-2009, 10:32 PM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

ok i'm done for the night, i'm gonna post what I got, and how its working, maybe someone can tell what i'm doin wrong.

NPC A

Code:
if($signal == 12) {
		if(defined($qglobals{$name."partywalk"})) {
			quest::signalwith(189492,11,0);
		}
	}
used to loop NPC B's moveto.

NPC B part 1
Code:
if($signal == 5){
		quest::say("Thanks arias, i'm following you.");
		my $x = $npc->GetX();
		my $y = $npc->GetY();
		my $z = $npc->GetZ();
		my $h = $npc->GetHeading();
		my $x_loc = 0;
		my $y_loc = 0;
		my $z_loc = 0;
		my $h_loc = 0;
		#quest::say("checking for mob");
		my $target_to_follow = $entity_list->GetMobByNpcTypeID(189490);
		if($target_to_follow){
		#	quest::say("found mob, get coords");
			$x_loc = $target_to_follow->GetX();
			$y_loc = $target_to_follow->GetY();
			$z_loc = $target_to_follow->GetZ();
			$h_loc = $target_to_follow->GetHeading();
		#	quest::say("mobs coords is $x_loc, $y_loc, $z_loc");
		}
	#	quest::say("setting run mode to 1");
		quest::SetRunning(1);
		#	quest::say("while state executing");
			if($x != $x_loc && $y != $y_loc + 10) {
					quest::moveto($x_loc,$y_loc + 10,$z,$h,1);
			}
		quest::say("sending signal");
		quest::signalwith(189490,12,0);
	}
gets signal 5 from NPC A, starts everything up. (not included here, as it works.)

NPC B part 2
Code:
if($signal == 11) {
		my $x = $npc->GetX();
		my $y = $npc->GetY();
		my $z = $npc->GetZ();
		my $h = $npc->GetHeading();
		my $x_loc = 0;
		my $y_loc = 0;
		my $z_loc = 0;
		my $h_loc = 0;
	#	quest::say("checking for mob");
		my $target_to_follow = $entity_list->GetMobByNpcTypeID(189490);
		if($target_to_follow){
			quest::say("found mob, get coords");
			$x_loc = $target_to_follow->GetX();
			$y_loc = $target_to_follow->GetY();
			$z_loc = $target_to_follow->GetZ();
			$h_loc = $target_to_follow->getHeading();
		}
		if($x != $x_loc && $y != $y_loc - 10) {
			quest::moveto($x_loc,$y_loc - 10,$z_loc,$h_loc,1);
			}
		quest::say("sending signal");
		quest::signalwith(189490,12,0);
	}
this is to continue the loop, when recieving signal 11 from NPC A (code above).


all globals are defined, and everything starts up, NPC moves one time, to first coords it finds when inital script is started. then nothing. npc just stands there. I really hope someone can help me figure this out. thanks
__________________
Server Op of Bonds of Strength(custom-Legit)
Reply With Quote