View Single Post
  #4  
Old 09-13-2010, 04:38 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Hmm View Post
This fixes same problem with sitting npcs?
Most likely not, but I have a Dragon Statue that my players will heavily navigate through here with the next content expansion coming up soon here. And it stores its heading for each time a client talks to the NPC, so it never moves an inch. You can achieve this by doing the following:


Code:
sub EVENT_SPAWN{
quest::settimer("GetVars", 1);
}

sub EVENT_TIMER{
	if ($timer eq "GetVars"){
			my $HEADING = $npc->GetHeading();
			my $NX = $npc->GetX();
			my $NY = $npc->GetY();
			my $NZ = $npc->GetZ();
			$npc->SetEntityVariable(70, $NX);
			$npc->SetEntityVariable(71, $NY);
			$npc->SetEntityVariable(72, $NZ);
			$npc->SetEntityVariable(73, $HEADING);
			quest::stoptimer("GetVars");
			}
	if($timer eq "moveback"){
			my $NX = $npc->GetEntityVariable(70);
			my $NY = $npc->GetEntityVariable(71);
			my $NZ = $npc->GetEntityVariable(72);
			my $HEADING = $npc->GetEntityVariable(73);
			$npc->GMMove($NX, $NY, $NZ, $HEADING);
			quest::stoptimer("moveback");
			}
}

sub EVENT_SAY{
my $NX = $npc->GetEntityVariable(70);
			my $NY = $npc->GetEntityVariable(71);
			my $NZ = $npc->GetEntityVariable(72);
			my $HEADING = $npc->GetEntityVariable(73);
			$npc->GMMove($NX, $NY, $NZ, $HEADING);
			quest::settimer("moveback", 1);

}
Reply With Quote