Replaced instanceof L2NpcInstance with isNpc method.
This commit is contained in:
@@ -32,7 +32,7 @@ public class SkillList implements IBypassHandler
|
||||
@Override
|
||||
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
|
||||
{
|
||||
if (!(target instanceof L2NpcInstance))
|
||||
if ((target == null) || !target.isNpc())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -265,7 +265,7 @@ public final class L2TrapInstance extends L2Npc
|
||||
OlympiadGameManager.getInstance().notifyCompetitorDamage(getOwner(), damage);
|
||||
}
|
||||
|
||||
if (target.isHpBlocked() && !(target instanceof L2NpcInstance))
|
||||
if (target.isHpBlocked() && !target.isNpc())
|
||||
{
|
||||
_owner.sendPacket(SystemMessageId.THE_ATTACK_HAS_BEEN_BLOCKED);
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@ import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2FishermanInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2VillageMasterInstance;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
@@ -111,12 +110,7 @@ public final class RequestAcquireSkill implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final L2Npc trainer = activeChar.getLastFolkNPC();
|
||||
if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_skillType != AcquireSkillType.CLASS) && !trainer.canInteract(activeChar) && !activeChar.isGM())
|
||||
if ((_skillType != AcquireSkillType.CLASS) && ((trainer == null) || !trainer.isNpc() || (!trainer.canInteract(activeChar) && !activeChar.isGM())))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.model.ClanPrivilege;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
@@ -67,12 +66,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final L2Npc trainer = activeChar.getLastFolkNPC();
|
||||
if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_skillType != AcquireSkillType.CLASS) && !trainer.canInteract(activeChar) && !activeChar.isGM())
|
||||
if ((_skillType != AcquireSkillType.CLASS) && ((trainer == null) || !trainer.isNpc() || (!trainer.canInteract(activeChar) && !activeChar.isGM())))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user