|
@@ -2523,18 +2523,36 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|
|
if (battle_config.drops_by_luk2)
|
|
|
drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.);
|
|
|
}
|
|
|
- if (sd && battle_config.pk_mode &&
|
|
|
- (int)(md->level - sd->status.base_level) >= 20)
|
|
|
- drop_rate = (int)(drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris]
|
|
|
-
|
|
|
- // Increase drop rate if user has SC_ITEMBOOST
|
|
|
- if (sd && sd->sc.data[SC_ITEMBOOST]) // now rig the drop rate to never be over 90% unless it is originally >90%.
|
|
|
- drop_rate = max(drop_rate,cap_value((int)(0.5+drop_rate*(sd->sc.data[SC_ITEMBOOST]->val1)/100.),0,9000));
|
|
|
- // Increase item drop rate for VIP.
|
|
|
- if (battle_config.vip_drop_increase && (sd && pc_isvip(sd))) {
|
|
|
- drop_rate += (int)(0.5 + (drop_rate * battle_config.vip_drop_increase) / 100);
|
|
|
- drop_rate = min(drop_rate,10000); //cap it to 100%
|
|
|
+
|
|
|
+ // Player specific drop rate adjustments
|
|
|
+ if( sd ){
|
|
|
+ int drop_rate_bonus = 0;
|
|
|
+
|
|
|
+ // pk_mode increase drops if 20 level difference [Valaris]
|
|
|
+ if( battle_config.pk_mode && (int)(md->level - sd->status.base_level) >= 20 )
|
|
|
+ drop_rate = (int)(drop_rate*1.25);
|
|
|
+
|
|
|
+ // Add class and race specific bonuses
|
|
|
+ drop_rate_bonus += sd->dropaddclass[md->status.class_] + sd->dropaddclass[CLASS_ALL];
|
|
|
+ drop_rate_bonus += sd->dropaddrace[md->status.race] + sd->dropaddrace[RC_ALL];
|
|
|
+
|
|
|
+ // Increase drop rate if user has SC_ITEMBOOST
|
|
|
+ if (&sd->sc && sd->sc.data[SC_ITEMBOOST])
|
|
|
+ drop_rate_bonus += sd->sc.data[SC_ITEMBOOST]->val1;
|
|
|
+
|
|
|
+ drop_rate_bonus = (int)(0.5 + drop_rate * drop_rate_bonus / 100.);
|
|
|
+ // Now rig the drop rate to never be over 90% unless it is originally >90%.
|
|
|
+ drop_rate = i32max(drop_rate, cap_value(drop_rate_bonus, 0, 9000));
|
|
|
+
|
|
|
+#ifdef VIP_ENABLE
|
|
|
+ // Increase item drop rate for VIP.
|
|
|
+ if (battle_config.vip_drop_increase && pc_isvip(sd)) {
|
|
|
+ drop_rate += (int)(0.5 + (drop_rate * battle_config.vip_drop_increase) / 100);
|
|
|
+ drop_rate = min(drop_rate,10000); //cap it to 100%
|
|
|
+ }
|
|
|
+#endif
|
|
|
}
|
|
|
+
|
|
|
#ifdef RENEWAL_DROP
|
|
|
if( drop_modifier != 100 ) {
|
|
|
drop_rate = apply_rate(drop_rate, drop_modifier);
|