Replaces the default taxi flight system with an instant teleport to the destination flight master for the normal flight cost.
Copy conf/tw-mod-instant-flight.conf.dist to your module config directory as tw-mod-instant-flight.conf and adjust:
[InstantFlight]
InstantFlight.Enable = 1
InstantFlight.AllowHeadless = 0
InstantFlight.ExcludeNodeIDs = 116, 117, 508, 509Enable: set to0to disable the module and restore the default flying behavior.AllowHeadless: set to1to apply instant flight to headless/bot sessions. Disabled by default because bots cannot ACK aTeleportTo, so they would be stranded.ExcludeNodeIDs: comma-separated taxi node IDs that should keep the normal on-rails behavior (e.g., the Blackstone/Sparkwater flying machine or quest flights).
The module hooks SERVERHOOK_CAN_PACKET_RECEIVE and intercepts CMSG_ACTIVATETAXI and CMSG_ACTIVATETAXIEXPRESS.
When a flight is requested:
- Headless sessions are passed through to the normal handler unless
AllowHeadlessis enabled. - Routes that contain a transport node (no mount model) or a node listed in
ExcludeNodeIDsare passed through so they stay on rails. - The module validates that the player knows all requested taxi nodes. This check is skipped when the player has taxi cheat enabled (e.g. GMs or when the world config
AllFlightPathsis enabled), matching the core taxi handler behavior. - It calculates the normal flight cost by summing the cost of each leg using
sObjectMgr.GetTaxiPath(). - If the player has enough money, the cost is deducted and the player is teleported to the final destination node.
- A success response is sent to the client so the taxi UI closes cleanly, and the original flight packet is cancelled so no flight path animation occurs.
If validation fails or the player cannot afford the flight, the packet is passed through to the normal handler so the client receives the appropriate error.
cmake -S . -B build -DMODULES=static
cmake -S . -B build -DMODULES=dynamic
# or per-module:
cmake -S . -B build -DMODULE_TW_MOD_INSTANT_FLIGHT=static