Corrected Crystallized state effect (#3226)

* Fixes #3225.
* While Crystallized Wind damage is increased 50%.
* Corrected an arrow state check for Crystallization on weapon damage reduction.
* Corrected elemental damage calculation for targets in pre-renewal mode.
Thanks to @flamefury!
This commit is contained in:
Aleos 2018-06-18 16:51:43 -04:00 committed by GitHub
parent f3eab9dd4a
commit 375f0ae465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -492,9 +492,12 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
if (tsc && tsc->count) { //increase dmg by target status if (tsc && tsc->count) { //increase dmg by target status
switch(atk_elem) { switch(atk_elem) {
case ELE_FIRE: case ELE_FIRE:
if (tsc->data[SC_SPIDERWEB]) { if (tsc->data[SC_SPIDERWEB]) { //Double damage
//Double damage #ifdef RENEWAL
ratio += 100;
#else
damage *= 2; damage *= 2;
#endif
//Remove a unit group or end whole status change //Remove a unit group or end whole status change
status_change_end(target, SC_SPIDERWEB, INVALID_TIMER); status_change_end(target, SC_SPIDERWEB, INVALID_TIMER);
} }
@ -503,32 +506,66 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
if (tsc->data[SC_CRYSTALIZE]) if (tsc->data[SC_CRYSTALIZE])
status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER); status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER);
if (tsc->data[SC_EARTH_INSIGNIA]) if (tsc->data[SC_EARTH_INSIGNIA])
#ifdef RENEWAL
ratio += 50; ratio += 50;
#else
damage += (int64)(damage * 50 / 100);
#endif
break; break;
case ELE_HOLY: case ELE_HOLY:
if (tsc->data[SC_ORATIO]) if (tsc->data[SC_ORATIO])
#ifdef RENEWAL
ratio += tsc->data[SC_ORATIO]->val1 * 2; ratio += tsc->data[SC_ORATIO]->val1 * 2;
#else
damage += (int64)(damage * (tsc->data[SC_ORATIO]->val1 * 2) / 100);
#endif
break; break;
case ELE_POISON: case ELE_POISON:
if (tsc->data[SC_VENOMIMPRESS]) if (tsc->data[SC_VENOMIMPRESS])
#ifdef RENEWAL
ratio += tsc->data[SC_VENOMIMPRESS]->val2; ratio += tsc->data[SC_VENOMIMPRESS]->val2;
#else
damage += (int64)(damage * tsc->data[SC_VENOMIMPRESS]->val2 / 100);
#endif
break; break;
case ELE_WIND: case ELE_WIND:
if (tsc->data[SC_WATER_INSIGNIA]) if (tsc->data[SC_WATER_INSIGNIA])
#ifdef RENEWAL
ratio += 50; ratio += 50;
#else
damage += (int64)(damage * 50 / 100);
#endif
if (tsc->data[SC_CRYSTALIZE])
#ifdef RENEWAL
ratio += 50;
#else
damage += (int64)(damage * 50 / 100);
#endif
break; break;
case ELE_WATER: case ELE_WATER:
if (tsc->data[SC_FIRE_INSIGNIA]) if (tsc->data[SC_FIRE_INSIGNIA])
#ifdef RENEWAL
ratio += 50; ratio += 50;
#else
damage += (int64)(damage * 50 / 100);
#endif
break; break;
case ELE_EARTH: case ELE_EARTH:
if (tsc->data[SC_WIND_INSIGNIA]) if (tsc->data[SC_WIND_INSIGNIA])
#ifdef RENEWAL
ratio += 50; ratio += 50;
#else
damage += (int64)(damage * 50 / 100);
#endif
status_change_end(target, SC_MAGNETICFIELD, INVALID_TIMER); //freed if received earth dmg status_change_end(target, SC_MAGNETICFIELD, INVALID_TIMER); //freed if received earth dmg
break; break;
case ELE_NEUTRAL: case ELE_NEUTRAL:
if (tsc->data[SC_ANTI_M_BLAST]) if (tsc->data[SC_ANTI_M_BLAST])
#ifdef RENEWAL
ratio += tsc->data[SC_ANTI_M_BLAST]->val2; ratio += tsc->data[SC_ANTI_M_BLAST]->val2;
#else
damage += (int64)(damage * tsc->data[SC_ANTI_M_BLAST]->val2 / 100);
#endif
break; break;
} }
} }
@ -1240,7 +1277,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
break; break;
case W_MUSICAL: case W_MUSICAL:
case W_WHIP: case W_WHIP:
if(!sd->state.arrow_atk) if(!tsd->state.arrow_atk)
break; break;
case W_BOW: case W_BOW:
case W_REVOLVER: case W_REVOLVER: