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)
This commit is contained in:
parent
fd892a0425
commit
08406785c6
@ -432,15 +432,27 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
|
|||||||
switch(atk_elem){
|
switch(atk_elem){
|
||||||
case ELE_FIRE:
|
case ELE_FIRE:
|
||||||
if (sc->data[SC_VOLCANO])
|
if (sc->data[SC_VOLCANO])
|
||||||
|
#ifdef RENEWAL
|
||||||
ratio += sc->data[SC_VOLCANO]->val3;
|
ratio += sc->data[SC_VOLCANO]->val3;
|
||||||
|
#else
|
||||||
|
damage += (int64)((damage*sc->data[SC_VOLCANO]->val3) / 100);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ELE_WIND:
|
case ELE_WIND:
|
||||||
if (sc->data[SC_VIOLENTGALE])
|
if (sc->data[SC_VIOLENTGALE])
|
||||||
|
#ifdef RENEWAL
|
||||||
ratio += sc->data[SC_VIOLENTGALE]->val3;
|
ratio += sc->data[SC_VIOLENTGALE]->val3;
|
||||||
|
#else
|
||||||
|
damage += (int64)((damage*sc->data[SC_VIOLENTGALE]->val3) / 100);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ELE_WATER:
|
case ELE_WATER:
|
||||||
if (sc->data[SC_DELUGE])
|
if (sc->data[SC_DELUGE])
|
||||||
|
#ifdef RENEWAL
|
||||||
ratio += sc->data[SC_DELUGE]->val3;
|
ratio += sc->data[SC_DELUGE]->val3;
|
||||||
|
#else
|
||||||
|
damage += (int64)((damage*sc->data[SC_DELUGE]->val3) / 100);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ELE_GHOST:
|
case ELE_GHOST:
|
||||||
if (sc->data[SC_TELEKINESIS_INTENSE])
|
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]) {
|
if (tsc->data[SC_SPIDERWEB]) {
|
||||||
tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now
|
tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now
|
||||||
if (tsc->data[SC_SPIDERWEB]->val2-- > 0)
|
if (tsc->data[SC_SPIDERWEB]->val2-- > 0)
|
||||||
|
#ifdef RENEWAL
|
||||||
ratio += 100; // double damage
|
ratio += 100; // double damage
|
||||||
|
#else
|
||||||
|
damage *= 2;
|
||||||
|
#endif
|
||||||
if (tsc->data[SC_SPIDERWEB]->val2 == 0)
|
if (tsc->data[SC_SPIDERWEB]->val2 == 0)
|
||||||
status_change_end(target, SC_SPIDERWEB, INVALID_TIMER);
|
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
|
#ifdef RENEWAL
|
||||||
//In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
|
//In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
|
||||||
damage = damage - (int64)((damage * (100 - ratio)) / 100);
|
damage = damage - (int64)((damage * (100 - ratio)) / 100);
|
||||||
|
@ -13993,8 +13993,6 @@ static bool status_readdb_attrfix(const char *basedir,bool silent)
|
|||||||
p++;
|
p++;
|
||||||
//TODO seem unsafe to continue without check
|
//TODO seem unsafe to continue without check
|
||||||
attr_fix_table[lv-1][i][j] = atoi(p);
|
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,',');
|
p = strchr(p,',');
|
||||||
if(p)
|
if(p)
|
||||||
*p++=0;
|
*p++=0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user