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
|