* position the hook on the water surface. If not, you have to be GM to
* proceed past here... in that case, the hook will be positioned using
* the old Z lookup method.
*/
L2FishingZone aimingTo = FishingZoneManager.getInstance().isInsideFishingZone(x, y, z);
L2WaterZone water = FishingZoneManager.getInstance().isInsideWaterZone(x, y, z);
if(aimingTo != null && water != null && (GeoData.getInstance().canSeeTarget(player.getX(), player.getY(), player.getZ() + 50, x, y, water.getWaterZ() - 50)))
{
z = water.getWaterZ() + 10;
// player.sendMessage("Hook x,y: " + x + "," + y + " - Water Z,
// Player Z:" + z + ", " + player.getZ()); //debug line, shows hook
// landing related coordinates. Uncoment if needed.
}
else if(aimingTo != null && water != null && GeoData.getInstance().canSeeTarget(player.getX(), player.getY(), player.getZ() + 50, x, y, water.getWaterZ() - 50))
z = aimingTo.getWaterZ() + 10;
else
{
//You can't fish here
player.sendPacket(new SystemMessage(SystemMessageId.BAIT_ON_HOOK_BEFORE_FISHING));