Fixed siege door targeting with enabled geodata.

This commit is contained in:
MobiusDev
2017-09-07 02:58:22 +00:00
parent b4e0a77538
commit ea14bb8c3e
5 changed files with 20 additions and 30 deletions

View File

@@ -1051,16 +1051,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// GeoData Los Check here (or dz > 1000) // GeoData Los Check here (or dz > 1000)
if (!GeoEngine.getInstance().canSeeTarget(this, target)) if (!GeoEngine.getInstance().canSeeTarget(this, target))
{ {
if (target.isDoor() && target.isAutoAttackable(this)) if (!target.isDoor() || !target.isAutoAttackable(this))
{ {
getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
return;
}
sendPacket(SystemMessageId.CANNOT_SEE_TARGET); sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;
} }
}
// BOW and CROSSBOW checks // BOW and CROSSBOW checks
if ((weaponItem != null) && weaponItem.getItemType().isRanged()) if ((weaponItem != null) && weaponItem.getItemType().isRanged())

View File

@@ -1051,16 +1051,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// GeoData Los Check here (or dz > 1000) // GeoData Los Check here (or dz > 1000)
if (!GeoEngine.getInstance().canSeeTarget(this, target)) if (!GeoEngine.getInstance().canSeeTarget(this, target))
{ {
if (target.isDoor() && target.isAutoAttackable(this)) if (!target.isDoor() || !target.isAutoAttackable(this))
{ {
getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
return;
}
sendPacket(SystemMessageId.CANNOT_SEE_TARGET); sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;
} }
}
// BOW and CROSSBOW checks // BOW and CROSSBOW checks
if ((weaponItem != null) && weaponItem.getItemType().isRanged()) if ((weaponItem != null) && weaponItem.getItemType().isRanged())

View File

@@ -1051,16 +1051,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// GeoData Los Check here (or dz > 1000) // GeoData Los Check here (or dz > 1000)
if (!GeoEngine.getInstance().canSeeTarget(this, target)) if (!GeoEngine.getInstance().canSeeTarget(this, target))
{ {
if (target.isDoor() && target.isAutoAttackable(this)) if (!target.isDoor() || !target.isAutoAttackable(this))
{ {
getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
return;
}
sendPacket(SystemMessageId.CANNOT_SEE_TARGET); sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;
} }
}
// BOW and CROSSBOW checks // BOW and CROSSBOW checks
if ((weaponItem != null) && weaponItem.getItemType().isRanged()) if ((weaponItem != null) && weaponItem.getItemType().isRanged())

View File

@@ -1009,16 +1009,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// GeoData Los Check here (or dz > 1000) // GeoData Los Check here (or dz > 1000)
if (!GeoEngine.getInstance().canSeeTarget(this, target)) if (!GeoEngine.getInstance().canSeeTarget(this, target))
{ {
if (target.isDoor() && target.isAutoAttackable(this)) if (!target.isDoor() || !target.isAutoAttackable(this))
{ {
getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
return;
}
sendPacket(SystemMessageId.CANNOT_SEE_TARGET); sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;
} }
}
target.getKnownList().addKnownObject(this); target.getKnownList().addKnownObject(this);

View File

@@ -1051,16 +1051,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// GeoData Los Check here (or dz > 1000) // GeoData Los Check here (or dz > 1000)
if (!GeoEngine.getInstance().canSeeTarget(this, target)) if (!GeoEngine.getInstance().canSeeTarget(this, target))
{ {
if (target.isDoor() && target.isAutoAttackable(this)) if (!target.isDoor() || !target.isAutoAttackable(this))
{ {
getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
return;
}
sendPacket(SystemMessageId.CANNOT_SEE_TARGET); sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;
} }
}
// BOW and CROSSBOW checks // BOW and CROSSBOW checks
if ((weaponItem != null) && weaponItem.getItemType().isRanged()) if ((weaponItem != null) && weaponItem.getItemType().isRanged())