|  |  | 
 
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  | 
	
		
   
   
      | Quests::Q&A This is the quest support section |  
	
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				03-21-2010, 05:10 PM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: Feb 2006 
						Posts: 179
					      |  |  
	| 
				  
 It's hardly for lazy people.  
For examples, NPC ID 214001 belongs to 6 different spawn2 groups.  Certainly a lot easier for someone to find 1 NPC ID over finding the 6 spawn groups it belongs to.
 
Multiply this by the 50ish NPC  IDs who I'm  prevent from spawning, it's a lot of looking up.
 
PS.  How does this look?
 
	Code: # This is a work in progress.  Do NOT use.
sub GetSpawn2GroupIDs
{
use DBI;
my $npcID = shift;
printf("Parms 1 = %d\n", $npcID);
my $confile = "eqemu_config.xml"; #default
my $zonen = "potactics"; #only for testing
my $db = "eq";
my $user = "eq";
my $pass = "eq";
my $host = "localhost";
open(F, "<$confile") or die "Unable to open config: $confile\n";
my $indb = 0;
while(<F>) {
	s/\r//g;
	if(/<database>/i) {
		$indb = 1;
	}
	next unless($indb == 1);
	if(/<\/database>/i) {
		$indb = 0;
		last;
	}
	if(/<host>(.*)<\/host>/i) {
		$host = $1;
	} elsif(/<username>(.*)<\/username>/i) {
		$user = $1;
	} elsif(/<password>(.*)<\/password>/i) {
		$pass = $1;
	} elsif(/<db>(.*)<\/db>/i) {
		$db = $1;
	}
}
if(!$db || !$user || !$pass || !$host) {
	die "Invalid database info, missing one of: host, user, password, database\n";
}
my $source = "DBI:mysql:database=$db;host=$host";
my $dbh = DBI->connect($source, $user, $pass) || die "Could not create db handle\n";
my $spawngroupIDs = $dbh->prepare("SELECT * FROM  spawnentry WHERE npcID=$npcID");
$spawngroupIDs->execute(); #run the query on the db to get list of spawngroupIDs using NPC ID that Spawn2 uses
my($val2, $spawn2id, @spawn2groupsIDs); #define some variables, cause we're cool like that
while (my $val = $spawngroupIDs->fetch()) {
	$spawn2id = $dbh->prepare("SELECT * FROM spawn2 WHERE spawngroupID=@$val[0] AND zone='$zonen'");
	$spawn2id->execute();
	$val2 = $spawn2id->fetch();
	if(@$val2[0]) {
		push(@spawn2groupsIDs, @$val2[0]);
		}
}
return @spawn2groupsIDs;
} Literally working on this right now.   Got it finding all the spawn 2 IDs for a NPCs ID, now going to work on having it accept X, Y and Z perimeters.
 
PS I wasn't able to find any script that use Disable_Spawn2 and I'm guessing part of the reason is because it is to much of a hassle to write whole lists of spawn2 points.
			
			
			
			
				  |  
 
  |  |  |  |  
	
		
	
	
	| 
			
			 
			
				03-21-2010, 07:05 PM
			
			
			
		 |  
	| 
		
			|  | Developer |  | 
					Join Date: Mar 2003 
						Posts: 1,500
					      |  |  
	| 
 I seriously think it would be easier to just put the pit mobs on a spawn_condition...
 Example: Kithicor changes night/day mobs.
 |  
	
		
	
	
	| 
			
			 
			
				03-21-2010, 07:54 PM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: Feb 2006 
						Posts: 179
					      |  |  
	| 
 
	Quote: 
	
		| 
					Originally Posted by joligario  I seriously think it would be easier to just put the pit mobs on a spawn_condition...
 Example: Kithicor changes night/day mobs.
 |  If I understand this right, I'd have to basically make a copy of all the spawn2s  in the zone and set the new set of entries in the pit to a different condition than the normal mobs, which has them disable from spawning.    Then I just use set the condition to 1 for spawned and 2 for not spawned?
 
If that is correct, I guess I could do that.  Just so newb, wasn't wanting to make significant DB changes.
 
I'm making these fixes for general consumption. |  
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				03-23-2010, 10:13 AM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: Feb 2006 
						Posts: 179
					      |  |  
	| 
				  
 
	Quote: 
	
		| 
					Originally Posted by KLS  We are not adding another quest command that does the same thing for lazy people. |  Just to show ya it's not for lazy people;  I've got my scripts working to do what I specified above and after feeding it the 55 NPC IDs, it found associated 375 spawn2 entries, 197 that were unique.
 
So, if a person wanted to do this by hand, it would be a HUGE chore looking up all the correct spawn2 IDs, to say nothing of what it would be like if you wanted to include X,Y and Z ranges.
 
Also, you can  just specify a X, Y and Z area and get a list of spawn2 areas, which certainly would be useful.
 
Here's the output from feeding those 55 NPCs:
 
	Code: Received an array of 55 NPD IDs
 npcid = 214000 spawn2 entries found = 4 spawn2s=44664,44678,44716,44745,
 npcid = 214001 spawn2 entries found = 6 spawn2s=44665,44677,44748,44765,44776,44781,
 npcid = 214002 spawn2 entries found = 5 spawn2s=44666,44708,44722,44737,44759,
 npcid = 214003 spawn2 entries found = 2 spawn2s=44667,44709,
 npcid = 214006 spawn2 entries found = 31 spawn2s=44463,44465,44468,44469,44470,44474,44475,44479,44482,44483,44484,44486,44492,44509,44510,44522,44560,44561,44563,44564,44566,44567,44570,44648,44669,44670,44672,58319,44704,44706,44787,
 npcid = 214008 spawn2 entries found = 29 spawn2s=44469,44470,44471,44478,44480,44481,44487,44492,44493,44494,44509,44510,44511,44512,44519,44560,44561,44563,44566,44569,44572,44662,44670,44672,44689,44757,44766,44767,44788,
 npcid = 214012 spawn2 entries found = 22 spawn2s=44469,44470,44471,44474,44479,44484,44485,44486,44490,44492,44495,44522,44560,44567,44570,44581,44645,44669,44672,44689,44717,44751,
 npcid = 214015 spawn2 entries found = 12 spawn2s=44473,44476,44477,44488,44491,44513,44518,44520,44571,44579,44668,44779,
 npcid = 214016 spawn2 entries found = 14 spawn2s=44479,44483,44484,44485,44486,44490,44495,44522,44567,44581,44668,44669,44672,44756,
 npcid = 214017 spawn2 entries found = 11 spawn2s=44466,44473,44477,44488,44489,44491,44492,44513,44518,44579,44617,
 npcid = 214018 spawn2 entries found = 17 spawn2s=44473,44476,44477,44488,44489,44491,44513,44518,44520,44571,44573,44574,44575,44576,44579,44668,44718,
 npcid = 214019 spawn2 entries found = 13 spawn2s=44478,44480,44481,44494,44511,44512,44519,44569,44572,44647,44670,44671,44672,
 npcid = 214020 spawn2 entries found = 9 spawn2s=44476,44489,44491,44513,44518,44521,44571,44579,44668,
 npcid = 214021 spawn2 entries found = 26 spawn2s=44479,44483,44484,44485,44490,44495,44567,44570,44573,44574,44575,44576,44581,44617,44669,44672,44673,44675,44678,44688,44715,44741,44742,44743,44747,44774,
 npcid = 214022 spawn2 entries found = 17 spawn2s=44478,44480,44481,44487,44493,44494,44511,44512,44526,44529,44569,44572,44647,44670,44672,44690,44740,
 npcid = 214023 spawn2 entries found = 10 spawn2s=44473,44476,44488,44489,44520,44521,44571,44579,44668,44672,
 npcid = 214024 spawn2 entries found = 11 spawn2s=44478,44480,44481,44487,44493,44494,44512,44519,44647,44670,44672,
 npcid = 214025 spawn2 entries found = 13 spawn2s=44484,44485,44490,44495,44522,44567,44570,44581,44669,44671,44732,44777,44778,
 npcid = 214027 spawn2 entries found = 2 spawn2s=44674,44710,
 npcid = 214028 spawn2 entries found = 10 spawn2s=44676,44682,44711,44712,44719,44720,44723,44729,44760,44764,
 npcid = 214029 spawn2 entries found = 6 spawn2s=44678,44680,44713,44724,44728,44780,
 npcid = 214030 spawn2 entries found = 4 spawn2s=44678,44681,44727,44749,
 npcid = 214038 spawn2 entries found = 4 spawn2s=44667,44687,44746,44775,
 npcid = 214040 spawn2 entries found = 4 spawn2s=44505,44506,44507,44508,
 npcid = 214043 spawn2 entries found = 1 spawn2s=44516,
 npcid = 214045 spawn2 entries found = 7 spawn2s=44494,44523,44524,44525,44527,44528,44653,
 npcid = 214046 spawn2 entries found = 5 spawn2s=44529,44661,44672,44690,44691,
 npcid = 214047 spawn2 entries found = 4 spawn2s=44523,44524,44525,44527,
 npcid = 214048 spawn2 entries found = 4 spawn2s=44524,44525,44527,44528,
 npcid = 214059 spawn2 entries found = 15 spawn2s=44478,44480,44481,44487,44493,44494,44511,44512,44569,44572,44573,44575,44576,44663,44672,
 npcid = 214070 spawn2 entries found = 1 spawn2s=44593,
 npcid = 214077 spawn2 entries found = 2 spawn2s=44462,44656,
 npcid = 214078 spawn2 entries found = 3 spawn2s=44464,44467,44655,
 npcid = 214079 spawn2 entries found = 1 spawn2s=44762,
 npcid = 214080 spawn2 entries found = 2 spawn2s=44702,44745,
 npcid = 214081 spawn2 entries found = 2 spawn2s=44678,44703,
 npcid = 214085 spawn2 entries found = 1 spawn2s=44705,
 npcid = 214087 spawn2 entries found = 1 spawn2s=44782,
 npcid = 214088 spawn2 entries found = 1 spawn2s=44721,
 npcid = 214089 spawn2 entries found = 1 spawn2s=44685,
 npcid = 214090 spawn2 entries found = 2 spawn2s=44666,44738,
 npcid = 214091 spawn2 entries found = 3 spawn2s=44642,44646,44761,
 npcid = 214093 spawn2 entries found = 1 spawn2s=44744,
 npcid = 214094 spawn2 entries found = 2 spawn2s=44641,44763,
 npcid = 214095 spawn2 entries found = 2 spawn2s=44650,44651,
 npcid = 214097 spawn2 entries found = 25 spawn2s=67014,67015,67016,67017,67018,67019,67020,67021,67022,67023,67024,67025,67026,67027,67028,67029,67030,67031,67032,67033,67034,67035,67036,67037,67038,
 npcid = 214098 spawn2 entries found = 0 spawn2s=
 npcid = 214099 spawn2 entries found = 0 spawn2s=
 npcid = 214100 spawn2 entries found = 0 spawn2s=
 npcid = 214101 spawn2 entries found = 0 spawn2s=
 npcid = 214102 spawn2 entries found = 0 spawn2s=
 npcid = 214103 spawn2 entries found = 1 spawn2s=44742,
 npcid = 214106 spawn2 entries found = 0 spawn2s=
 npcid = 214122 spawn2 entries found = 6 spawn2s=44676,44682,44711,44712,44719,44720,
 npcid = 214114 spawn2 entries found = 0 spawn2s=
Found 375 total spawn2 IDs and 197 unique spawn2 IDs.
			
			
			
			
				  |  
 
  |  |  |  |  
	
		
	
	
	
	
	| 
	|  Posting Rules |  
	| 
		
		You may not post new threads You may not post replies You may not post attachments You may not edit your posts 
 HTML code is Off 
 |  |  |  All times are GMT -4. The time now is 05:50 PM.
 
 |  |  
    |  |  |  |  
    |  |  |  |  
     |  |  |  |  
 |  |