#37 Fix north qeynos temple of life, ForceZone transport_type added to transporters table see comment for table updates.

ALTER TABLE transporters
MODIFY COLUMN transport_type ENUM('Zone', 'Location', 'Generic Transport', 'Flight', 'ForceZone')
NOT NULL DEFAULT 'Zone';

This provides the north qeynos teleporters for Temple of Life to work as zone points (with code update):

update transporters set transport_type='ForceZone' where id=43;
update transporters set transport_type='ForceZone' where id=44;
This commit is contained in:
Emagi 2025-06-20 09:17:25 -04:00
parent 08204186c8
commit 6b22386ef6
6 changed files with 81 additions and 46 deletions

View File

@ -158,6 +158,7 @@ struct LocationTransportDestination{
int32 cost;
int32 faction_id;
int32 faction_value;
bool force_zone;
};
struct LottoPlayer {
@ -348,6 +349,7 @@ struct GlobalLoot {
#define TRANSPORT_TYPE_ZONE 1
#define TRANSPORT_TYPE_GENERIC 2
#define TRANSPORT_TYPE_FLIGHT 3
#define TRANSPORT_TYPE_FORCEZONE 4
// structs MUST start with class_id and race_id, in that order as int8's

View File

@ -5615,8 +5615,8 @@ void WorldDatabase::LoadTransporters(ZoneServer* zone){
zone->AddTransporter(atoul(row[0]), TRANSPORT_TYPE_ZONE, name, message, atoul(row[4]), atof(row[5]), atof(row[6]), atof(row[7]), atof(row[8]), atoul(row[14]), atoul(row[15]), atoi(row[16]), atoi(row[17]), atoul(row[18]), atoi(row[19]), atoul(row[20]), atoul(row[21]), atoul(row[22]), atoul(row[23]), atoul(row[24]), atoul(row[25]), atoul(row[26]), atoul(row[27]), atoul(row[28]), atoul(row[29]), atoul(row[30]), atoul(row[31]));
else if (row[1] && strcmp(row[1], "Flight") == 0)
zone->AddTransporter(atoul(row[0]), TRANSPORT_TYPE_FLIGHT, name, message, atoul(row[4]), atof(row[5]), atof(row[6]), atof(row[7]), atof(row[8]), atoul(row[14]), atoul(row[15]), atoi(row[16]), atoi(row[17]), atoul(row[18]), atoi(row[19]), atoul(row[20]), atoul(row[21]), atoul(row[22]), atoul(row[23]), atoul(row[24]), atoul(row[25]), atoul(row[26]), atoul(row[27]), atoul(row[28]), atoul(row[29]), atoul(row[30]), atoul(row[31]));
else if(row[1] && strcmp(row[1], "Location") == 0)
zone->AddLocationTransporter(atoul(row[9]), message, atof(row[10]), atof(row[11]), atof(row[12]), atof(row[13]), atoul(row[4]), atof(row[5]), atof(row[6]), atof(row[7]), atof(row[8]), atoul(row[14]), atoul(row[15]));
else if(row[1] && (strcmp(row[1], "Location") == 0 || strcmp(row[1], "ForceZone") == 0))
zone->AddLocationTransporter(atoul(row[9]), message, atof(row[10]), atof(row[11]), atof(row[12]), atof(row[13]), atoul(row[4]), atof(row[5]), atof(row[6]), atof(row[7]), atof(row[8]), atoul(row[14]), atoul(row[15]), (strcmp(row[1], "ForceZone") == 0) ? true : false);
else
zone->AddTransporter(atoul(row[0]), TRANSPORT_TYPE_GENERIC, "", message, atoul(row[4]), atof(row[5]), atof(row[6]), atof(row[7]), atof(row[8]), atoul(row[14]), atoul(row[15]), atoi(row[16]), atoi(row[17]), atoul(row[18]), atoi(row[19]), atoul(row[20]), atoul(row[21]), atoul(row[22]), atoul(row[23]), atoul(row[24]), atoul(row[25]), atoul(row[26]), atoul(row[27]), atoul(row[28]), atoul(row[29]), atoul(row[30]), atoul(row[31]));
total++;

View File

@ -4891,6 +4891,22 @@ bool Client::GotoSpawn(const char* search_name, bool forceTarget) {
return true;
}
void Client::MoveInZone(float x, float y, float z, float h) {
SetReloadingZone(true);
SetZoningCoords(x,y,z,h);
PacketStruct* packet = configReader.getStruct("WS_TeleportWithinZone", GetVersion());
if (packet)
{
packet->setDataByName("x", x);
packet->setDataByName("y", y);
packet->setDataByName("z", z);
QueuePacket(packet->serialize());
safe_delete(packet);
}
}
bool Client::CheckZoneAccess(const char* zoneName) {
LogWrite(CCLIENT__DEBUG, 0, "Client", "Zone access check for %s (%u), client: %u", zoneName, database.GetZoneID(zoneName), GetVersion());
@ -10154,7 +10170,7 @@ void Client::ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destin
transport_list.push_back(destination);
}
if (transport_list.size() == 0 && destination) {
if (destination->destination_zone_id == 0 || destination->destination_zone_id == GetCurrentZone()->GetZoneID()) {
if (destination->destination_zone_id == 0 || (destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type != TRANSPORT_TYPE_FORCEZONE)) {
if (destination->type == TRANSPORT_TYPE_FLIGHT)
SendFlightAutoMount(destination->flight_path_id, destination->mount_id, destination->mount_red_color, destination->mount_green_color, destination->mount_blue_color);
@ -10166,7 +10182,10 @@ void Client::ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destin
}
}
else {
if (destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type == TRANSPORT_TYPE_FORCEZONE) {
MoveInZone(destination->destination_x, destination->destination_y, destination->destination_z, destination->destination_heading);
}
else {
// determine if this is an instanced zone that already exists
ZoneChangeDetails zone_details;
bool foundZone = world.GetGroupManager()->IdentifyMemberInGroupOrRaid(&zone_details, this, destination->destination_zone_id);
@ -10191,6 +10210,7 @@ void Client::ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destin
}
}
}
}
if (destination->message.length() > 0)
SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str());
}
@ -10317,7 +10337,7 @@ void Client::ProcessTeleportLocation(EQApplicationPacket* app) {
SimpleMessage(CHANNEL_COLOR_RED, "Error processing transport.");
else {
if (cost == 0 || player->RemoveCoins(cost)) {
if (destination->destination_zone_id == 0 || destination->destination_zone_id == GetCurrentZone()->GetZoneID()) {
if (destination->destination_zone_id == 0 || (destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type != TRANSPORT_TYPE_FORCEZONE)) {
if (destination->type == TRANSPORT_TYPE_FLIGHT)
SendFlightAutoMount(destination->flight_path_id, destination->mount_id, destination->mount_red_color, destination->mount_green_color, destination->mount_blue_color);
@ -10328,6 +10348,10 @@ void Client::ProcessTeleportLocation(EQApplicationPacket* app) {
QueuePacket(outapp);
}
}
else {
if((destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type == TRANSPORT_TYPE_FORCEZONE)) {
MoveInZone(destination->destination_x, destination->destination_y, destination->destination_z, destination->destination_heading);
}
else {
GetPlayer()->SetX(destination->destination_x);
GetPlayer()->SetY(destination->destination_y);
@ -10351,6 +10375,7 @@ void Client::ProcessTeleportLocation(EQApplicationPacket* app) {
}
}
}
}
if (destination->message.length() > 0)
SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str());
}

View File

@ -292,6 +292,8 @@ public:
bool IdentifyInstance(ZoneChangeDetails* zone_details, int32 zoneID);
bool TryZoneInstance(int32 zoneID, bool zone_coords_valid = false);
bool GotoSpawn(const char* search_name, bool forceTarget = false);
void MoveInZone(float x, float y, float z, float h);
void DisplayDeadWindow();
void HandlePlayerRevive(int32 point_id);
void Bank(Spawn* banker, bool cancel = false);

View File

@ -3389,11 +3389,15 @@ void ZoneServer::CheckTransporters(Client* client) {
for (itr = transporter_locations.begin(); itr != transporter_locations.end(); itr++) {
loc = *itr;
if(client->GetPlayer()->GetDistance(loc->trigger_x, loc->trigger_y, loc->trigger_z) <= loc->trigger_radius){
if(loc->destination_zone_id == 0 || loc->destination_zone_id == GetZoneID()){
if(loc->destination_zone_id == 0 || (loc->destination_zone_id == GetZoneID() && !loc->force_zone)){
EQ2Packet* packet = client->GetPlayer()->Move(loc->destination_x, loc->destination_y, loc->destination_z, client->GetVersion());
if(packet)
client->QueuePacket(packet);
}
else{
if(loc->force_zone && loc->destination_zone_id == GetZoneID()) {
client->MoveInZone(loc->destination_x, loc->destination_y, loc->destination_z, loc->destination_heading);
}
else {
ZoneChangeDetails zone_details;
bool foundZone = zone_list.GetZone(&zone_details, loc->destination_zone_id);
@ -3405,6 +3409,7 @@ void ZoneServer::CheckTransporters(Client* client) {
client->Zone(&zone_details, (ZoneServer*)zone_details.zonePtr);
}
}
}
break;
}
}
@ -8574,7 +8579,7 @@ LootTable* ZoneServer::GetLootTable(int32 table_id){
return loot_tables[table_id];
}
void ZoneServer::AddLocationTransporter(int32 zone_id, string message, float trigger_x, float trigger_y, float trigger_z, float trigger_radius, int32 destination_zone_id, float destination_x, float destination_y, float destination_z, float destination_heading, int32 cost, int32 unique_id){
void ZoneServer::AddLocationTransporter(int32 zone_id, string message, float trigger_x, float trigger_y, float trigger_z, float trigger_radius, int32 destination_zone_id, float destination_x, float destination_y, float destination_z, float destination_heading, int32 cost, int32 unique_id, bool force_zone){
LocationTransportDestination* loc = new LocationTransportDestination;
loc->message = message;
loc->trigger_x = trigger_x;
@ -8588,6 +8593,7 @@ void ZoneServer::AddLocationTransporter(int32 zone_id, string message, float tri
loc->destination_heading = destination_heading;
loc->cost = cost;
loc->unique_id = unique_id;
loc->force_zone = force_zone;
MTransporters.lock();
if(location_transporters.count(zone_id) == 0)
location_transporters[zone_id] = new MutexList<LocationTransportDestination*>();

View File

@ -1149,7 +1149,7 @@ public:
LootTable* GetLootTable(int32 table_id);
/* Transporters */
void AddLocationTransporter(int32 zone_id, string message, float trigger_x, float trigger_y, float trigger_z, float trigger_radius, int32 destination_zone_id, float destination_x, float destination_y, float destination_z, float destination_heading, int32 cost, int32 unique_id);
void AddLocationTransporter(int32 zone_id, string message, float trigger_x, float trigger_y, float trigger_z, float trigger_radius, int32 destination_zone_id, float destination_x, float destination_y, float destination_z, float destination_heading, int32 cost, int32 unique_id, bool force_zone);
void AddTransporter(int32 transport_id, int8 type, string name, string message, int32 destination_zone_id, float destination_x, float destination_y, float destination_z, float destination_heading,
int32 cost, int32 unique_id, int8 min_level, int8 max_level, int32 quest_req, int16 quest_step_req, int32 quest_complete, int32 map_x, int32 map_y, int32 expansion_flag, int32 holiday_flag, int32 min_client_version,
int32 max_client_version, int32 flight_path_id, int16 mount_id, int8 mount_red_color, int8 mount_green_color, int8 mount_blue_color);