|  |  | 
 
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  | 
	
		
   
   
      | Quests::Q&A This is the quest support section |  
	
	
		
	
	
	| 
			
			 
			
				07-04-2015, 05:33 AM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: May 2014 
						Posts: 209
					      |  |  
	| 
				 Random Ground Spawns? 
 So I have a particular item on my server that is used in many many quests,and turns out this specific item is a ground spawn. In an effort to save myself years of time adding ground spawns everywhere for this,I figured there must be a way to make this thing spawn 25 times in a random location of the zone,does anyone know if this is at all possible? Really dont wanna have to run around getting locations to spawn this thing al oover the place lol. |  
	
		
	
	
	| 
			
			 
			
				07-04-2015, 07:53 AM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: Feb 2013 
						Posts: 220
					      |  |  
	| 
 It think you just set 'max' to 25 and make the min and max values cover the whole zone?
 Cant say I have ever played with them much though.
 |  
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				07-04-2015, 11:14 AM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: Sep 2008 Location: So. California 
						Posts: 219
					      |  |  
	| 
				  
 I use this for simulating fruit being knocked out of a tree. it can be modified to accomplish what you like. The fun-stuff is happening in the Ground_Stuff function. Note: from my experience setting the z axis above ground level will cause the items to spawn in the air then float down to the ground.(but havent played with this since the gravity changes were made a few months back) 
	Code: -- abe the abandoned custom
function event_spawn(e)
	e.self:SetRunning(true);
end
function event_say(e)
	if(e.message:findi("hail")) then
		e.self:Say("Lets just get this done.");
	end
end
function event_waypoint_arrive(e)
	
	if(e.wp == 1) then
		eq.unique_spawn(98051,14,0,661.77,-1774.69,3.78,78.5); -- spawns dillon
	elseif(e.wp == 2) then
		e.self:Emote("runs up besides you");
		e.self:SetRunning(false);
	elseif(e.wp == 3) then
		e.self:Emote("grabs a long bamboo pole from the hut.");
		eq.signal(98036,1,5000);
	elseif(e.wp == 4) then
		e.self:Say("Ok, I'm going to use this stick to knock down the ripe fruit, be ready to pick up any that fall to the ground, only the ripe ones will fall.");
	elseif(e.wp == 5 or e.wp == 7 or e.wp == 9) then
		e.self:Emote(eq.ChooseRandom("bangs his bamboo stick against the branches in the upper part of the tree.","raises his stick into the branches"));
	elseif(e.wp == 6) then
		e.self:Say("I see a couple dropping now, grab them up!");
		eq.create_ground_object(30619, 993.07, -1533.8, 34.59, 0, 30000);
		eq.create_ground_object(30619, 999.44, -1567.8, 45, 0, 30000);
	elseif(e.wp == 8 or e.wp == 10) then
		Ground_Stuff(e);
	end
end
function event_signal(e)
		e.self:Say("Let's go.");
end	
function Ground_Stuff(e)
	local xloc = e.self:GetX();
	local yloc = e.self:GetY();
	local zloc = e.self:GetZ();
	local RandomNumber = 0;
	RandomNumber = math.random(100);
	
	if(RandomNumber <=45) then
		e.self:Say(eq.ChooseRandom("Nothing.","Hmm..","Oh well.","On to the next one.","Moving right along"));
	elseif(RandomNumber > 45 and RandomNumber <= 75) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 75 and RandomNumber <= 90) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 90 and RandomNumber <= 95) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 95 and RandomNumber <= 98) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 98) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	end
end
			
			
			
			
				  |  
 
  |  |  |  |  
	
		
	
	
	| 
			
			 
			
				07-04-2015, 12:48 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: Apr 2009 Location: California 
						Posts: 814
					      |  |  
	| 
 The downside to truly random ground spawn locations is that it's easy for them to spawn in inaccessible places... inside trees, rocks, walls, water, etc. That generally makes it smarter to run around and choose locations without those obstacles nearby, adding a little bit of randomness to the spawn locations while ensuring that the items are still accessible. |  
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				07-05-2015, 05:22 PM
			
			
			
		 |  
	| 
		
			
			| Hill Giant |  | 
					Join Date: May 2014 
						Posts: 209
					      |  |  
	| 
				  
 
	Quote: 
	
		| 
					Originally Posted by rencro  I use this for simulating fruit being knocked out of a tree. it can be modified to accomplish what you like. The fun-stuff is happening in the Ground_Stuff function. Note: from my experience setting the z axis above ground level will cause the items to spawn in the air then float down to the ground.(but havent played with this since the gravity changes were made a few months back) 
	Code: -- abe the abandoned custom
function event_spawn(e)
	e.self:SetRunning(true);
end
function event_say(e)
	if(e.message:findi("hail")) then
		e.self:Say("Lets just get this done.");
	end
end
function event_waypoint_arrive(e)
	
	if(e.wp == 1) then
		eq.unique_spawn(98051,14,0,661.77,-1774.69,3.78,78.5); -- spawns dillon
	elseif(e.wp == 2) then
		e.self:Emote("runs up besides you");
		e.self:SetRunning(false);
	elseif(e.wp == 3) then
		e.self:Emote("grabs a long bamboo pole from the hut.");
		eq.signal(98036,1,5000);
	elseif(e.wp == 4) then
		e.self:Say("Ok, I'm going to use this stick to knock down the ripe fruit, be ready to pick up any that fall to the ground, only the ripe ones will fall.");
	elseif(e.wp == 5 or e.wp == 7 or e.wp == 9) then
		e.self:Emote(eq.ChooseRandom("bangs his bamboo stick against the branches in the upper part of the tree.","raises his stick into the branches"));
	elseif(e.wp == 6) then
		e.self:Say("I see a couple dropping now, grab them up!");
		eq.create_ground_object(30619, 993.07, -1533.8, 34.59, 0, 30000);
		eq.create_ground_object(30619, 999.44, -1567.8, 45, 0, 30000);
	elseif(e.wp == 8 or e.wp == 10) then
		Ground_Stuff(e);
	end
end
function event_signal(e)
		e.self:Say("Let's go.");
end	
function Ground_Stuff(e)
	local xloc = e.self:GetX();
	local yloc = e.self:GetY();
	local zloc = e.self:GetZ();
	local RandomNumber = 0;
	RandomNumber = math.random(100);
	
	if(RandomNumber <=45) then
		e.self:Say(eq.ChooseRandom("Nothing.","Hmm..","Oh well.","On to the next one.","Moving right along"));
	elseif(RandomNumber > 45 and RandomNumber <= 75) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 75 and RandomNumber <= 90) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 90 and RandomNumber <= 95) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 95 and RandomNumber <= 98) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	elseif(RandomNumber > 98) then
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
		eq.create_ground_object(30619,xloc + math.random(-20,20),yloc + math.random(-10,10),zloc+25,0,15000);
	end
end |  
Im assuming this is Lua? Was hoping to do something in perl as Lua is greek to me lol. I will admit I didnt think of the items spawning in unreachable area's. Just seems like a ton of work running around to spawn this thing as much as I would like lol. |  
 
  |  |  |  |  
	
		
	
	
	
	
	| 
	|  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 07:32 PM.
 
 |  |  
    |  |  |  |  
    |  |  |  |  
     |  |  |  |  
 |  |