Jump to content

How does mob drop item actually work?


Go to solution Solved by Mitachi,

Recommended Posts

So lets say I have this mob drop for 8027, lvl 90 stone

 

Group	전운석
{
	Mob	8027
	Type	drop
	1	151	1	3
	2	152	1	12
	3	153	1	8
	4	5091	1	5
	5	5092	1	15
	6	5093	1	10
	7	141	1	5
	8	142	1	15
	9	143	1	10
	10	3131	1	10
	11	3132	1	15
	12	3133	1	20
	13	1101	1	10
	14	1102	1	15
	15	1103	1	20
	16	7131	1	10
	17	7132	1	15
	18	7133	1	20
	19	2141	1	10
	20	2142	1	15
	21	2143	1	20
	22	11681	1	10
	23	11682	1	15
	24	11683	1	20
	25	11881	1	10
	26	11882	1	15
	27	11883	1	20
	28	11481	1	10
	29	11482	1	15
	30	11483	1	20
	31	11281	1	10
	32	11282	1	15
	33	11283	1	20
	34	17164	1	9
	35	17165	1	24
	36	17166	1	14
	37	11490	1	3
	38	11492	1	8
	39	11493	1	10
	40	11290	1	3
	41	11292	1	8
	42	11293	1	10
	43	11690	1	3
	44	11692	1	8
	45	11693	1	10
	46	11890	1	3
	47	11892	1	8
	48	11893	1	10
	49	27992	1	3
	50	27993	1	3
	51	27994	1	3
	52	14201	1	5
	53	14202	1	10
	54	14203	1	15
	55	16201	1	5
	56	16202	1	10
	57	16203	1	15
	58	17201	1	5
	59	17202	1	10
	60	17203	1	15
	61	15201	1	5
	62	15202	1	10
	63	15203	1	15
	64	13060	1	5
	65	13061	1	10
	66	13063	1	15
	67	13080	1	5
	68	13081	1	10
	69	13083	1	15
	70	13100	1	5
	71	13101	1	10
	72	13102	1	15
	73	13120	1	5
	74	13121	1	10
	75	13122	1	15
	76	17107	1	5
	77	17108	1	10
	78	17109	1	15
	79	101	1	100
}

For this drop settings, it drops 1-2 items, sometimes none, very rare 4-5 items, but ~never more

Whats the logic here, how does this work, why isn't like 79 always given when the stone dies?

Link to comment
https://metin2.dev/topic/32557-how-does-mob-drop-item-actually-work/
Share on other sites

  • Honorable Member
14 hours ago, astroNOT said:

why isn't like 79 always given when the stone dies?

Because the number you see represents a quarter of the real drop percent.

If you want an item to always drop, its drop pct should be 400, not 100.

  • Metin2 Dev 1
  • Love 2

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

  • Developer
  • Solution

Well, I did something to remember this in the past, as @ Syreldar said, the Type drop is actually 400% oriented.

There are more than 3 types counting thiefgloves, but the mostly used are these 3:

  1. Type    drop
  2. Type    level_limit
  3. Type    kill_drop

 

Type drop (really common)

#1.	Type	drop
	He hasn't a 100 pct, but 400 pct

[*] > Example:

Group	Example_Type_Drop
{
	Mob	101
	Type	drop
	1	19	1	400 -- 100%
	2	29	1	32  -- 8%
}

 

Type level_limit (used usually for certains monsters, like Deathripper)

#2.	Type	level_limit
	He have a 100 pct.
	The limit determines which level you can get the item from

[*] > Example:

Group	Example_Type_Level_limit
{
	Mob	2071
	Type	limit
	level_limit	60
	1	19	1	100 -- 100%
	2	29	1	32  -- 32%
}


Type Kill_drop (really rare, used for monkeys only I guess)

#3.	Type	Kill_drop
	He have a 100 pct, the peculiarity is:
	You can determine after how many monsters you have the % to drop the item.

[*] > Example:

Group	Example_Type_Kill_drop
{
	Mob	5162
	Kill_drop	10 -- Every 10 mob, you have the% to get the item
	Type	drop
	1	19	1	100 -- 100% prob(Every 10 mob)
	2	29	1	32  -- 32% prob(Every 10 mob)
}
  • Metin2 Dev 3
  • Smile Tear 1
  • Good 1
  • muscle 1
  • Love 1
  • Love 5

Villains are not born, they are made.
Join

  • 2 weeks later...
  • 1 year later...

I have an added question to this. Cursed mobs also use "kill_drop" for the level 30 weapons. What does this additional value mean (the one in red)? I'm assuming the "10" is 10% chance to drop after killing 100 Cursed Wolves. If I try removing the "25" it breaks the code so it is there for some kind of purpose.

Group    Cursed_Wolf
{
    Kill_drop    100
    Mob    131
    Type    kill
    1    5110    1    25    10
    2    7160    1    25    10
}

  • Honorable Member
37 minutes ago, StarSoul said:

I have an added question to this. Cursed mobs also use "kill_drop" for the level 30 weapons. What does this additional value mean (the one in red)? I'm assuming the "10" is 10% chance to drop after killing 100 Cursed Wolves. If I try removing the "25" it breaks the code so it is there for some kind of purpose.

Group    Cursed_Wolf
{
    Kill_drop    100
    Mob    131
    Type    kill
    1    5110    1    25    10
    2    7160    1    25    10
}

The 4th one is the rarePct/alterToMagicItemPct, the chance for the item to drop with bonuses already included.

  • Good 1
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

  • 3 weeks later...
  • Premium
On 5/11/2025 at 10:43 PM, StarSoul said:

I have an added question to this. Cursed mobs also use "kill_drop" for the level 30 weapons. What does this additional value mean (the one in red)? I'm assuming the "10" is 10% chance to drop after killing 100 Cursed Wolves. If I try removing the "25" it breaks the code so it is there for some kind of purpose.

Group    Cursed_Wolf
{
    Kill_drop    100
    Mob    131
    Type    kill
    1    5110    1    25    10
    2    7160    1    25    10
}

The 25 is the percent between the other items, it acts like the chests. In this case then, after 100 kills of the mob with vnum 131, there is a 50% to drop either 5110 or 7160, because they have the same "weight" (if for example you have three items with 25 5 and 5 pcts, the one with 25 it would have 66% chance to drop). You can drop only one of these items with this type of drop. Internally it goes:

iPercent = iDeltaPercent(100) * 40000 / 100 = 40000

if (iPercent > rand(1, iRandRange)) { //drop }

where iRandRange (default 4000000) is also influence by the level difference, so for example, using 1 would not always be a 100% drop.

  • Think 1
  • 4 weeks later...
On 5/31/2025 at 9:54 AM, Intel said:

The 25 is the percent between the other items, it acts like the chests. In this case then, after 100 kills of the mob with vnum 131, there is a 50% to drop either 5110 or 7160, because they have the same "weight" (if for example you have three items with 25 5 and 5 pcts, the one with 25 it would have 66% chance to drop). You can drop only one of these items with this type of drop. Internally it goes:

iPercent = iDeltaPercent(100) * 40000 / 100 = 40000

if (iPercent > rand(1, iRandRange)) { //drop }

where iRandRange (default 4000000) is also influence by the level difference, so for example, using 1 would not always be a 100% drop.

This is difficult for me to follow. I don't quite understand what you mean. From what I can gather, the "10" value is not 10% chance to drop but 50% chance instead?

  • Premium
36 minutes ago, StarSoul said:

This is difficult for me to follow. I don't quite understand what you mean. From what I can gather, the "10" value is not 10% chance to drop but 50% chance instead?

No, in

Group    Cursed_Wolf
{
    Kill_drop    100
    Mob    131
    Type    kill
    1    5110    1    25    10
    2    7160    1    25    10
} 

the 10 is the iRareDropPct, so the percentage that an item gets a bonus when dropped. 25 and 25 are the percentages to drop, but, considering the drop is of type kill, this drop is as it follows:

100 monsters (vnum 131) to kill to drop one of the items listed. The number 100 is influenced by the level difference between the monster and the player.

The items listed are dropped with the same rules of the chests (you'll notice the GetOneIndex function is both in the CSpecialItemGroup class and CMobItemGroup). Both 5110 and 7160 got the same value, for two items total, so there's a 50% to drop one or the other.

		int GetOneIndex() const
		{
			int n = number(1, m_vecProbs.back());
			auto it = lower_bound(m_vecProbs.begin(), m_vecProbs.end(), n);
			return std::distance(m_vecProbs.begin(), it);
		}

 

6 hours ago, Intel said:

No, in

Group    Cursed_Wolf
{
    Kill_drop    100
    Mob    131
    Type    kill
    1    5110    1    25    10
    2    7160    1    25    10
} 

the 10 is the iRareDropPct, so the percentage that an item gets a bonus when dropped. 25 and 25 are the percentages to drop, but, considering the drop is of type kill, this drop is as it follows:

100 monsters (vnum 131) to kill to drop one of the items listed. The number 100 is influenced by the level difference between the monster and the player.

The items listed are dropped with the same rules of the chests (you'll notice the GetOneIndex function is both in the CSpecialItemGroup class and CMobItemGroup). Both 5110 and 7160 got the same value, for two items total, so there's a 50% to drop one or the other.

		int GetOneIndex() const
		{
			int n = number(1, m_vecProbs.back());
			auto it = lower_bound(m_vecProbs.begin(), m_vecProbs.end(), n);
			return std::distance(m_vecProbs.begin(), it);
		}

 

Okay, I'm starting to understand now. I'm not much of a coder, but I'm learning. The function you showed, what is it doing exactly? Why does it change the drop chance to 50%?

Thank you for your input so far. I did notice when testing in-game, a while back, that what you said was true. I had a 50% chance to drop one or the other but I didn't know exactly why. 

  • Premium
8 hours ago, StarSoul said:

Okay, I'm starting to understand now. I'm not much of a coder, but I'm learning. The function you showed, what is it doing exactly? Why does it change the drop chance to 50%?

Thank you for your input so far. I did notice when testing in-game, a while back, that what you said was true. I had a 50% chance to drop one or the other but I didn't know exactly why. 

In this case, there's a vector, it adds 25 first, then it adds 25 (the last value) + 25, so 50

Therefore we have vector{25,50}

It calculates a random between 1 and 50, and then finds the position of the number that comes the closest in the vector (so, 1 to 25 position 0, 26 to 50 position 1: https://godbolt.org/z/eYcvE57e4)

That index (0 or 1 in this case), is then the index used in the vector that contains the list of the items that the monster drops:

		const SMobItemGroupInfo& GetOne() const
		{
			return m_vecItems[GetOneIndex()];
		}

 

Edited by Intel

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.