Fixed capturing holy artefact under the shrine.

Thanks to Sahar.
This commit is contained in:
MobiusDevelopment
2019-11-07 23:34:43 +00:00
parent 7ba832c6a7
commit 6e1df8a43a
103 changed files with 391 additions and 208 deletions

View File

@ -356,7 +356,7 @@ public class GeoEngine
*/
public boolean canSeeTarget(WorldObject origin, WorldObject target)
{
if (target.isDoor())
if (target.isDoor() || target.isArtefact())
{
return true;
}

View File

@ -134,7 +134,7 @@ public class TakeCastle implements ISkillHandler
{
sm.addString("You must be on castle ground to use this skill");
}
else if ((player.getTarget() == null) || !(player.getTarget() instanceof ArtefactInstance))
else if ((player.getTarget() == null) || !player.getTarget().isArtefact())
{
sm.addString("You can only use this skill on an artifact");
}
@ -142,7 +142,7 @@ public class TakeCastle implements ISkillHandler
{
sm.addString("You can only use this skill during a siege.");
}
else if (!Util.checkIfInRange(200, player, player.getTarget(), true))
else if (!Util.checkIfInRange(200, player, player.getTarget(), true) || (Math.abs(player.getZ() - player.getTarget().getZ()) > 40))
{
sm.addString("You are not in range of the artifact.");
}
@ -186,7 +186,7 @@ public class TakeCastle implements ISkillHandler
{
sm.addString("You must be on fort ground to use this skill");
}
else if ((player.getTarget() == null) && !(player.getTarget() instanceof ArtefactInstance))
else if ((player.getTarget() == null) && !player.getTarget().isArtefact())
{
sm.addString("You can only use this skill on an flagpole");
}

View File

@ -47,10 +47,12 @@ public class ArtefactInstance extends NpcInstance
super(objectId, template);
}
/**
* Return False.<BR>
* <BR>
*/
@Override
public boolean isArtefact()
{
return true;
}
@Override
public boolean isAutoAttackable(Creature attacker)
{
@ -122,10 +124,4 @@ public class ArtefactInstance extends NpcInstance
{
player.sendPacket(ActionFailed.STATIC_PACKET);
}
@Override
public boolean isArtefact()
{
return true;
}
}