Thread: NPC Formations
View Single Post
  #1  
Old 02-06-2014, 07:34 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default NPC Formations

Hey guys. I am working with the spawninformation trying to get those plugins to work properly. I searched forums for "formation" and found a few helpful topics. I copied information from those and the formation spawning works but everything spawns at a random spot in the zone instead of right beside the leadernpc. Any idea why they wouldn't be spawning beside the leader?

I am using Trev's example.
http://www.eqemulator.org/forums/sho...ight=formation

Code:
my $LeaderNPCID = 1000041;
my $SquadNPCID = 452005;
my $SpawnDist = 10;

sub EVENT_SPAWN {

	quest::depopall($SquadNPCID);
	quest::settimer("spawn_guards", 2);
	
}

sub EVENT_TIMER {

	if ($timer eq "spawn_guards") {
		quest::stoptimer("spawn_guards");
		#Usage: plugin::SpawnInFormation(NPCID, LeaderMob, Distance, Columns, Rows, [LeadDist, MaxZDiff]);
		plugin::SpawnInFormation($SquadNPCID, $npc, $SpawnDist, 2, 2, 10, 10);
		#Usage: plugin::MoveInFormation(NPCID, [$npc = 0, OnGrid = 0, MoveToX = 0, MoveToY = 0, NoSpeedBuffs = false]);
		plugin::MoveInFormation($SquadNPCID, $npc , 1);
	}

	if ($timer eq "WPArrive") {
		quest::stoptimer("WPArrive");
		plugin::MoveInFormation($SquadNPCID, $npc, 1);
	}
	
}

my $MoveSquad = 1;
sub EVENT_WAYPOINT_DEPART {

	if ($MoveSquad)
	{
		quest::settimer("WPArrive", 0);
	}
	else {
		quest::stop();
	}

}
Thanks all!
__________________
Reply With Quote