Explorar o código

Skills that increase elemental damage (fixes #1780)
* Negative values in the attr_fix table will now longer be ignored
* Renewal: Skills that increase elemental damage stack linearly with the attr_fix value
(e.g. if the attr_fix value is -25% and a skill increases elemental damage by 50%, it becomes 25%)
* Pre-Renewal: Skills that increase elemental damage increase damage percentually
(e.g. if damage is 25 and a skill increases elemental damage by 20%, it becomes 30)

Playtester %!s(int64=8) %!d(string=hai) anos
pai
achega
08406785c6
Modificáronse 2 ficheiros con 19 adicións e 2 borrados
  1. 19 0
      src/map/battle.c
  2. 0 2
      src/map/status.c

+ 19 - 0
src/map/battle.c

@@ -432,15 +432,27 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
 		switch(atk_elem){
 			case ELE_FIRE:
 				if (sc->data[SC_VOLCANO])
+#ifdef RENEWAL
 					ratio += sc->data[SC_VOLCANO]->val3;
+#else
+					damage += (int64)((damage*sc->data[SC_VOLCANO]->val3) / 100);
+#endif
 				break;
 			case ELE_WIND:
 				if (sc->data[SC_VIOLENTGALE])
+#ifdef RENEWAL
 					ratio += sc->data[SC_VIOLENTGALE]->val3;
+#else
+					damage += (int64)((damage*sc->data[SC_VIOLENTGALE]->val3) / 100);
+#endif
 				break;
 			case ELE_WATER:
 				if (sc->data[SC_DELUGE])
+#ifdef RENEWAL
 					ratio += sc->data[SC_DELUGE]->val3;
+#else
+					damage += (int64)((damage*sc->data[SC_DELUGE]->val3) / 100);
+#endif
 				break;
 			case ELE_GHOST:
 				if (sc->data[SC_TELEKINESIS_INTENSE])
@@ -476,7 +488,11 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
 				if (tsc->data[SC_SPIDERWEB]) {
 					tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now
 					if (tsc->data[SC_SPIDERWEB]->val2-- > 0)
+#ifdef RENEWAL
 						ratio += 100; // double damage
+#else
+						damage *= 2;
+#endif
 					if (tsc->data[SC_SPIDERWEB]->val2 == 0)
 						status_change_end(target, SC_SPIDERWEB, INVALID_TIMER);
 				}
@@ -517,6 +533,9 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
 		}
 	}
 
+	if (battle_config.attr_recover == 0 && ratio < 0)
+		ratio = 0;
+
 #ifdef RENEWAL
 	//In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
 	damage = damage - (int64)((damage * (100 - ratio)) / 100);

+ 0 - 2
src/map/status.c

@@ -13993,8 +13993,6 @@ static bool status_readdb_attrfix(const char *basedir,bool silent)
 					p++;
                                 //TODO seem unsafe to continue without check
 				attr_fix_table[lv-1][i][j] = atoi(p);
-				if (battle_config.attr_recover == 0 && attr_fix_table[lv-1][i][j] < 0)
-					attr_fix_table[lv-1][i][j] = 0;
 				p = strchr(p,',');
 				if(p)
 					*p++=0;