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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -40,7 +40,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;
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
@@ -372,7 +371,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
|
||||
private boolean checkAutoAttackCondition(L2Character target)
|
||||
{
|
||||
if ((target == null) || (target instanceof L2NpcInstance) || (target instanceof L2DoorInstance))
|
||||
if ((target == null) || target.isNpc() || (target instanceof L2DoorInstance))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -37,7 +37,6 @@ import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DefenderInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2FortCommanderInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
@@ -129,7 +128,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if the target isn't another guard, folk or a door
|
||||
if ((target instanceof L2DefenderInstance) || (target instanceof L2NpcInstance) || (target instanceof L2DoorInstance) || target.isAlikeDead() || (target instanceof L2FortCommanderInstance) || target.isPlayable())
|
||||
if ((target instanceof L2DefenderInstance) || target.isNpc() || (target instanceof L2DoorInstance) || target.isAlikeDead() || (target instanceof L2FortCommanderInstance) || target.isPlayable())
|
||||
{
|
||||
L2PcInstance player = null;
|
||||
if (target.isPlayer())
|
||||
|
@@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DefenderInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
@@ -124,7 +123,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
protected boolean autoAttackCondition(L2Character target)
|
||||
{
|
||||
// Check if the target isn't another guard, folk or a door
|
||||
if ((target == null) || (target instanceof L2DefenderInstance) || (target instanceof L2NpcInstance) || (target instanceof L2DoorInstance) || target.isAlikeDead())
|
||||
if ((target == null) || (target instanceof L2DefenderInstance) || target.isNpc() || (target instanceof L2DoorInstance) || target.isAlikeDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -38,7 +38,6 @@ import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2Party;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.stat.SummonStat;
|
||||
import com.l2jmobius.gameserver.model.actor.status.SummonStatus;
|
||||
@@ -779,7 +778,7 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
final SystemMessage sm;
|
||||
|
||||
if (target.isInvul() && !(target instanceof L2NpcInstance))
|
||||
if (target.isInvul() && !target.isNpc())
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_ATTACK_HAS_BEEN_BLOCKED);
|
||||
}
|
||||
|
@@ -325,7 +325,7 @@ public final class L2TrapInstance extends L2Npc
|
||||
OlympiadGameManager.getInstance().notifyCompetitorDamage(getOwner(), damage);
|
||||
}
|
||||
|
||||
if (target.isInvul() && !(target instanceof L2NpcInstance))
|
||||
if (target.isInvul() && !target.isNpc())
|
||||
{
|
||||
_owner.sendPacket(SystemMessageId.THE_ATTACK_HAS_BEEN_BLOCKED);
|
||||
}
|
||||
|
@@ -101,12 +101,7 @@ public final class RequestAcquireSkill implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final L2Npc trainer = activeChar.getLastFolkNPC();
|
||||
if (!(trainer instanceof L2NpcInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!trainer.canInteract(activeChar) && !activeChar.isGM())
|
||||
if ((trainer == null) || !trainer.isNpc() || (!trainer.canInteract(activeChar) && !activeChar.isGM()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
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;
|
||||
@@ -64,12 +63,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final L2Npc trainer = activeChar.getLastFolkNPC();
|
||||
if (!(trainer instanceof L2NpcInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!trainer.canInteract(activeChar) && !activeChar.isGM())
|
||||
if ((trainer == null) || !trainer.isNpc() || (!trainer.canInteract(activeChar) && !activeChar.isGM()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
@@ -126,7 +125,7 @@ public abstract class AbstractNpcInfo implements IClientOutgoingPacket
|
||||
}
|
||||
|
||||
// npc crest of owning clan/ally of castle
|
||||
if ((cha instanceof L2NpcInstance) && cha.isInsideZone(ZoneId.TOWN) && (Config.SHOW_CREST_WITHOUT_QUEST || cha.getCastle().getShowNpcCrest()) && (cha.getCastle().getOwnerId() != 0))
|
||||
if (cha.isNpc() && cha.isInsideZone(ZoneId.TOWN) && (Config.SHOW_CREST_WITHOUT_QUEST || cha.getCastle().getShowNpcCrest()) && (cha.getCastle().getOwnerId() != 0))
|
||||
{
|
||||
final L2TownZone town = TownManager.getTown(_x, _y, _z);
|
||||
if (town != null)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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