Jump to content
!-->
• Join-Us

https://metin2.dev is the 1st international community on Metin2 development. Join us to develop your skills and share your knowledge with the community, respectful and ethical forum.

• 0

Drop table

Question

I have head about this a couple times.

How can i do this?

I want to make a table in database which contains the drops. (basically i dont want to suffer with writing the drop in txt stuff)

• Answers 3
• Created
• Last Reply

Recommended Posts

• 0

Here is one quest with table:

```quest hdf begin
state start begin
function ab()
local ju = {
--mob-id--min-level--max-level---item-count---percentage---item-id's----percentage change per level
{101,     1,         10,             3,        50,30,20,    19, 20, 21,        1},
}
return ju
end
when kill with not npc.is_pc() begin
local boni,lck,per,luck,bsp = 0,0,0,0,hdf.ab()
for i = 1, table.getn(bsp)+1, 1 do
if npc.get_race() == bsp[i][1] then
if pc.get_level() >= bsp[i][2] and pc.get_level() <= bsp[i][3] then
boni = (bsp[i][2] - pc.get_level()) * (-1)
boni = boni * bsp[i][bsp[i][4]*2+5]
luck = number(1,bsp[i][4])
luck = luck + 4 + bsp[i][4]
lck = luck - bsp[i][4]
per = 100 - bsp[i][lck] + boni
lck = number(1,100)
if lck > per then
pc.give_item2(bsp[i][luck], 1)
end
end
end
end
end
end
end  ```
• 2
Share on other sites

• 0

Thank you very much!

I will use this one!

One more question! I would like the mob drop items to player to the ground with the name on it. How?

Share on other sites

• 0

Replace pc.give_item2(bsp[luck],1) with game.drop_item_with_ownership(bsp[luck],1)

• 2

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

1. 0

2. 82

3. 4

4. 1

5. 1

6. 0

7. 23

8. 2

9. 976

• Recently Browsing

• 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.