Skip to content

Commit

Permalink
Volcano and Min Damage (rathena#8213)
Browse files Browse the repository at this point in the history
- Volcano now increases BaseATK instead of WeaponATK for non-monsters
- Fixed a bug that caused Volcano to increase MATK in pre-re (fixes rathena#8208)
- Fixed min damage not being set correctly
- Fixed a compiler warning
  • Loading branch information
Playtester authored Apr 1, 2024
1 parent 4247bc5 commit b0902a4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions db/pre-re/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ Body:
Icon: EFST_GROUNDMAGIC
DurationLookup: SA_VOLCANO
CalcFlags:
Batk: true
Watk: true
Flags:
NoSave: true
Expand Down
1 change: 1 addition & 0 deletions db/re/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ Body:
Icon: EFST_GROUNDMAGIC
DurationLookup: SA_VOLCANO
CalcFlags:
Batk: true
Watk: true
Matk: true
Flags:
Expand Down
10 changes: 5 additions & 5 deletions src/map/battle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6563,12 +6563,12 @@ static void battle_calc_defense_reduction(struct Damage* wd, struct block_list *
*/
static void battle_min_damage(struct Damage* wd, struct block_list* src, uint16 skill_id, int64 min) {
if (is_attack_right_handed(src, skill_id)) {
cap_value(wd->damage, min, INT64_MAX);
cap_value(wd->basedamage, min, INT64_MAX);
wd->damage = cap_value(wd->damage, min, INT64_MAX);
wd->basedamage = cap_value(wd->basedamage, min, INT64_MAX);
}
if (is_attack_left_handed(src, skill_id)) {
cap_value(wd->damage2, min, INT64_MAX);
cap_value(wd->basedamage2, min, INT64_MAX);
wd->damage2 = cap_value(wd->damage2, min, INT64_MAX);
wd->basedamage2 = cap_value(wd->basedamage2, min, INT64_MAX);
}
}

Expand Down Expand Up @@ -7548,7 +7548,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
if (index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR) {
//First calculate the random part of the bonus
int bonus = (7 * sd->inventory_data[index]->weight) / 100;
bonus += pow(skill_lv + sd->inventory.u.items_inventory[index].refine, 2);
bonus += static_cast<decltype(bonus)>(pow(skill_lv + sd->inventory.u.items_inventory[index].refine, 2));
//Now get a random value between 100 and the random part
bonus = max(100, rnd_value(100, bonus));
ATK_ADD(wd.damage, wd.damage2, bonus);
Expand Down
6 changes: 4 additions & 2 deletions src/map/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7011,6 +7011,8 @@ static unsigned short status_calc_batk(struct block_list *bl, status_change *sc,
batk += sc->getSCE(SC_ATKPOTION)->val1;
if(sc->getSCE(SC_BATKFOOD))
batk += sc->getSCE(SC_BATKFOOD)->val1;
if (sc->getSCE(SC_VOLCANO))
batk += sc->getSCE(SC_VOLCANO)->val2;
#ifndef RENEWAL
if(sc->getSCE(SC_GATLINGFEVER))
batk += sc->getSCE(SC_GATLINGFEVER)->val3;
Expand Down Expand Up @@ -7083,7 +7085,7 @@ static unsigned short status_calc_watk(struct block_list *bl, status_change *sc,
watk += sc->getSCE(SC_IMPOSITIO)->val2;
if(sc->getSCE(SC_WATKFOOD))
watk += sc->getSCE(SC_WATKFOOD)->val1;
if(sc->getSCE(SC_VOLCANO))
if (sc->getSCE(SC_VOLCANO) && bl->type == BL_MOB)
watk += sc->getSCE(SC_VOLCANO)->val2;
if(sc->getSCE(SC_MERC_ATKUP))
watk += sc->getSCE(SC_MERC_ATKUP)->val2;
Expand Down Expand Up @@ -7303,9 +7305,9 @@ static unsigned short status_calc_matk(struct block_list *bl, status_change *sc,
matk += matk * sc->getSCE(SC_MTF_MATK)->val1 / 100;
if (sc->getSCE(SC_SHRIMP))
matk += matk * sc->getSCE(SC_SHRIMP)->val2 / 100;
#ifdef RENEWAL
if (sc->getSCE(SC_VOLCANO))
matk += sc->getSCE(SC_VOLCANO)->val2;
#ifdef RENEWAL
if (sc->getSCE(SC_NIBELUNGEN) && sc->getSCE(SC_NIBELUNGEN)->val2 == RINGNBL_MATKRATE)
matk += matk * 20 / 100;
#endif
Expand Down

0 comments on commit b0902a4

Please sign in to comment.