Vampiric effects from killing blows.
Contributed by nasseka.
This commit is contained in:
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
@@ -4638,6 +4638,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4664,43 +4701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4637,6 +4637,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4663,43 +4700,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4637,6 +4637,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4663,43 +4700,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4637,6 +4637,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4663,43 +4700,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4636,6 +4636,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4662,43 +4699,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+37
-37
@@ -4636,6 +4636,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4662,43 +4699,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4641,6 +4641,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4667,46 +4707,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4641,6 +4641,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4667,46 +4707,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4640,6 +4640,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4666,46 +4706,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4628,6 +4628,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4654,46 +4694,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4653,6 +4653,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4679,46 +4719,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4660,6 +4660,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4686,46 +4726,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4659,6 +4659,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4685,46 +4725,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
+40
-40
@@ -4669,6 +4669,46 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absorb HP from the damage inflicted
|
||||||
|
final boolean isPvP = isPlayable() && target.isPlayable();
|
||||||
|
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
||||||
|
{
|
||||||
|
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
||||||
|
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Absorb MP from the damage inflicted.
|
||||||
|
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
||||||
|
{
|
||||||
|
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
||||||
|
{
|
||||||
|
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
||||||
|
{
|
||||||
|
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||||
|
if (absorbMpPercent > 0)
|
||||||
|
{
|
||||||
|
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||||
|
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||||
|
if (absorbDamage > 0)
|
||||||
|
{
|
||||||
|
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Target receives the damage.
|
// Target receives the damage.
|
||||||
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
target.reduceCurrentHp(damage, this, skill, isDOT, directlyToHp, critical, reflect);
|
||||||
|
|
||||||
@@ -4695,46 +4735,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Absorb HP from the damage inflicted
|
|
||||||
final boolean isPvP = isPlayable() && target.isPlayable();
|
|
||||||
if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
|
|
||||||
{
|
|
||||||
final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
|
|
||||||
if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Absorb MP from the damage inflicted.
|
|
||||||
if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
|
|
||||||
{
|
|
||||||
if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
|
|
||||||
{
|
|
||||||
if (Rnd.get(10) < 3) // Classic: Static 30% change.
|
|
||||||
{
|
|
||||||
final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
|
||||||
if (absorbMpPercent > 0)
|
|
||||||
{
|
|
||||||
int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
|
||||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
|
||||||
if (absorbDamage > 0)
|
|
||||||
{
|
|
||||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reflectedDamage > 0)
|
if (reflectedDamage > 0)
|
||||||
{
|
{
|
||||||
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
target.doAttack(reflectedDamage, this, skill, isDOT, directlyToHp, critical, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user