Let the necessary changes
in the 'mob.cpp' file:
change it:
int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md)
to:
int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md, int nameid)
still in the same file, in the same function, change this:
if (sd->sc.getSCE(SC_ITEMBOOST))
drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1;
to:
if (sd->sc.getSCE(SC_ITEMBOOST)) {
int mob_id = mob->id;
int item_id = nameid;
int excluded_item_ids[] = {1202}; // Knife_ = 1202
int excluded_mob_ids[] = {1002}; // Poring = 1002
bool is_excluded_item = false;
bool is_excluded_mob = false;
for(int i = 0; i < sizeof(excluded_item_ids)/sizeof(excluded_item_ids[0]); i++) {
if(item_id == excluded_item_ids[i]) {
is_excluded_item = true;
break;
}
}
for(int i = 0; i < sizeof(excluded_mob_ids)/sizeof(excluded_mob_ids[0]); i++) {
if(mob_id == excluded_mob_ids[i]) {
is_excluded_mob = true;
break;
}
}
// Only apply the SC_ITEMBOOST if the item and mob aren't in the excluded lists
if(!is_excluded_item && !is_excluded_mob) {
drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1;
}
}
inside the loop "for (i = 0; i < MAX_MOB_DROP_TOTAL; i++) {"
Change it:
drop_rate = mob_getdroprate(src, md->db, md->db->dropitem[i].rate, drop_modifier, md);
to:
drop_rate = mob_getdroprate(src, md->db, md->db->dropitem[i].rate, drop_modifier, md, md->db->dropitem[i].nameid);
in archive 'mob.hpp' change it:
int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md = nullptr);
to:
int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md, int nameid);
and finally in the 'atcommand.cpp' file, change it:
int droprate = mob_getdroprate( &sd->bl, mob, mob->dropitem[i].rate, drop_modifier );
to:
int droprate = mob_getdroprate( &sd->bl, mob, mob->dropitem[i].rate, drop_modifier, nullptr, mob->dropitem[i].nameid );
I had to use a breakpoint in visual studio to find out that the md->mob_id was null and that's why the @mi command was closing the map-server.
soon I realized that inside the function there is already mob data just by accessing the 'mob->id'.
the item_id conflict I solved by adding a new parameter, consequently it is mandatory to change the parameters for the other calls, maybe there is a better way to access the item_id but this way works great for me.