*Problemă/Întrebare: mob_drop_item.txt
Tipologie server: PvM Hard
*Resursă folosită: none
*ServerFiles utilizat: myself
*Syserr:none
Poză:none
*Detalii suplimentare:
Hello people, the first, i hope all goes well, i write this post, because I wanted to know if someone could answer me a few questions about the mob_drop_item.txt.
The question is that I was wondering if there is any way to make a random object drop from +0 to +9 in the mob_drop, without having to add the same id repeatedly, that is, for example this is the normal mob_drop:
Group Nazox
{
Type drop
Mob 171
1 11290 1 20
2 11295 1 10
3 11299 1 10
}
and my idea:
Group Nazox
{
Type drop
Mob 171
1 11290~99 1 20
}
or something else xD!, I also wanted to know if there is any way to balance the drop, since if for example I place a 50% drop, when killing many mobs that item falls many times, but if on the contrary I place a normal number like 2 it hardly falls, as shown Could I do so that it does not fall too much so fast or so little, that is to say in equilibrium? I know this would be via source, but any ideas?
[Question]About Mob_drop_item.txt
- Petrinel
-

- Mesaje: 539
- Membru din: 31 Mar 2018, 00:58
- Server: Fara
- Regat: Jinno
- Aprecieri: 319
- Mulţumiri: 101
- Discord: Copiază ID
[EN]You have 24 hours to edit your topic according to the posting model, otherwise it will go in the archive.
probleme/model-postare-intrebare-sau-pr ... 67107.html
probleme/model-postare-intrebare-sau-pr ... 67107.html
- Nazox
-

- Mesaje: 106
- Membru din: 28 Iul 2015, 00:45
- Server: metin2.es
- Regat: Chunjo
- Aprecieri: 170
- Mulţumiri: 22
- Discord: Copiază ID
- Kidro
-

- Mesaje: 2487
- Membru din: 29 Aug 2019, 16:49
- Aprecieri: 331
- Mulţumiri: 5190
- Discord: Copiază ID
That's an little exemple.
quest cufar_farm begin
state start begin
function antibug()
pc.setqf("anti_bug", get_time()+5)
end
when 20505.kill begin
if pc.getqf("anti_bug") <= get_time() then
npc.kill()
local s=number(1,15)
if s == 1 then
game.drop_item_with_ownership(49960,1)
cufar_farm.antibug()
elseif s == 2 then
game.drop_item_with_ownership(49920,1)
cufar_farm.antibug()
elseif s == 3 then
game.drop_item_with_ownership(49930,1)
cufar_farm.antibug()
elseif s == 4 then
game.drop_item_with_ownership(49940,1)
cufar_farm.antibug()
elseif s == 5 then
game.drop_item_with_ownership(49950,1)
cufar_farm.antibug()
elseif s == 6 then
game.drop_item_with_ownership(96230,1)
cufar_farm.antibug()
elseif s == 7 then
game.drop_item_with_ownership(96220,1)
cufar_farm.antibug()
elseif s == 8 then
game.drop_item_with_ownership(96200,1)
cufar_farm.antibug()
elseif s == 9 then
game.drop_item_with_ownership(96210,1)
cufar_farm.antibug()
elseif s == 10 then
game.drop_item_with_ownership(96240,1)
cufar_farm.antibug()
elseif s == 11 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 12 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 13 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 14 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 15 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
end
end
end
end
end
quest cufar_farm begin
state start begin
function antibug()
pc.setqf("anti_bug", get_time()+5)
end
when 20505.kill begin
if pc.getqf("anti_bug") <= get_time() then
npc.kill()
local s=number(1,15)
if s == 1 then
game.drop_item_with_ownership(49960,1)
cufar_farm.antibug()
elseif s == 2 then
game.drop_item_with_ownership(49920,1)
cufar_farm.antibug()
elseif s == 3 then
game.drop_item_with_ownership(49930,1)
cufar_farm.antibug()
elseif s == 4 then
game.drop_item_with_ownership(49940,1)
cufar_farm.antibug()
elseif s == 5 then
game.drop_item_with_ownership(49950,1)
cufar_farm.antibug()
elseif s == 6 then
game.drop_item_with_ownership(96230,1)
cufar_farm.antibug()
elseif s == 7 then
game.drop_item_with_ownership(96220,1)
cufar_farm.antibug()
elseif s == 8 then
game.drop_item_with_ownership(96200,1)
cufar_farm.antibug()
elseif s == 9 then
game.drop_item_with_ownership(96210,1)
cufar_farm.antibug()
elseif s == 10 then
game.drop_item_with_ownership(96240,1)
cufar_farm.antibug()
elseif s == 11 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 12 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 13 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 14 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 15 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
end
end
end
end
end
- Nazox
-

- Mesaje: 106
- Membru din: 28 Iul 2015, 00:45
- Server: metin2.es
- Regat: Chunjo
- Aprecieri: 170
- Mulţumiri: 22
- Discord: Copiază ID
Perfect, it throws everything at random, but the bad thing about this method is that it does not appear in the render target, and it always drops at 100% but thanks.Kidro scrie: ↑18 Dec 2020, 00:03 That's an little exemple.
quest cufar_farm begin
state start begin
function antibug()
pc.setqf("anti_bug", get_time()+5)
end
when 20505.kill begin
if pc.getqf("anti_bug") <= get_time() then
npc.kill()
local s=number(1,15)
if s == 1 then
game.drop_item_with_ownership(49960,1)
cufar_farm.antibug()
elseif s == 2 then
game.drop_item_with_ownership(49920,1)
cufar_farm.antibug()
elseif s == 3 then
game.drop_item_with_ownership(49930,1)
cufar_farm.antibug()
elseif s == 4 then
game.drop_item_with_ownership(49940,1)
cufar_farm.antibug()
elseif s == 5 then
game.drop_item_with_ownership(49950,1)
cufar_farm.antibug()
elseif s == 6 then
game.drop_item_with_ownership(96230,1)
cufar_farm.antibug()
elseif s == 7 then
game.drop_item_with_ownership(96220,1)
cufar_farm.antibug()
elseif s == 8 then
game.drop_item_with_ownership(96200,1)
cufar_farm.antibug()
elseif s == 9 then
game.drop_item_with_ownership(96210,1)
cufar_farm.antibug()
elseif s == 10 then
game.drop_item_with_ownership(96240,1)
cufar_farm.antibug()
elseif s == 11 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 12 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 13 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 14 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
elseif s == 15 then
chat("Imi pare rau dar, nu ai primit nimic.")
cufar_farm.antibug()
end
end
end
end
end
You can make the rate of the drop like this:
And yeah, this will not apear in render drop.
But you can make the drop from source.
Look at the drop from random stone and adapt for what do you want.
quest cufar_farm begin
state start begin
function antibug()
pc.setqf("anti_bug", get_time()+5)
end
when 20505.kill begin
if pc.getqf("anti_bug") <= get_time() then
npc.kill()
local s=number(1,15)
if s == 1 then
local s1 = number(1,100)
if s1>70 then
game.drop_item_with_ownership(49960,1)
cufar_farm.antibug()
end
And now you have a 30% percent of the drop.And yeah, this will not apear in render drop.
But you can make the drop from source.
Look at the drop from random stone and adapt for what do you want.
- Pentru acest mesaj, amvenitsavadcv for the post:
- Nazox
- Nazox
-

- Mesaje: 106
- Membru din: 28 Iul 2015, 00:45
- Server: metin2.es
- Regat: Chunjo
- Aprecieri: 170
- Mulţumiri: 22
- Discord: Copiază ID
Can I do any drop using source ?, I had heard something like this but I would not know what file it is in, could you give me an idea to start looking ?, Thanks for all your help.amvenitsavadcv scrie: ↑22 Dec 2020, 14:51 You can make the rate of the drop like this:quest cufar_farm begin state start begin function antibug() pc.setqf("anti_bug", get_time()+5) end when 20505.kill begin if pc.getqf("anti_bug") <= get_time() then npc.kill() local s=number(1,15) if s == 1 then local s1 = number(1,100) if s1>70 then game.drop_item_with_ownership(49960,1) cufar_farm.antibug() endAnd now you have a 30% percent of the drop.
And yeah, this will not apear in render drop.
But you can make the drop from source.
Look at the drop from random stone and adapt for what do you want.
[ Postat de pe Android ]

In char.cpp
Function void CHARACTER::SetProto(const CMob * pkMob)
Here you can set the drop, you can call the function who set the drop.
And one example with the drops is this:
And the function is :
And you cand edit the drop rate from constants.cpp
Here:
Function void CHARACTER::SetProto(const CMob * pkMob)
Here you can set the drop, you can call the function who set the drop.
And one example with the drops is this:
if (IsStone())
{
DetermineDropMetinStone();
}
Here you set to drop only for stone.And the function is :
void CHARACTER::DetermineDropMetinStone()
{
const int METIN_STONE_NUM = 14;
static DWORD c_adwMetin[METIN_STONE_NUM] =
{
28030, // 60
28031,
28032,
28033,
28034,
28035,
28036,
28037,
28038,
28039,
28040,
28041,
28042,
28043,
};
DWORD stone_num = GetRaceNum();
int idx = std::lower_bound(aStoneDrop, aStoneDrop + STONE_INFO_MAX_NUM, stone_num) - aStoneDrop;
if (idx >= STONE_INFO_MAX_NUM || aStoneDrop[idx].dwMobVnum != stone_num)
{
m_dwDropMetinStone = 0;
}
else
{
const SStoneDropInfo& info = aStoneDrop[idx];
m_bDropMetinStonePct = info.iDropPct;
{
m_dwDropMetinStone = c_adwMetin[number(0, METIN_STONE_NUM - 1)];
int iGradePct = number(1, 100);
for (int iStoneLevel = 0; iStoneLevel < STONE_LEVEL_MAX_NUM; iStoneLevel++)
{
int iLevelGradePortion = info.iLevelPct[iStoneLevel];
if (iGradePct <= iLevelGradePortion)
{
break;
}
else
{
iGradePct -= iLevelGradePortion;
m_dwDropMetinStone += 100; // 돌 +a -> +(a+1)이 될때마다 100씩 증가
}
}
}
}
}
You need to put the function in char.hAnd you cand edit the drop rate from constants.cpp
Here:
const SStoneDropInfo aStoneDrop[STONE_INFO_MAX_NUM] =
- Pentru acest mesaj, amvenitsavadcv for the post:
- Nazox
- Nazox
-

- Mesaje: 106
- Membru din: 28 Iul 2015, 00:45
- Server: metin2.es
- Regat: Chunjo
- Aprecieri: 170
- Mulţumiri: 22
- Discord: Copiază ID
Thanks, but now i have this error if i edit mob_drop:amvenitsavadcv scrie: ↑23 Dec 2020, 15:26 In char.cpp
Function void CHARACTER::SetProto(const CMob * pkMob)
Here you can set the drop, you can call the function who set the drop.
And one example with the drops is this:if (IsStone()) { DetermineDropMetinStone(); }Here you set to drop only for stone.
And the function is :void CHARACTER::DetermineDropMetinStone() { const int METIN_STONE_NUM = 14; static DWORD c_adwMetin[METIN_STONE_NUM] = { 28030, // 60 28031, 28032, 28033, 28034, 28035, 28036, 28037, 28038, 28039, 28040, 28041, 28042, 28043, }; DWORD stone_num = GetRaceNum(); int idx = std::lower_bound(aStoneDrop, aStoneDrop + STONE_INFO_MAX_NUM, stone_num) - aStoneDrop; if (idx >= STONE_INFO_MAX_NUM || aStoneDrop[idx].dwMobVnum != stone_num) { m_dwDropMetinStone = 0; } else { const SStoneDropInfo& info = aStoneDrop[idx]; m_bDropMetinStonePct = info.iDropPct; { m_dwDropMetinStone = c_adwMetin[number(0, METIN_STONE_NUM - 1)]; int iGradePct = number(1, 100); for (int iStoneLevel = 0; iStoneLevel < STONE_LEVEL_MAX_NUM; iStoneLevel++) { int iLevelGradePortion = info.iLevelPct[iStoneLevel]; if (iGradePct <= iLevelGradePortion) { break; } else { iGradePct -= iLevelGradePortion; m_dwDropMetinStone += 100; // 돌 +a -> +(a+1)이 될때마다 100씩 증가 } } } } }You need to put the function in char.h
And you cand edit the drop rate from constants.cpp
Here:const SStoneDropInfo aStoneDrop[STONE_INFO_MAX_NUM] =
-
- Informaţie
-
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 26 vizitatori

