Jump to content
Sign in to follow this  
Rumor

Quest-based Pearl rate from clams

Recommended Posts

I had problems in my server with players filling their inventory and opening clams, so all the drops from the clams would fall on the floor and make people lag. This quest resolves that issue and allows you to set the chance of each drop from the clam, meaning you could make it drop whatever you like too.

 

Thanks to Nightwish for this one.

 

You need to set your clam "Type" in the database to "18".

--powered by nightwish 4 nirvana ;) --
quest clams begin
	state start begin
		when 27987.use begin
		if pc.get_empty_inventory_count() < 1 then
		chat("You don't have enough inventory space.")
		else
		pc.remove_item(27987,1)
		local rand = number(1,30)
                if rand == 1 then pc.give_item2(27992,1)
				elseif rand == 2 then pc.give_item2(27993,1)
				elseif rand == 3 then pc.give_item2(27994,1)
				elseif rand >= 4 then pc.give_item2(27990,1)
		

			end -- inventory check
		end -- when .use end
	end -- state "start" end
end -- Quest end
end
  • Love 5

Share this post


Link to post

You don't need a inventory space checker because when you remove a 27987 you have space, and the quest can be shortly.

when 27987.use begin
pc.remove_item(item.get_vnum(),1)
local perlas,prob,item = {27992,27993,27994},number(1,30),0
if prob > 3 then item=27990 else item=perlas[prob] end
pc.give_item(item,1)
end
Kind regards.

Share this post


Link to post

true, but with the check you're able to inform the player the reason why they can't open the clam instead of them thinking they are disconnected and haven't been dropped as a client yet.

  • Love 1

Share this post


Link to post

You don't need a inventory space checker because when you remove a 27987 you have space, and the quest can be shortly.

when 27987.use begin
pc.remove_item(item.get_vnum(),1)
local perlas,prob,item = {27992,27993,27994},number(1,30),0
if prob > 3 then item=27990 else item=perlas[prob] end
pc.give_item(item,1)
end
Kind regards.

 

This doesnt work if the clams are stackable. Then only in 1 of 200 cases there will be a free slot :D

Share this post


Link to post

Nice to see my quest as one of the first topics here. Its a basic quest and I also used this for my starterset at rev 2089. I just made the the box non tradable and blocked the opportunity to lay it into savebox. So ppl cant trade/savebox or fill their inventory and let the items fall on the ground and pick that with other chars. But be careful with items which need more than 1 slot :)

King regards,

Nightwish

Share this post


Link to post
when 27987.use begin
	if pc.get_empty_inventory_count() < 1 then
		return syschat("You don't have enough inventory space")
	end
	local rnd = math.random(27992,28022)
	if rnd <= 27994 then
		pc.give_item2(rnd)
	else
		pc.give_item2(27990)
	end
end
  • Love 2

Share this post


Link to post

When a player get more of clams with type 18 they need to stack them manually so would be easy if you make it type 23 and set from special_item_group.txt

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.