Classic adjustments for absorb damage effects.

This commit is contained in:
MobiusDev
2018-12-29 04:12:11 +00:00
parent c3a3d35bfb
commit ba770312fd
4 changed files with 72 additions and 48 deletions

View File

@@ -4367,6 +4367,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
} }
// Absorb HP from the damage inflicted // Absorb HP from the damage inflicted
if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
{
double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1); double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1);
if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE))) if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE)))
{ {
@@ -4377,9 +4379,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentHp(_status.getCurrentHp() + absorbDamage); setCurrentHp(_status.getCurrentHp() + absorbDamage);
} }
} }
}
// Absorb MP from the damage inflicted. // Absorb MP from the damage inflicted.
absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0); if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
{
double absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
if (absorbPercent > 0) if (absorbPercent > 0)
{ {
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp()); int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
@@ -4389,6 +4394,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentMp(_status.getCurrentMp() + absorbDamage); setCurrentMp(_status.getCurrentMp() + absorbDamage);
} }
} }
}
if (reflectedDamage > 0) if (reflectedDamage > 0)
{ {

View File

@@ -4367,6 +4367,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
} }
// Absorb HP from the damage inflicted // Absorb HP from the damage inflicted
if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
{
double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1); double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1);
if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE))) if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE)))
{ {
@@ -4377,9 +4379,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentHp(_status.getCurrentHp() + absorbDamage); setCurrentHp(_status.getCurrentHp() + absorbDamage);
} }
} }
}
// Absorb MP from the damage inflicted. // Absorb MP from the damage inflicted.
absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0); if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
{
double absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
if (absorbPercent > 0) if (absorbPercent > 0)
{ {
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp()); int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
@@ -4389,6 +4394,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentMp(_status.getCurrentMp() + absorbDamage); setCurrentMp(_status.getCurrentMp() + absorbDamage);
} }
} }
}
if (reflectedDamage > 0) if (reflectedDamage > 0)
{ {

View File

@@ -4367,6 +4367,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
} }
// Absorb HP from the damage inflicted // Absorb HP from the damage inflicted
if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
{
double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1); double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1);
if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE))) if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE)))
{ {
@@ -4377,9 +4379,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentHp(_status.getCurrentHp() + absorbDamage); setCurrentHp(_status.getCurrentHp() + absorbDamage);
} }
} }
}
// Absorb MP from the damage inflicted. // Absorb MP from the damage inflicted.
absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0); if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
{
double absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
if (absorbPercent > 0) if (absorbPercent > 0)
{ {
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp()); int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
@@ -4389,6 +4394,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentMp(_status.getCurrentMp() + absorbDamage); setCurrentMp(_status.getCurrentMp() + absorbDamage);
} }
} }
}
if (reflectedDamage > 0) if (reflectedDamage > 0)
{ {

View File

@@ -4367,6 +4367,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
} }
// Absorb HP from the damage inflicted // Absorb HP from the damage inflicted
if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
{
double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1); double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1);
if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE))) if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE)))
{ {
@@ -4377,9 +4379,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentHp(_status.getCurrentHp() + absorbDamage); setCurrentHp(_status.getCurrentHp() + absorbDamage);
} }
} }
}
// Absorb MP from the damage inflicted. // Absorb MP from the damage inflicted.
absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0); if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
{
double absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
if (absorbPercent > 0) if (absorbPercent > 0)
{ {
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp()); int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
@@ -4389,6 +4394,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setCurrentMp(_status.getCurrentMp() + absorbDamage); setCurrentMp(_status.getCurrentMp() + absorbDamage);
} }
} }
}
if (reflectedDamage > 0) if (reflectedDamage > 0)
{ {