private static void transfer( Player player, PortalTemplate portalTemplate, WorldMapInstance instance, boolean reenter) { ExitPoint exitPoint = TeleportService.getExitPointByRace(portalTemplate, player.getRace()); player.setInstanceStartPos(exitPoint.getX(), exitPoint.getY(), exitPoint.getZ()); InstanceService.registerPlayerWithInstance(instance, player); TeleportService.teleportTo( player, exitPoint.getMapId(), instance.getInstanceId(), exitPoint.getX(), exitPoint.getY(), exitPoint.getZ(), 3000, true); int instanceCooldownRate = InstanceService.getInstanceRate(player, exitPoint.getMapId()); int useDelay = 0; int instanceCoolTime = DataManager.INSTANCE_COOLTIME_DATA.getInstanceEntranceCooltime(instance.getMapId()); if (instanceCooldownRate > 0) { useDelay = instanceCoolTime * 60 * 1000 / instanceCooldownRate; } if (useDelay > 0 && !reenter) { player.getPortalCooldownList().addPortalCooldown(exitPoint.getMapId(), useDelay); } }
/** * this method used to teleport players from instance * * @param player * @param portalTemplate * @param reenter */ private static void easyTransfer(Player player, PortalTemplate portalTemplate, boolean reenter) { ExitPoint exitPoint = TeleportService.getExitPointByRace(portalTemplate, player.getRace()); TeleportService.teleportTo( player, exitPoint.getMapId(), exitPoint.getX(), exitPoint.getY(), exitPoint.getZ(), 3000, true); }