Jump to content
  • 0

help custom drop rate


Question

Posted

in mob_db.txt i put 0 to there card drop rate...

but when i @mi ingame card drop in the monster id is 0.01%

i want it to make 1.00% for the specific mob what will i edit

- script CustomDropRates -1,{
OnInit:
setarray $@MobOkay_ID[0],1651,1649,1650,1647,1646,1648; //Replace XXXX with the ID's of the monsters you want to be affected by this script. Add more as necessariy. *Note only supports 128 different monsters*
set $@MaxDropChance,10;end;

OnNPCKillEvent:
for(set @i,0; @i<getarraysize($@MobOkay_ID); set @i,@i+1)
{if (killedrid==$@MobOkay_ID[@i])
{callfunc "DropItemRate";}}
end;
}

function script DropItemRate {
set @i,0;
set @dropID,0;
deletearray $@MobDrop_item[0],128;
getmobdrops(killedrid);
goto iDropItemLoop;

iDropItemLoop:
set @i,rand(1,$@MaxDropChance);
if (@dropID == $@MobDrop_count){dispbottom "Success"; end;}
if (@i==1 && $@MobDrop_rate[@dropID]<=1)
{getitem $@MobDrop_item[@dropID],1;
set @dropID,@dropID+1; goto iDropItemLoop;}
if (@i<=$@MaxDropChance){set @dropID,@dropID+1; goto iDropItemLoop;}
end;
}

  • Upvote 1

4 answers to this question

Recommended Posts

Posted (edited)

in mob_db.txt i put 0 to there card drop rate...

but when i @mi ingame card drop in the monster id is 0.01%

Your minimal drop rate is define in conf/battle/drops.conf

item_drop_card_min: 1

In mob_db.txt, if you let DropCardid and put DropCardper = 0 then the card drop rate is 0.01% 'coz your configuration define the card drop rate to 0.01% minimum.

Also your script doesn't change the drop rate, it's additional. You would have real drop rate (0.01%) and drop rate define by your script (1%).

i want it to make 1.00% for the specific mob what will i edit

In your script, you must edit

set $@MaxDropChance,10;

If set $@MaxDropChance,10;, you would have (1/10) % chance to drop item.

set $@MaxDropChance,100; --> (1/100) %

Edited by Capuche
  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...