Fixed capturing holy artefact under the shrine.
Thanks to Sahar.
This commit is contained in:
@@ -19,7 +19,6 @@ package handlers.targethandlers;
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.ArtefactInstance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.model.skills.targets.TargetType;
|
||||
|
||||
@@ -31,7 +30,7 @@ public class Holy implements ITargetTypeHandler
|
||||
@Override
|
||||
public WorldObject[] getTargetList(Skill skill, Creature creature, boolean onlyFirst, Creature target)
|
||||
{
|
||||
if (!(target instanceof ArtefactInstance))
|
||||
if ((target == null) || !target.isArtefact())
|
||||
{
|
||||
return EMPTY_TARGET_LIST;
|
||||
}
|
||||
|
@@ -356,7 +356,7 @@ public class GeoEngine
|
||||
*/
|
||||
public boolean canSeeTarget(WorldObject origin, WorldObject target)
|
||||
{
|
||||
if (target.isDoor() || (target.isCreature() && ((Creature) target).isFlying()))
|
||||
if (target.isDoor() || target.isArtefact() || (target.isCreature() && ((Creature) target).isFlying()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@@ -294,6 +294,15 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if object is instance of ArtefactInstance.
|
||||
* @return {@code true} if object is instance of ArtefactInstance, {@code false} otherwise
|
||||
*/
|
||||
public boolean isArtefact()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if object is instance of MonsterInstance.
|
||||
* @return {@code true} if object is instance of MonsterInstance, {@code false} otherwise
|
||||
|
@@ -42,9 +42,12 @@ public class ArtefactInstance extends Npc
|
||||
getCastle().registerArtefact(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return False.
|
||||
*/
|
||||
@Override
|
||||
public boolean isArtefact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(Creature attacker)
|
||||
{
|
||||
|
@@ -61,7 +61,7 @@ public class ConditionPlayerCanTakeCastle extends Condition
|
||||
player.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
return false;
|
||||
}
|
||||
else if (!Util.checkIfInRange(skill.getCastRange(), player, effected, true))
|
||||
else if (!Util.checkIfInRange(skill.getCastRange(), player, effected, true) || (Math.abs(player.getZ() - effected.getZ()) > 40))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user