expansion:naval:encounters
Table of Contents
NPC Pirate Ships & Ship Encounters
Where are the NPC pirate ships?
They exist as NPC captains that spawn their own ships, crew, cannons, and hold supplies.
In the naval code, the encounter “system” is primarily driven by:
- NPC captains like:
- Corsair Captain
- Ghost Captain
- Viking Captain
- Crew types (example: Corsair Crew; plus other crew classes used by the captain logic)
This means: when the captain spawns (usually via a spawner/zone system), the captain then builds the encounter ship.
How an encounter ship is created
When an encounter captain initializes without an existing ship:
- The captain spawns a ship at its location (if it can fit).
- The ship becomes owned by the captain.
- The ship is given a random ship name.
- The ship is painted (ghost ships use a specific hue; others random in a range).
- The ship's cannon capacity is set between StartingMaxCannons and MaxCannons.
- The ship automatically adds cannons (AutoAddCannons).
- A crew is spawned onto the ship.
If the ship cannot fit, the ship and captain delete (failed spawn).
Crew & combat behavior
Crew count
Encounter captains spawn a crew of about 3–5 members onto the deck.
Shooting frequency scales with crew
Encounter captains scale their cannon cadence based on crew:
- more crew = faster firing
- bounded so it never becomes extreme
(Internally it’s a seconds value that bottoms out at 2 seconds and tops out at 10 seconds.)
Loot & supplies (ship hold)
Encounter ships typically spawn with hold supplies like:
- Swab, Ramrod, Torch (ship gear)
- Cannonballs, Grapeshot, Powder Charges, Fuse Cords
- Sometimes elemental cannonballs (fire/frost)
- Gold and Copper amounts (configured ranges)
expansion/naval/encounters.txt · Last modified: by UO Enigma
