mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 09:26:36 +00:00
Added expansions support
This commit is contained in:
@@ -637,13 +637,17 @@ bool AdventureManager::LoadAdventureTemplates()
|
||||
"assa_y, assa_z, assa_h, text, duration, zone_in_time, win_points, lose_points, "
|
||||
"theme, zone_in_zone_id, zone_in_x, zone_in_y, zone_in_object_id, dest_x, dest_y, "
|
||||
"dest_z, dest_h, graveyard_zone_id, graveyard_x, graveyard_y, graveyard_z, "
|
||||
"graveyard_radius FROM adventure_template";
|
||||
"graveyard_radius, expansions FROM adventure_template";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int32 expansions = atoi(row[32]);
|
||||
if (RuleI(World, ExpansionSettings) & expansions != expansions) {
|
||||
continue;
|
||||
}
|
||||
auto aTemplate = new AdventureTemplate;
|
||||
aTemplate->id = atoi(row[0]);
|
||||
strcpy(aTemplate->zone, row[1]);
|
||||
@@ -678,7 +682,7 @@ bool AdventureManager::LoadAdventureTemplates()
|
||||
aTemplate->graveyard_z = atof(row[30]);
|
||||
aTemplate->graveyard_radius = atof(row[31]);
|
||||
adventure_templates[aTemplate->id] = aTemplate;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-4
@@ -182,8 +182,8 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
|
||||
}
|
||||
|
||||
if (has_home == 0 || has_bind == 0) {
|
||||
cquery = StringFormat("SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i",
|
||||
cse->Class, cse->Deity, cse->Race);
|
||||
cquery = StringFormat("SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i AND %i & expansions = expansions",
|
||||
cse->Class, cse->Deity, cse->Race, RuleI(World, ExpansionSettings));
|
||||
auto results_bind = database.QueryDatabase(cquery);
|
||||
for (auto row_d = results_bind.begin(); row_d != results_bind.end(); ++row_d) {
|
||||
/* If a bind_id is specified, make them start there */
|
||||
@@ -358,8 +358,8 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
||||
in_pp->binds[0].x = in_pp->binds[0].y = in_pp->binds[0].z = in_pp->binds[0].zoneId = in_pp->binds[0].instance_id = 0;
|
||||
// see if we have an entry for start_zone. We can support both titanium & SOF+ by having two entries per class/race/deity combo with different zone_ids
|
||||
std::string query = StringFormat("SELECT x, y, z, heading, start_zone, bind_id, bind_x, bind_y, bind_z FROM start_zones WHERE zone_id = %i "
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i",
|
||||
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race);
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i AND %i & expansions = expansions",
|
||||
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race, RuleI(World, ExpansionSettings));
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user