Editing Server:Boats
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
If a grid is timed too short or too long, players will either get dropped off in the water or players will end up at the safe spot in the destination zone. Boat zones need to be static. | If a grid is timed too short or too long, players will either get dropped off in the water or players will end up at the safe spot in the destination zone. Boat zones need to be static. | ||
== Server-Side Source == | == Server-Side Source == | ||
The following boats and their ID's are described as enum constants in the server source code: https://github.com/EQMacEmu/Server/blob/main/common/eq_constants.h#L685 | The following boats and their ID's are described as enum constants in the server source code: https://github.com/EQMacEmu/Server/blob/main/common/eq_constants.h#L685 | ||
<pre> | <pre> | ||
Line 28: | Line 25: | ||
</pre> | </pre> | ||
=== Zone Entry === | |||
Each time a client enters a zone, the server checks the client packet's player profile struct for a boatid > 0 and whether the client is currently in Timorous Deep or Firionia Vie. If this is true, the boatid in the player profile struct is set back to 0. | Each time a client enters a zone, the server checks the client packet's player profile struct for a boatid > 0 and whether the client is currently in Timorous Deep or Firionia Vie. If this is true, the boatid in the player profile struct is set back to 0. | ||
<pre> | <pre> | ||
void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) | void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) | ||
... | |||
if(m_pp.boatid > 0 && (zone->GetZoneID() == timorous || zone->GetZoneID() == firiona)) | if(m_pp.boatid > 0 && (zone->GetZoneID() == timorous || zone->GetZoneID() == firiona)) | ||
pps->boat[0] = 0; | pps->boat[0] = 0; | ||
</pre> | </pre> | ||
* https://github.com/EQMacEmu | * See https://github.com/SecretsOTheP/EQMacEmu/blob/19d8a526e4f5e5f3900abe1b6e2d51c4b8ecff8c/zone/client_packet.cpp#L1693 | ||
Boat ID's are stored in the player profile packet (pp.boatname and pp.boatid). | |||
So when the boat moves, we send the pc to their destination and the boatid. If the player finds that boatid in their destination zone, it will land on it. Otherwise, it will be sent to the zone safe location. | When you board the boat, the boatid is registered in the [https://github.com/EQMacEmu/Server/blob/main/common/patches/mac_structs.h#L567 PlayerProfile in the code] (common/patches/mac_structs), sent by the client to the server, and temporarily stored in the `character_data`.boatid field in the database. So when the boat moves, we send the pc to their destination and the boatid. If the player finds that boatid in their destination zone, it will land on it. Otherwise, it will be sent to the zone safe location. | ||
== Boat Route Implementations == | == Boat Route Implementations == | ||
Implementing a boat is achieved via entries to the database and the LUA scripting engine | Implementing a boat is achieved via entries to the database and the LUA scripting engine. | ||
=== Database Settings === | === Database Settings === | ||
The following database tables are used: | The following database tables are used: | ||
* | * spawn2 | ||
* spawngroup | * spawngroup | ||
* spawn_conditions | * spawn_conditions | ||
* grid_entries | |||
* grid | * grid | ||
* | * npc_types.boatid | ||
=== LUA Scripting === | === LUA Scripting === | ||
Line 252: | Line 56: | ||
* event_spawn | * event_spawn | ||
* event_waypoint_arrive | * event_waypoint_arrive | ||
==== Example Scripts ==== | ==== Example Scripts ==== | ||
Line 279: | Line 68: | ||
* https://github.com/EQMacEmu/quests/blob/main/timorous/Maidens_Voyage.lua | * https://github.com/EQMacEmu/quests/blob/main/timorous/Maidens_Voyage.lua | ||
* https://github.com/EQMacEmu/quests/blob/main/timorous/Muckskimmer.lua | * https://github.com/EQMacEmu/quests/blob/main/timorous/Muckskimmer.lua | ||