public void reduceHp(double value, L2Character attacker, boolean isHpConsumption)
{
_log.warning("it goes here");
reduceHp2(value, attacker, true, false, isHpConsumption);
}
public void reduceHp2(double value, L2Character attacker, boolean awake, boolean isDOT, boolean isHPConsumption)
{
_log.warning("wtf");
if (getActiveChar().isDead())
{
return;
}
// invul handling
if (getActiveChar().isInvul())
{
// other chars can't damage
if (attacker != getActiveChar())
{
return;
}
// only DOT and HP consumption allowed for damage self
if (!isDOT && !isHPConsumption)
{
return;
}
}
if (attacker != null)
{
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if ((attackerPlayer != null) && attackerPlayer.isGM() && !attackerPlayer.getAccessLevel().canGiveDamage())
{
return;
}
}
if (!isDOT && !isHPConsumption)
{
getActiveChar().stopEffectsOnDamage(awake);
if (getActiveChar().isStunned() && (Rnd.get(10) == 0))
{
getActiveChar().stopStunning(true);
}
}
if (value > 0)
{
setCurrentHp(Math.max(getCurrentHp() - value, 0));
}
if ((getActiveChar().getCurrentHp() < 0.5) && getActiveChar().isMortal()) // Die
{
getActiveChar().abortAttack();
getActiveChar().abortCast();
if (Config.DEBUG)
{
_log.fine("char is dead.");
}
getActiveChar().doDie(attacker);
}
}
public void reduceHp(double value, L2Character attacker, boolean awake, boolean isDOT, boolean isHPConsumption)
{
_log.warning("wtf");
if (getActiveChar().isDead())
{
return;
}
// invul handling
if (getActiveChar().isInvul())
{
// other chars can't damage
if (attacker != getActiveChar())
{
return;
}
// only DOT and HP consumption allowed for damage self
if (!isDOT && !isHPConsumption)
{
return;
}
}
if (attacker != null)
{
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if ((attackerPlayer != null) && attackerPlayer.isGM() && !attackerPlayer.getAccessLevel().canGiveDamage())
{
return;
}
}
if (!isDOT && !isHPConsumption)
{
getActiveChar().stopEffectsOnDamage(awake);
if (getActiveChar().isStunned() && (Rnd.get(10) == 0))
{
getActiveChar().stopStunning(true);
}
}
if (value > 0)
{
setCurrentHp(Math.max(getCurrentHp() - value, 0));
}
if ((getActiveChar().getCurrentHp() < 0.5) && getActiveChar().isMortal()) // Die
{
getActiveChar().abortAttack();
getActiveChar().abortCast();
if (Config.DEBUG)
{
_log.fine("char is dead.");
}
getActiveChar().doDie(attacker);
}
}
This worked for me