Package l2p.gameserver.skills.conditions

Source Code of l2p.gameserver.skills.conditions.ConditionTargetPlayerRace

package l2p.gameserver.skills.conditions;

import l2p.gameserver.model.L2Character;
import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.base.Race;
import l2p.gameserver.skills.Env;

public class ConditionTargetPlayerRace extends Condition
{
  private final Race _race;

  public ConditionTargetPlayerRace(String race)
  {
    _race = Race.valueOf(race.toLowerCase());
  }

  @Override
  protected boolean testImpl(Env env)
  {
    L2Character target = env.target;
    return target != null && target.isPlayer() && _race == ((L2Player) target).getRace();
  }
}
TOP

Related Classes of l2p.gameserver.skills.conditions.ConditionTargetPlayerRace

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.