diff --git a/conf/battle/drops.conf b/conf/battle/drops.conf index 96083d7534..62ac649d4a 100644 --- a/conf/battle/drops.conf +++ b/conf/battle/drops.conf @@ -68,9 +68,11 @@ item_drop_card_min: 1 item_drop_card_max: 10000 // The rate adjustment for the MVP items that the MVP gets directly in their inventory +// Mode: 0 - official order, 1 - random order, 2 - all items item_rate_mvp: 100 item_drop_mvp_min: 1 item_drop_mvp_max: 10000 +item_drop_mvp_mode: 0 // The rate adjustment for card-granted item drops. item_rate_adddrop: 100 diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2f3882be4f..259f6d8887 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7047,25 +7047,32 @@ ACMD_FUNC(mobinfo) clif_displaymessage(fd, atcmd_output); // mvp if (mob->mexp) { + float mvppercent, mvpremain; sprintf(atcmd_output, msg_txt(sd,1247), mob->mexp); // MVP Bonus EXP:%u clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output, msg_txt(sd,1248)); // MVP Items: + mvpremain = 100.0; //Remaining drop chance for official mvp drop mode j = 0; for (i = 0; i < MAX_MVP_DROP; i++) { if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_exists(mob->mvpitem[i].nameid)) == NULL) continue; - if (mob->mvpitem[i].p > 0) { + //Because if there are 3 MVP drops at 50%, the first has a chance of 50%, the second 25% and the third 12.5% + mvppercent = (float)mob->mvpitem[i].p * mvpremain / 10000.0; + if(battle_config.item_drop_mvp_mode == 0) { + mvpremain -= mvppercent; + } + if (mvppercent > 0) { j++; if (j == 1) { if (item_data->slot) - sprintf(atcmd_output2, " %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent); else - sprintf(atcmd_output2, " %s %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " %s %02.02f%%", item_data->jname, mvppercent); } else { if (item_data->slot) - sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent); else - sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, mvppercent); } strcat(atcmd_output, atcmd_output2); } diff --git a/src/map/battle.c b/src/map/battle.c index 6887ec97ae..aff81f4258 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7667,6 +7667,7 @@ static const struct _battle_data { { "item_drop_card_max", &battle_config.item_drop_card_max, 10000, 1, 10000, }, { "item_drop_mvp_min", &battle_config.item_drop_mvp_min, 1, 1, 10000, }, { "item_drop_mvp_max", &battle_config.item_drop_mvp_max, 10000, 1, 10000, }, + { "item_drop_mvp_mode", &battle_config.item_drop_mvp_mode, 0, 0, 2, }, { "item_drop_heal_min", &battle_config.item_drop_heal_min, 1, 1, 10000, }, { "item_drop_heal_max", &battle_config.item_drop_heal_max, 10000, 1, 10000, }, { "item_drop_use_min", &battle_config.item_drop_use_min, 1, 1, 10000, }, diff --git a/src/map/battle.h b/src/map/battle.h index f1f357cf64..fe9d987f12 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -314,6 +314,7 @@ extern struct Battle_Config int item_drop_card_min,item_drop_card_max; int item_drop_equip_min,item_drop_equip_max; int item_drop_mvp_min,item_drop_mvp_max; // End Addition + int item_drop_mvp_mode; //rAthena addition [Playtester] int item_drop_heal_min,item_drop_heal_max; // Added by Valatris int item_drop_use_min,item_drop_use_max; //End int item_drop_treasure_min,item_drop_treasure_max; //by [Skotlex] diff --git a/src/map/mob.c b/src/map/mob.c index a8fe294cd7..a00af523be 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2531,27 +2531,39 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) log_mvp[1] = mexp; if( !(map[m].flag.nomvploot || type&1) ) { - /* pose them randomly in the list -- so on 100% drop servers it wont always drop the same item */ + //Order might be random depending on item_drop_mvp_mode config setting int mdrop_id[MAX_MVP_DROP]; int mdrop_p[MAX_MVP_DROP]; memset(mdrop_id,0,MAX_MVP_DROP*sizeof(int)); memset(mdrop_p,0,MAX_MVP_DROP*sizeof(int)); - //Make random order - for(i = 0; i < MAX_MVP_DROP; i++) { - while( 1 ) { - uint8 va = rnd()%MAX_MVP_DROP; - if (mdrop_id[va] == 0) { - if (md->db->mvpitem[i].nameid > 0) { - mdrop_id[va] = md->db->mvpitem[i].nameid; - mdrop_p[va] = md->db->mvpitem[i].p; + if(battle_config.item_drop_mvp_mode == 1) { + //Random order + for(i = 0; i < MAX_MVP_DROP; i++) { + while( 1 ) { + uint8 va = rnd()%MAX_MVP_DROP; + if (mdrop_id[va] == 0) { + if (md->db->mvpitem[i].nameid > 0) { + mdrop_id[va] = md->db->mvpitem[i].nameid; + mdrop_p[va] = md->db->mvpitem[i].p; + } + else + mdrop_id[va] = -1; + break; } - else - mdrop_id[va] = -1; - break; } } + } else { + //Normal order + for(i = 0; i < MAX_MVP_DROP; i++) { + if (md->db->mvpitem[i].nameid > 0) { + mdrop_id[i] = md->db->mvpitem[i].nameid; + mdrop_p[i] = md->db->mvpitem[i].p; + } + else + mdrop_id[i] = -1; + } } for(i = 0; i < MAX_MVP_DROP; i++) { @@ -2589,7 +2601,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) //Logs items, MVP prizes [Lupus] log_pick_mob(md, LOG_TYPE_MVP, -1, &item); - break; + //If item_drop_mvp_mode is not 2, then only one item should be granted + if(battle_config.item_drop_mvp_mode != 2) { + break; + } } }