Skip to content
Snippets Groups Projects
Commit 8209afe6 authored by Zoey76's avatar Zoey76
Browse files

Cleanup of invalud methods.

Reported by: valanths1990
parent 51edc3fb
No related branches found
No related tags found
No related merge requests found
......@@ -48,12 +48,6 @@ public final class TransferHate extends AbstractEffect
return Formulas.calcProbability(_chance, info.getEffector(), info.getEffected(), info.getSkill());
}
@Override
public boolean canStart(BuffInfo info)
{
return Util.checkIfInRange(info.getSkill().getEffectRange(), info.getEffector(), info.getEffected(), true);
}
@Override
public boolean isInstant()
{
......@@ -63,6 +57,11 @@ public final class TransferHate extends AbstractEffect
@Override
public void onStart(BuffInfo info)
{
if (!Util.checkIfInRange(info.getSkill().getEffectRange(), info.getEffector(), info.getEffected(), true))
{
return;
}
for (L2Character obj : info.getEffector().getKnownList().getKnownCharactersInRadius(info.getSkill().getAffectRange()))
{
if ((obj == null) || !obj.isAttackable() || obj.isDead())
......
......@@ -55,16 +55,9 @@ public final class Unsummon extends AbstractEffect
return true;
}
}
return false;
}
@Override
public boolean canStart(BuffInfo info)
{
return info.getEffected().isSummon();
}
@Override
public boolean isInstant()
{
......@@ -75,7 +68,6 @@ public final class Unsummon extends AbstractEffect
public void onStart(BuffInfo info)
{
final L2Summon summon = info.getEffected().getSummon();
if (summon != null)
{
final L2PcInstance summonOwner = summon.getOwner();
......
......@@ -39,12 +39,6 @@ public final class VitalityPointUp extends AbstractEffect
_value = params.getFloat("value", 0);
}
@Override
public boolean canStart(BuffInfo info)
{
return (info.getEffected() != null) && info.getEffected().isPlayer();
}
@Override
public boolean isInstant()
{
......@@ -54,7 +48,10 @@ public final class VitalityPointUp extends AbstractEffect
@Override
public void onStart(BuffInfo info)
{
info.getEffected().getActingPlayer().updateVitalityPoints(_value, false, false);
info.getEffected().getActingPlayer().sendPacket(new UserInfo(info.getEffected().getActingPlayer()));
if ((info.getEffected() != null) && info.getEffected().isPlayer())
{
info.getEffected().getActingPlayer().updateVitalityPoints(_value, false, false);
info.getEffected().getActingPlayer().sendPacket(new UserInfo(info.getEffected().getActingPlayer()));
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment