|
@@ -8714,10 +8714,8 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
|
|
|
status_change *sc = status_get_sc(src);
|
|
|
|
|
|
if (sc) {
|
|
|
- if (sc->getSCE(SC_HELLS_PLANT))
|
|
|
+ if (skill_id == GN_HELLS_PLANT_ATK && sc->getSCE(SC_HELLS_PLANT))
|
|
|
return 0;
|
|
|
- if (sc->getSCE(SC_REF_T_POTION))
|
|
|
- return 1; // Returns 1 damage
|
|
|
}
|
|
|
|
|
|
map_session_data *tsd = BL_CAST(BL_PC, tbl);
|
|
@@ -8726,7 +8724,6 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
|
|
|
if (flag & BF_SHORT) {//Bounces back part of the damage.
|
|
|
if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && tsd && tsd->bonus.short_weapon_damage_return ) {
|
|
|
rdamage += damage * tsd->bonus.short_weapon_damage_return / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
} else if( status_reflect && tsc && tsc->count ) {
|
|
|
if( tsc->getSCE(SC_REFLECTSHIELD) ) {
|
|
|
status_change_entry *sce_d;
|
|
@@ -8747,7 +8744,6 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
|
|
|
rdamage = 0;
|
|
|
else {
|
|
|
rdamage += damage * tsc->getSCE(SC_REFLECTSHIELD)->val2 / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -8766,26 +8762,6 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
|
|
|
} else {
|
|
|
if (!status_reflect && tsd && tsd->bonus.long_weapon_damage_return) {
|
|
|
rdamage += damage * tsd->bonus.long_weapon_damage_return / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (rdamage > 0) {
|
|
|
- map_session_data* sd = BL_CAST(BL_PC, src);
|
|
|
- if (sd && sd->bonus.reduce_damage_return != 0) {
|
|
|
- rdamage -= rdamage * sd->bonus.reduce_damage_return / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (sc) {
|
|
|
- if (status_reflect && sc->getSCE(SC_REFLECTDAMAGE)) {
|
|
|
- rdamage -= damage * sc->getSCE(SC_REFLECTDAMAGE)->val2 / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
- }
|
|
|
- if (sc->getSCE(SC_VENOMBLEED) && sc->getSCE(SC_VENOMBLEED)->val3 == 0) {
|
|
|
- rdamage -= damage * sc->getSCE(SC_VENOMBLEED)->val2 / 100;
|
|
|
- rdamage = i64max(rdamage, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -8804,7 +8780,29 @@ int64 battle_calc_return_damage(struct block_list* tbl, struct block_list *src,
|
|
|
|
|
|
if (skill_damage != 0) {
|
|
|
rdamage += rdamage * skill_damage / 100;
|
|
|
- rdamage = i64max(rdamage, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ int64 reduce = 0;
|
|
|
+ map_session_data* sd = BL_CAST(BL_PC, src);
|
|
|
+
|
|
|
+ if (sd && sd->bonus.reduce_damage_return != 0) {
|
|
|
+ reduce += (sd->bonus.reduce_damage_return);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sc) {
|
|
|
+ if (status_reflect && sc->getSCE(SC_REFLECTDAMAGE)) {
|
|
|
+ reduce += sc->getSCE(SC_REFLECTDAMAGE)->val2;
|
|
|
+ }
|
|
|
+ if (sc->getSCE(SC_VENOMBLEED) && sc->getSCE(SC_VENOMBLEED)->val3 == 0) {
|
|
|
+ reduce += sc->getSCE(SC_VENOMBLEED)->val2;
|
|
|
+ }
|
|
|
+ if (sc->getSCE(SC_REF_T_POTION))
|
|
|
+ reduce += 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (rdamage > 0) {
|
|
|
+ rdamage -= rdamage * i64min(100, reduce) / 100;
|
|
|
+ rdamage = i64max(rdamage, 1);
|
|
|
}
|
|
|
|
|
|
if (rdamage == 0)
|