Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2010, 05:14 AM
dreamseer
Fire Beetle
 
Join Date: Feb 2010
Location: York
Posts: 22
Default

I was wondering this is such a monumental idea, would it be possible to have a group of mobs randomly roaming?

Perhaps one mob does the random roam and the other "follow" or something.

My thinking is:
Pack of Wolves Hunting.
Small detachment of soldiers on random partol.
Group of Marauding Bandits
Reply With Quote
  #2  
Old 04-03-2010, 06:11 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, it is completely possible, if you know the formation you want them in. Here is a snippet of a script I made that does just that and has 4 NPCs that follow surrounding the boss mob this script is on:

Code:
#Random Roamer Group Script

my $SpawnDist = 10;

#Save NPC Entity IDs here (4 total)
my $NPCPlusX = 0;
my $NPCMinusX = 0;
my $NPCPlusY = 0;
my $NPCMinusY = 0;

sub EVENT_SPAWN {

	my $StartMove = plugin::RandomRange(10, 30);
	quest::settimer("roam", $StartMove);
	quest::settimer("spawn_guards", 5);
	
}

sub EVENT_TIMER {

	if ($timer eq "roam") {
		quest::stoptimer("roam");
		plugin::RandomRoam(100,100);
		my $GuardX = $npc->GetGuardPointX();
		my $GuardY = $npc->GetGuardPointY();
		my $GuardZ = $npc->GetGuardPointZ();
		my $NPC1 = $entity_list->GetNPCByID($NPCPlusX);
		my $NPC2 = $entity_list->GetNPCByID($NPCMinusX);
		my $NPC3 = $entity_list->GetNPCByID($NPCPlusY);
		my $NPC4 = $entity_list->GetNPCByID($NPCMinusY);
		
		if ($NPC1) {
			$NPC1->MoveTo($GuardX + $SpawnDist, $GuardY, $GuardZ, 0, 1);
		}
		if ($NPC2) {
			$NPC2->MoveTo($GuardX - $SpawnDist, $GuardY, $GuardZ, 0, 1);
		}
		if ($NPC3) {
			$NPC3->MoveTo($GuardX, $GuardY + $SpawnDist, $GuardZ, 0, 1);
		}
		if ($NPC4) {
			$NPC4->MoveTo($GuardX, $GuardY - $SpawnDist, $GuardZ, 0, 1);
		}
		my $NextMove = plugin::RandomRange(5, 30);
		quest::settimer("roam", $NextMove);
	}
	
	if ($timer eq "spawn_guards") {
		quest::stoptimer("spawn_guards");
		my $MyX = $npc->GetSpawnPointX();
		my $MyY = $npc->GetSpawnPointY();
		my $MyZ = $npc->GetSpawnPointZ();
		quest::spawn(2701558,0,0,$MyX + $SpawnDist, $MyY, $MyZ);	#NPCPlusX
		quest::spawn(2701558,0,0,$MyX - $SpawnDist, $MyY, $MyZ);	#NPCMinusX
		quest::spawn(2701558,0,0,$MyX, $MyY + $SpawnDist, $MyZ);	#NPCPlusY
		quest::spawn(2701558,0,0,$MyX, $MyY - $SpawnDist, $MyZ);	#NPCMinusY
		quest::settimer("SetNPCVars", 2);
	}
	
	if ($timer eq "SetNPCVars") {
		quest::stoptimer("SetNPCVars");
		my $MySpawnedX = $npc->GetSpawnPointX();
		my $MySpawnedY = $npc->GetSpawnPointY();

		my @npclist = $entity_list->GetNPCList();
		foreach $ent (@npclist)
		{
			if($ent->GetNPCTypeID() == 2701558) {
				my $GuardianX = $ent->GetX();
				my $GuardianY = $ent->GetY();
				
				if($GuardianX > $MySpawnedX + $SpawnDist - 2) {
					$NPCPlusX = $ent->GetID();
				}
				if($GuardianX < $MySpawnedX - $SpawnDist + 2) {
					$NPCMinusX = $ent->GetID();
				}
				if($GuardianY > $MySpawnedY + $SpawnDist - 2) {
					$NPCPlusY = $ent->GetID();
				}
				if($GuardianY < $MySpawnedY - $SpawnDist + 2) {
					$NPCMinusY = $ent->GetID();
				}
			}
		}
	}

}
There is actually a lot more to my script, but not directly related to moving a group of mobs. This script here should give you the basic idea of what to do.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:06 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3