Jump to content
×
×
  • Create New...
  • 0

OX Event Give Prize


Karbust

Question

  • Web Developer

Hello

I'm trying to set up the automatic OX Event, but I want to change some things (I'm using HaveBeen's quest), one of the things is the automatic prize giver, I want to set up a table (already has) but with percentages, I mean, like the monsters drop, it gives the item based on the percentage of getting it.

				local itemlist = {11299,11499,11699,11899}
				game.drop_item(itemlist[number(1,table.getn(itemlist))],1)

This is what I already have.

Thank you in advance

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

u can use number function soi give u example.

local chance = number(1, 100)

if chance <=20 then

game.drop_item(11,1)

elseif chance >= 21 and chance <= 40 then

game.drop_item(19,1)

end

so the bigger u make the chance the harder will drop for ex number (1,1000)
 

if chance <=900 then

game.drop_item(19,1)

end
Link to comment
Share on other sites

  • 0
  • Web Developer
13 hours ago, Root said:

u can use number function soi give u example.

local chance = number(1, 100)

if chance <=20 then

game.drop_item(11,1)

elseif chance >= 21 and chance <= 40 then

game.drop_item(19,1)

end

so the bigger u make the chance the harder will drop for ex number (1,1000)
 

if chance <=900 then

game.drop_item(19,1)

end

I managed to use a function on GFquestlib.lua:

				local settings = oxevents.set_settings()
				local reward = get_random_vnum_from_table(settings.premio)
				oxevent.give_item(reward,1)

----------------------------------------------------------------------------------------------------------

Now I've another question, how can I start the event at a specified hour? Like, cronjob, everyday at the same hour.

I have the boot event (got it from vanilla source, I don't know if it useful for this situation)

Thanks

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.