Jump to content
Maintenance : Final step ×

Double mining drop bonus


Recommended Posts

  • 5 months later...
  • Premium
Posted (edited)

The fastest and simply way:
 

in minin.cpp, find:

void OreDrop(LPCHARACTER ch, DWORD dwLoadVnum)

under:

if (iFractionCount == 0)
{
    sys_err("Wrong ore fraction count");
    return;
}

add something like:

LPITEM pick_costume = ch->GetWear(WEAR_COSTUME_WEAPON);
if (pick_costume && pick_costume->GetVnum() == YOUR_ITEM_VNUM)
{
    if (number(1, 100) <= 10)
    {
    	dwRawOreVnum = YOUR_ITEM_VNUM_TO_DROP;
    }
}

 

and thats all

Edited by jking
  • Good 1
Link to comment
Share on other sites

  • Active Member
Posted (edited)
58 minutes ago, jking said:

The fastest and simply way:
 

in minin.cpp, find:

void OreDrop(LPCHARACTER ch, DWORD dwLoadVnum)

under:

if (iFractionCount == 0)
{
    sys_err("Wrong ore fraction count");
    return;
}

add something like:

LPITEM pick_costume = ch->GetWear(WEAR_COSTUME_WEAPON);
if (pick_costume && pick_costume->GetVnum() == YOUR_ITEM_VNUM)
{
    if (number(1, 100) <= 10)
    {
    	dwRawOreVnum = YOUR_ITEM_VNUM_TO_DROP;
    }
}

 

and thats all

This doesn't seems right.. wouldn't it make much more sense inside EVENTFUNC(mining_event):

int iPct = GetOrePct(ch);

if (number(1, 100) <= iPct)
{
    OreDrop(ch, load->GetRaceNum());
    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("䱤¿¡ ¼º°øÇÏ¿´½À´Ï´Ù."));
}

and change it to this:

int iPct = GetOrePct(ch);

LPITEM pick_costume = ch->GetWear(WEAR_COSTUME_WEAPON);
if (pick_costume && pick_costume->GetVnum() == YOUR_ITEM_VNUM)
	iPct += 10;

if (number(1, 100) <= iPct)
{
	OreDrop(ch, load->GetRaceNum());
	ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("䱤¿¡ ¼º°øÇÏ¿´½À´Ï´Ù."));
}

 

 

EDIT: Nvm, he wants double drop, i thought he wanted to increase the chance of dropping by 10%, i'm sorry

 

EDIT2: It still doesn't seems right, shouldn't this:

if (number(1, 100) <= 10)
    {
    	dwRawOreVnum = YOUR_ITEM_VNUM_TO_DROP;
    }

be:

if (number(1, 100) <= 10)
    {
    	iFractionCount *= 2;
    }

 

Edited by [GF]Froslass
Link to comment
Share on other sites

  • Active Member
42 minutes ago, HueHue said:

Thank you so much for all the replies but I would like to do that in a way that if im using the costume i have 10% change of doubling the drop. so not always doubling. only 10% chance for a double drop.

Yes this is how our code works. Just use the code @ jking provided, and apply my fix:

 

On 1/8/2025 at 9:30 PM, [GF]Froslass said:

EDIT2: It still doesn't seems right, shouldn't this:

if (number(1, 100) <= 10)
    {
    	dwRawOreVnum = YOUR_ITEM_VNUM_TO_DROP;
    }

be:

if (number(1, 100) <= 10)
    {
    	iFractionCount *= 2;
    }

 

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