Browse Source

Volcano and Min Damage (#8213)

- Volcano now increases BaseATK instead of WeaponATK for non-monsters
- Fixed a bug that caused Volcano to increase MATK in pre-re (fixes #8208)
- Fixed min damage not being set correctly
- Fixed a compiler warning
Playtester 1 year ago
parent
commit
b0902a4142
4 changed files with 11 additions and 7 deletions
  1. 1 0
      db/pre-re/status.yml
  2. 1 0
      db/re/status.yml
  3. 5 5
      src/map/battle.cpp
  4. 4 2
      src/map/status.cpp

+ 1 - 0
db/pre-re/status.yml

@@ -1100,6 +1100,7 @@ Body:
     Icon: EFST_GROUNDMAGIC
     DurationLookup: SA_VOLCANO
     CalcFlags:
+      Batk: true
       Watk: true
     Flags:
       NoSave: true

+ 1 - 0
db/re/status.yml

@@ -1117,6 +1117,7 @@ Body:
     Icon: EFST_GROUNDMAGIC
     DurationLookup: SA_VOLCANO
     CalcFlags:
+      Batk: true
       Watk: true
       Matk: true
     Flags:

+ 5 - 5
src/map/battle.cpp

@@ -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);
 	}
 }
 
@@ -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);

+ 4 - 2
src/map/status.cpp

@@ -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;
@@ -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;
@@ -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