Trajectory planning for working ships within offshore wind farms is significant for navigation safety and efficiency. Regarding to this, a global multi-direction A* algorithm is introduced. The algorithm is modified from three perspectives: (1) Artificial potential field (APF) is expressed in scalar mode instead of vector mode; (2) The moving distance in each step is adjusted based on the complexity of the around environment; (3) The penalty mode is proposed for the subsea pipelines. The scalar APF model avoids ships crossing between the two obstacles very close to each other, which is very important in dense wind turbine waters. The adjusted stepping mode can extend possible moving directions compared with conventional A* algorithm while making a trade-off between computation complexity and efficiency. The penalty model plays an effective role, so that the planned trajectory is crossing the pipelines only once. Simulation results indicate that the trajectory from 20-direction A* algorithm has similar path length with real cases while enhancing navigation safety to a large degree. Compared with the real-case trajectory, the minimum distance to the wind turbines has increased more than 3 times and the path length outside the wind farm decreased from more than 16000m to less than 11000m.