@@ -2523,33 +2523,36 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
2523
2523
if (battle_config .drops_by_luk2 )
2524
2524
drop_rate += (int )(0.5 + drop_rate * status_get_luk (src )* battle_config .drops_by_luk2 /10000. );
2525
2525
}
2526
- if (sd && battle_config .pk_mode &&
2527
- (int )(md -> level - sd -> status .base_level ) >= 20 )
2528
- drop_rate = (int )(drop_rate * 1.25 ); // pk_mode increase drops if 20 level difference [Valaris]
2529
2526
2530
- if (sd ) {
2531
- int drop_rate_ = 0 ;
2527
+ // Player specific drop rate adjustments
2528
+ if ( sd ){
2529
+ int drop_rate_bonus = 0 ;
2532
2530
2533
- if (src ) {
2534
- drop_rate_ += sd -> dropaddclass [md -> status .class_ ] + sd -> dropaddclass [CLASS_ALL ];
2535
- drop_rate_ += sd -> dropaddrace [md -> status .race ] + sd -> dropaddrace [RC_ALL ];
2536
- }
2531
+ // pk_mode increase drops if 20 level difference [Valaris]
2532
+ if ( battle_config .pk_mode && (int )(md -> level - sd -> status .base_level ) >= 20 )
2533
+ drop_rate = (int )(drop_rate * 1.25 );
2534
+
2535
+ // Add class and race specific bonuses
2536
+ drop_rate_bonus += sd -> dropaddclass [md -> status .class_ ] + sd -> dropaddclass [CLASS_ALL ];
2537
+ drop_rate_bonus += sd -> dropaddrace [md -> status .race ] + sd -> dropaddrace [RC_ALL ];
2537
2538
2538
2539
// Increase drop rate if user has SC_ITEMBOOST
2539
2540
if (& sd -> sc && sd -> sc .data [SC_ITEMBOOST ])
2540
- drop_rate_ += sd -> sc .data [SC_ITEMBOOST ]-> val1 ;
2541
+ drop_rate_bonus += sd -> sc .data [SC_ITEMBOOST ]-> val1 ;
2541
2542
2542
- drop_rate_ = (int )(0.5 + drop_rate * drop_rate_ / 100. );
2543
+ drop_rate_bonus = (int )(0.5 + drop_rate * drop_rate_bonus / 100. );
2543
2544
// Now rig the drop rate to never be over 90% unless it is originally >90%.
2544
- drop_rate = i32max (drop_rate , cap_value (drop_rate_ , 0 , 9000 ));
2545
- }
2545
+ drop_rate = i32max (drop_rate , cap_value (drop_rate_bonus , 0 , 9000 ));
2546
+
2546
2547
#ifdef VIP_ENABLE
2547
- // Increase item drop rate for VIP.
2548
- if (battle_config .vip_drop_increase && ( sd && pc_isvip (sd ) )) {
2549
- drop_rate += (int )(0.5 + (drop_rate * battle_config .vip_drop_increase ) / 100 );
2550
- drop_rate = min (drop_rate ,10000 ); //cap it to 100%
2551
- }
2548
+ // Increase item drop rate for VIP.
2549
+ if (battle_config .vip_drop_increase && pc_isvip (sd )) {
2550
+ drop_rate += (int )(0.5 + (drop_rate * battle_config .vip_drop_increase ) / 100 );
2551
+ drop_rate = min (drop_rate ,10000 ); //cap it to 100%
2552
+ }
2552
2553
#endif
2554
+ }
2555
+
2553
2556
#ifdef RENEWAL_DROP
2554
2557
if ( drop_modifier != 100 ) {
2555
2558
drop_rate = apply_rate (drop_rate , drop_modifier );
0 commit comments