Replaced instanceof L2Summon with isSummon method.
This commit is contained in:
parent
0b09d49f8d
commit
856ff5ebdc
@ -743,7 +743,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -755,7 +755,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -755,7 +755,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -755,7 +755,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -755,7 +755,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -751,7 +751,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import java.util.StringTokenizer;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
|
||||
@ -108,7 +107,7 @@ public class AdminInstance implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if ((target == null) || (target instanceof L2Summon)) // Don't separate summons from masters
|
||||
if ((target == null) || target.isSummon()) // Don't separate summons from masters
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
|
||||
return false;
|
||||
|
@ -95,7 +95,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
final L2Character followTarget = _followTarget; // copy to prevent NPE
|
||||
if (followTarget == null)
|
||||
{
|
||||
if (_actor instanceof L2Summon)
|
||||
if (_actor.isSummon())
|
||||
{
|
||||
((L2Summon) _actor).setFollowStatus(false);
|
||||
}
|
||||
@ -108,7 +108,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
if (!_actor.isInsideRadius(followTarget, 3000, true, false))
|
||||
{
|
||||
// if the target is too far (maybe also teleported)
|
||||
if (_actor instanceof L2Summon)
|
||||
if (_actor.isSummon())
|
||||
{
|
||||
((L2Summon) _actor).setFollowStatus(false);
|
||||
}
|
||||
@ -713,7 +713,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
|
||||
public void setAutoAttacking(boolean isAutoAttacking)
|
||||
{
|
||||
if (_actor instanceof L2Summon)
|
||||
if (_actor.isSummon())
|
||||
{
|
||||
final L2Summon summon = (L2Summon) _actor;
|
||||
if (summon.getOwner() != null)
|
||||
@ -731,7 +731,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
*/
|
||||
public void clientStartAutoAttack()
|
||||
{
|
||||
if (_actor instanceof L2Summon)
|
||||
if (_actor.isSummon())
|
||||
{
|
||||
final L2Summon summon = (L2Summon) _actor;
|
||||
if (summon.getOwner() != null)
|
||||
@ -759,7 +759,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
*/
|
||||
public void clientStopAutoAttack()
|
||||
{
|
||||
if (_actor instanceof L2Summon)
|
||||
if (_actor.isSummon())
|
||||
{
|
||||
final L2Summon summon = (L2Summon) _actor;
|
||||
if (summon.getOwner() != null)
|
||||
|
@ -1938,7 +1938,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((obj.isPlayer() || (obj instanceof L2Summon)) && (dist2 <= range) && !getAttackTarget().isAffectedBySkill(sk.getId()))
|
||||
if ((obj.isPlayer() || obj.isSummon()) && (dist2 <= range) && !getAttackTarget().isAffectedBySkill(sk.getId()))
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
@ -2010,7 +2010,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((obj.isPlayer() || (obj instanceof L2Summon)) && (dist2 <= range) && (getAttackTarget().getEffectList().getFirstEffect(L2EffectType.BUFF) != null))
|
||||
if ((obj.isPlayer() || obj.isSummon()) && (dist2 <= range) && (getAttackTarget().getEffectList().getFirstEffect(L2EffectType.BUFF) != null))
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
@ -2087,7 +2087,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof L2Summon)
|
||||
if (obj.isSummon())
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
@ -2162,7 +2162,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
setAttackTarget(obj);
|
||||
}
|
||||
}
|
||||
else if (obj instanceof L2Summon)
|
||||
else if (obj.isSummon())
|
||||
{
|
||||
actor.addDamageHate(obj, 0, MostHate != null ? actor.getHating(MostHate) : 2000);
|
||||
actor.setTarget(obj);
|
||||
@ -2235,7 +2235,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
setAttackTarget(obj);
|
||||
}
|
||||
}
|
||||
else if (obj instanceof L2Summon)
|
||||
else if (obj.isSummon())
|
||||
{
|
||||
actor.addDamageHate(obj, 0, MostHate != null ? actor.getHating(MostHate) : 2000);
|
||||
actor.setTarget(obj);
|
||||
|
@ -136,7 +136,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
player = (L2PcInstance) target;
|
||||
}
|
||||
else if (target instanceof L2Summon)
|
||||
else if (target.isSummon())
|
||||
{
|
||||
player = ((L2Summon) target).getOwner();
|
||||
}
|
||||
@ -151,7 +151,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Get the owner if the target is a summon
|
||||
if (target instanceof L2Summon)
|
||||
if (target.isSummon())
|
||||
{
|
||||
final L2PcInstance owner = ((L2Summon) target).getOwner();
|
||||
if (_actor.isInsideRadius(owner, 1000, true, false))
|
||||
|
@ -136,7 +136,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Get the owner if the target is a summon
|
||||
if (target instanceof L2Summon)
|
||||
if (target.isSummon())
|
||||
{
|
||||
final L2PcInstance owner = ((L2Summon) target).getOwner();
|
||||
if (_actor.isInsideRadius(owner, 1000, true, false))
|
||||
|
@ -135,7 +135,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (attacker instanceof L2Summon)
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
attacker = ((L2Summon) attacker).getOwner();
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public final class L2GrandBossInstance extends L2MonsterInstance
|
||||
{
|
||||
player = (L2PcInstance) killer;
|
||||
}
|
||||
else if (killer instanceof L2Summon)
|
||||
else if (killer.isSummon())
|
||||
{
|
||||
player = ((L2Summon) killer).getOwner();
|
||||
}
|
||||
|
@ -13801,7 +13801,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
L2PcInstance target;
|
||||
if (cha instanceof L2Summon)
|
||||
if (cha.isSummon())
|
||||
{
|
||||
target = ((L2Summon) cha).getOwner();
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.PcCondOverride;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.events.ListenersContainer;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -829,7 +828,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
|
||||
if (!preCondition.test(activeChar, target, null, null))
|
||||
{
|
||||
if (activeChar instanceof L2Summon)
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THIS_PET_CANNOT_USE_THIS_ITEM);
|
||||
return false;
|
||||
|
@ -739,7 +739,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -751,7 +751,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -751,7 +751,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_info"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
gatherSummonInfo((L2Summon) target, activeChar);
|
||||
}
|
||||
@ -751,7 +751,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_unsummon"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2Summon)
|
||||
if ((target != null) && target.isSummon())
|
||||
{
|
||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user