EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Random Ground Spawns? (https://www.eqemulator.org/forums/showthread.php?t=39827)

Bandor 07-04-2015 05:33 AM

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.

dagulus2 07-04-2015 07:53 AM

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.

rencro 07-04-2015 11:14 AM

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


Shendare 07-04-2015 12:48 PM

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.

Bandor 07-05-2015 05:22 PM

Quote:

Originally Posted by rencro (Post 241459)
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.


All times are GMT -4. The time now is 03:58 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.