Jump to content

[COMMOND DROP GUIDE] HOW TO ?


Recommended Posts

Finally today i started playing around 

Common Drop Item .txt

i understood lot of things

but there are few i missed:


________

1)  5th column value? what is his porpouse?


30    120    0.004    50600    100000

level min 30
level max 120
percentage drop 0.004%
50600 vnum of item
100000 ??????????????????????? WHAT IS IT?

i tried to put 1  0  100 1000
i could not understand the difference.


__________


2) common drop item .txt is not affected by increasing decreasing of item DROP RATE
    right now i have 200%
    i made a test with an item 
   33% chance to drop it

   with 100 monsters i got around 30 items   = which is the 33% almost.

  BUT WITH MY 200% item drop rate i should get LOOOOOT more

  33%  *200%drop rate = almost 99%  am i right?



___________

please can someone help me to figure out the problems?

Link to comment
Share on other sites

  • 11 months later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Aparently 100000 is the count of item.

case 1: str_to_number(d[i].iLvStart, szTemp);    break;
case 2: str_to_number(d[i].iLvEnd, szTemp);    break;
case 3: d[i].fPercent = atof(szTemp);    break;
case 4: strlcpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName));    break;
case 5: str_to_number(d[i].iCount, szTemp);    break;

 

This is from server funcion ITEM_MANAGER::ReadCommonDropItemFile.

bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
{
    FILE * fp = fopen(c_pszFileName, "r");

    if (!fp)
    {
        sys_err("Cannot open %s", c_pszFileName);
        return false;
    }

    char buf[1024];

    int lines = 0;

    while (fgets(buf, 1024, fp))
    {
        ++lines;

        if (!*buf || *buf == '\n')
            continue;

        TDropItem d[MOB_RANK_MAX_NUM];
        char szTemp[64];

        memset(&d, 0, sizeof(d));

        char * p = buf;
        char * p2;

        for (int i = 0; i <= MOB_RANK_S_KNIGHT; ++i)
        {
            for (int j = 0; j < 6; ++j)
            {
                p2 = strchr(p, '\t');

                if (!p2)
                    break;

                strlcpy(szTemp, p, MIN(sizeof(szTemp), (p2 - p) + 1));
                p = p2 + 1;

                switch (j)
                {
                case 0: break;
                case 1: str_to_number(d[i].iLvStart, szTemp);    break;
                case 2: str_to_number(d[i].iLvEnd, szTemp);    break;
                case 3: d[i].fPercent = atof(szTemp);    break;
                case 4: strlcpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName));    break;
                case 5: str_to_number(d[i].iCount, szTemp);    break;
                }
            }

            DWORD dwPct = (DWORD) (d[i].fPercent * 10000.0f);
            DWORD dwItemVnum = 0;

            if (!ITEM_MANAGER::instance().GetVnumByOriginalName(d[i].szItemName, dwItemVnum))
            {
                // 이름으로 못찾으면 번호로 검색
                str_to_number(dwItemVnum, d[i].szItemName);
                if (!ITEM_MANAGER::instance().GetTable(dwItemVnum))
                {
                    sys_err("No such an item (name: %s)", d[i].szItemName);
                    fclose(fp);
                    return false;
                }
            }

            if (d[i].iLvStart == 0)
                continue;

            g_vec_pkCommonDropItem[i].push_back(CItemDropInfo(d[i].iLvStart, d[i].iLvEnd, dwPct, dwItemVnum));
        }
    }

    fclose(fp);

    for (int i = 0; i < MOB_RANK_MAX_NUM; ++i)
    {
        std::vector<CItemDropInfo> & v = g_vec_pkCommonDropItem[i];
        std::sort(v.begin(), v.end());

        std::vector<CItemDropInfo>::iterator it = v.begin();

        sys_log(1, "CommonItemDrop rank %d", i);

        while (it != v.end())
        {
            const CItemDropInfo & c = *(it++);
            sys_log(1, "CommonItemDrop %d %d %d %u", c.m_iLevelStart, c.m_iLevelEnd, c.m_iPercent, c.m_dwVnum);
        }
    }

    return true;
}

 

Note that d.iCount is not used anywhere in the funcion or any game file (searched with Find in Files function), so ymir maybe changed his mind about that part of common_drop_item.

 

About the drop chance, i found this on the same funcion:

DWORD dwPct = (DWORD) (d[i].fPercent * 10000.0f);

*Sorry for my english.

Link to comment
Share on other sites

  • Former Staff
On 2/14/2016 at 9:08 PM, Mr.Oz J. said:

 33%  *200%drop rate = almost 99%  am i right?

hmmmm i'm thinking of this as (33% of drop rate ) so if the drop rate = (200%)  the 33% is still 33%  ...

33% of (100) = 33

33% of (200) = 66 (not 66% which is 132)

33% of (300) = 99 item (not 99% which is 297)

i've didn't read it yet ...

Link to comment
Share on other sites

  • 4 weeks later...

Hello,
1    15    0.16    uu+1    2500 what is it ?
Drop start ()LVL) drop end ()(LVL) % item name or vnum u are stay in lvl start and end percent is for drop
example
pc.get_level =<1 and pc.get_level >=15 4% to get uu+1

u level higher than 15 percent is 0.16

On 2016. 02. 14. at 8:08 PM, Mr.Oz J. said:

Finally today i started playing around 

Common Drop Item .txt

i understood lot of things

but there are few i missed:


________

1)  5th column value? what is his porpouse?


30    120    0.004    50600    100000

level min 30
level max 120
percentage drop 0.004%
50600 vnum of item
100000 ??????????????????????? WHAT IS IT?

i tried to put 1  0  100 1000
i could not understand the difference.


__________


2) common drop item .txt is not affected by increasing decreasing of item DROP RATE
    right now i have 200%
    i made a test with an item 
   33% chance to drop it

   with 100 monsters i got around 30 items   = which is the 33% almost.

  BUT WITH MY 200% item drop rate i should get LOOOOOT more

  33%  *200%drop rate = almost 99%  am i right?



___________

please can someone help me to figure out the problems?

On 2017. 02. 06. at 11:28 AM, Vassy said:

Aparently 100000 is the count of item.


case 1: str_to_number(d[i].iLvStart, szTemp);    break;
case 2: str_to_number(d[i].iLvEnd, szTemp);    break;
case 3: d[i].fPercent = atof(szTemp);    break;
case 4: strlcpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName));    break;
case 5: str_to_number(d[i].iCount, szTemp);    break;

 

This is from server funcion ITEM_MANAGER::ReadCommonDropItemFile.


bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
{
    FILE * fp = fopen(c_pszFileName, "r");

    if (!fp)
    {
        sys_err("Cannot open %s", c_pszFileName);
        return false;
    }

    char buf[1024];

    int lines = 0;

    while (fgets(buf, 1024, fp))
    {
        ++lines;

        if (!*buf || *buf == '\n')
            continue;

        TDropItem d[MOB_RANK_MAX_NUM];
        char szTemp[64];

        memset(&d, 0, sizeof(d));

        char * p = buf;
        char * p2;

        for (int i = 0; i <= MOB_RANK_S_KNIGHT; ++i)
        {
            for (int j = 0; j < 6; ++j)
            {
                p2 = strchr(p, '\t');

                if (!p2)
                    break;

                strlcpy(szTemp, p, MIN(sizeof(szTemp), (p2 - p) + 1));
                p = p2 + 1;

                switch (j)
                {
                case 0: break;
                case 1: str_to_number(d[i].iLvStart, szTemp);    break;
                case 2: str_to_number(d[i].iLvEnd, szTemp);    break;
                case 3: d[i].fPercent = atof(szTemp);    break;
                case 4: strlcpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName));    break;
                case 5: str_to_number(d[i].iCount, szTemp);    break;
                }
            }

            DWORD dwPct = (DWORD) (d[i].fPercent * 10000.0f);
            DWORD dwItemVnum = 0;

            if (!ITEM_MANAGER::instance().GetVnumByOriginalName(d[i].szItemName, dwItemVnum))
            {
                // 이름으로 못찾으면 번호로 검색
                str_to_number(dwItemVnum, d[i].szItemName);
                if (!ITEM_MANAGER::instance().GetTable(dwItemVnum))
                {
                    sys_err("No such an item (name: %s)", d[i].szItemName);
                    fclose(fp);
                    return false;
                }
            }

            if (d[i].iLvStart == 0)
                continue;

            g_vec_pkCommonDropItem[i].push_back(CItemDropInfo(d[i].iLvStart, d[i].iLvEnd, dwPct, dwItemVnum));
        }
    }

    fclose(fp);

    for (int i = 0; i < MOB_RANK_MAX_NUM; ++i)
    {
        std::vector<CItemDropInfo> & v = g_vec_pkCommonDropItem[i];
        std::sort(v.begin(), v.end());

        std::vector<CItemDropInfo>::iterator it = v.begin();

        sys_log(1, "CommonItemDrop rank %d", i);

        while (it != v.end())
        {
            const CItemDropInfo & c = *(it++);
            sys_log(1, "CommonItemDrop %d %d %d %u", c.m_iLevelStart, c.m_iLevelEnd, c.m_iPercent, c.m_dwVnum);
        }
    }

    return true;
}

 

Note that d.iCount is not used anywhere in the funcion or any game file (searched with Find in Files function), so ymir maybe changed his mind about that part of common_drop_item.

 

About the drop chance, i found this on the same funcion:


DWORD dwPct = (DWORD) (d[i].fPercent * 10000.0f);

*Sorry for my english.

Correct :) "DWORD dwPct = (DWORD) (d.fPercent * 10000.0f);"

On 2017. 02. 06. at 8:36 PM, flygun said:

hmmmm i'm thinking of this as (33% of drop rate ) so if the drop rate = (200%)  the 33% is still 33%  ...

33% of (100) = 33

33% of (200) = 66 (not 66% which is 132)

33% of (300) = 99 item (not 99% which is 297)

i've didn't read it yet ...

 

On 2017. 02. 06. at 9:20 PM, MORTE said:

Taking advantage of this, is there any way to organize this file as the mob_drop_item ??

 

 

 

787292068_Nvtelen.png.6faa7b0bbb3398fd29

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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