Summons cast skills on non flagged players.
This commit is contained in:
parent
68654aaee3
commit
08294a16cf
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,12 @@ public class NotFriend implements IAffectObjectHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point summon should be prevented from attacking friendly targets.
|
||||
if (activeChar.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// By default any flagged/PK player is considered enemy.
|
||||
return (target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
final L2Object target = _skill.getTarget(_actor, _skill.isBad(), _dontMove, false);
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@ -133,7 +133,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
summon.setFollowStatus(false);
|
||||
setIntention(AI_INTENTION_IDLE);
|
||||
_startFollow = val;
|
||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||
_actor.doCast(_skill, _item, _skill.isBad(), _dontMove);
|
||||
}
|
||||
|
||||
private void thinkPickUp()
|
||||
|
@ -396,6 +396,12 @@ public class L2Npc extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can attack NPCs.
|
||||
if (attacker.isSummon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isTargetable())
|
||||
{
|
||||
return false;
|
||||
|
@ -627,7 +627,8 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||
final L2Object currentTarget = _owner.getTarget();
|
||||
target = skill.getTarget(this, skill.isBad() && (currentTarget != null) && (!currentTarget.isPlayable() || !currentTarget.isInsideZone(ZoneId.PEACE)), dontMove, false);
|
||||
}
|
||||
|
||||
// Check the validity of the target
|
||||
@ -776,7 +777,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, skill.isBad(), false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
@ -786,7 +787,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
super.doCast(skill);
|
||||
doCast(skill, null, skill.isBad(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user