Unmanned Aerial Vehicles (UAVs) are increasingly utilized for urban patrol and defense owing to their low cost, high mobility, and rapid deployment. This paper proposes a multi-UAV mission planning model that takes into account mission execution rates, flight energy consumption costs, and impact costs. A kinematics and dynamics model of a quadcopter UAV is established, and the UAV’s flight state is analyzed. Due to the difficulties in addressing 3D UAV kinematic constraints and poor uniformity using traditional optimization algorithms, a lightning search algorithm (LSA) based on multi-layer nesting and random walk strategies (MNRW-LSA) is proposed. The convergence performance of the MNRW-LSA algorithm is demonstrated by comparing it with several other algorithms, such as the Golden Jackal Optimization (GJO), Hunter–Prey Optimization (HPO), Pelican Optimization Algorithm (POA), Reptile Search Algorithm (RSA), and the Golden Eagle Optimization (GEO) using optimization test functions, Friedman and Nemenyi tests. Additionally, a greedy strategy is added to the Rapidly-Exploring Random Tree (RRT) algorithm to initialize the trajectories for simulation experiments using a 3D city model. The results indicate that the proposed algorithm can enhance global convergence and robustness, shorten convergence time, improve UAV execution coverage, and reduce energy consumption. Compared with other algorithms, such as Particle Swarm Optimization (PSO), Simulated Annealing (SA), and LSA, the proposed method has greater advantages in addressing multi-UAV trajectory planning problems.