[Bug Fix] Fix startzone rule to default players to correct zone when not found … (#1669)

* Fix startzone rule to default players to correct zone when not found in database

* Formatting

Co-authored-by: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Natedog2012 2021-11-06 17:22:52 -05:00 committed by GitHub
parent 886f00ed50
commit 5c7972345a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 118 additions and 90 deletions

View File

@ -992,4 +992,21 @@ enum LDoNThemeBits {
TAKBit = 16 TAKBit = 16
}; };
enum StartZoneIndex {
Odus = 0,
Qeynos,
Halas,
Rivervale,
Freeport,
Neriak,
Grobb,
Oggok,
Kaladim,
GreaterFaydark,
Felwithe,
Akanon,
Cabilis,
SharVahl
};
#endif /*COMMON_EQ_CONSTANTS_H*/ #endif /*COMMON_EQ_CONSTANTS_H*/

View File

@ -645,7 +645,12 @@ bool WorldDatabase::GetStartZone(
} }
void WorldDatabase::SetSoFDefaultStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc){ void WorldDatabase::SetSoFDefaultStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc){
if (in_cc->start_zone == RuleI(World, TutorialZoneID)) { int sof_start_zone_id = RuleI(World, SoFStartZoneID);
if (sof_start_zone_id > 0) {
in_pp->zone_id = sof_start_zone_id;
in_cc->start_zone = in_pp->zone_id;
}
else if (in_cc->start_zone == RuleI(World, TutorialZoneID)) {
in_pp->zone_id = in_cc->start_zone; in_pp->zone_id = in_cc->start_zone;
} }
else { else {
@ -653,108 +658,114 @@ void WorldDatabase::SetSoFDefaultStartZone(PlayerProfile_Struct* in_pp, CharCrea
in_pp->y = in_pp->binds[0].y = -20.0f; in_pp->y = in_pp->binds[0].y = -20.0f;
in_pp->z = in_pp->binds[0].z = 0.79f; in_pp->z = in_pp->binds[0].z = 0.79f;
in_pp->heading = in_pp->binds[0].heading = 0.0f; in_pp->heading = in_pp->binds[0].heading = 0.0f;
in_pp->zone_id = in_pp->binds[0].zone_id = 394; // Crescent Reach. in_pp->zone_id = in_pp->binds[0].zone_id = Zones::CRESCENT; // Crescent Reach.
} }
} }
void WorldDatabase::SetTitaniumDefaultStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc) void WorldDatabase::SetTitaniumDefaultStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc)
{ {
int titanium_start_zone_id = RuleI(World, TitaniumStartZoneID);
if (titanium_start_zone_id > 0) {
in_pp->zone_id = titanium_start_zone_id;
in_pp->binds[0].zone_id = titanium_start_zone_id;
} else {
switch (in_cc->start_zone) switch (in_cc->start_zone)
{ {
case 0: case StartZoneIndex::Odus:
{ {
if (in_cc->deity == 203) // Cazic-Thule Erudites go to Paineel if (in_cc->deity == EQ::deity::DeityCazicThule) // Cazic-Thule Erudites go to Paineel
{ {
in_pp->zone_id = 75; // paineel in_pp->zone_id = Zones::PAINEEL; // paineel
in_pp->binds[0].zone_id = 75; in_pp->binds[0].zone_id = Zones::PAINEEL;
} }
else else
{ {
in_pp->zone_id = 24; // erudnext in_pp->zone_id = Zones::ERUDNEXT; // erudnext
in_pp->binds[0].zone_id = 38; // tox in_pp->binds[0].zone_id = Zones::TOX; // tox
} }
break; break;
} }
case 1: case StartZoneIndex::Qeynos:
{ {
in_pp->zone_id = 2; // qeynos2 in_pp->zone_id = Zones::QEYNOS2; // qeynos2
in_pp->binds[0].zone_id = 2; // qeynos2 in_pp->binds[0].zone_id = Zones::QEYNOS2; // qeynos2
break; break;
} }
case 2: case StartZoneIndex::Halas:
{ {
in_pp->zone_id = 29; // halas in_pp->zone_id = Zones::HALAS; // halas
in_pp->binds[0].zone_id = 30; // everfrost in_pp->binds[0].zone_id = Zones::EVERFROST; // everfrost
break; break;
} }
case 3: case StartZoneIndex::Rivervale:
{ {
in_pp->zone_id = 19; // rivervale in_pp->zone_id = Zones::RIVERVALE; // rivervale
in_pp->binds[0].zone_id = 20; // kithicor in_pp->binds[0].zone_id = Zones::KITHICOR; // kithicor
break; break;
} }
case 4: case StartZoneIndex::Freeport:
{ {
in_pp->zone_id = 9; // freportw in_pp->zone_id = Zones::FREPORTW; // freportw
in_pp->binds[0].zone_id = 9; // freportw in_pp->binds[0].zone_id = Zones::FREPORTW; // freportw
break; break;
} }
case 5: case StartZoneIndex::Neriak:
{ {
in_pp->zone_id = 40; // neriaka in_pp->zone_id = Zones::NERIAKA; // neriaka
in_pp->binds[0].zone_id = 25; // nektulos in_pp->binds[0].zone_id = Zones::NEKTULOS; // nektulos
break; break;
} }
case 6: case StartZoneIndex::Grobb:
{ {
in_pp->zone_id = 52; // gukta in_pp->zone_id = Zones::GROBB; // grobb
in_pp->binds[0].zone_id = 46; // innothule in_pp->binds[0].zone_id = Zones::INNOTHULE; // innothule
break; break;
} }
case 7: case StartZoneIndex::Oggok:
{ {
in_pp->zone_id = 49; // oggok in_pp->zone_id = Zones::OGGOK; // oggok
in_pp->binds[0].zone_id = 47; // feerrott in_pp->binds[0].zone_id = Zones::FEERROTT; // feerrott
break; break;
} }
case 8: case StartZoneIndex::Kaladim:
{ {
in_pp->zone_id = 60; // kaladima in_pp->zone_id = Zones::KALADIMA; // kaladima
in_pp->binds[0].zone_id = 68; // butcher in_pp->binds[0].zone_id = Zones::BUTCHER; // butcher
break; break;
} }
case 9: case StartZoneIndex::GreaterFaydark:
{ {
in_pp->zone_id = 54; // gfaydark in_pp->zone_id = Zones::GFAYDARK; // gfaydark
in_pp->binds[0].zone_id = 54; // gfaydark in_pp->binds[0].zone_id = Zones::GFAYDARK; // gfaydark
break; break;
} }
case 10: case StartZoneIndex::Felwithe:
{ {
in_pp->zone_id = 61; // felwithea in_pp->zone_id = Zones::FELWITHEA; // felwithea
in_pp->binds[0].zone_id = 54; // gfaydark in_pp->binds[0].zone_id = Zones::GFAYDARK; // gfaydark
break; break;
} }
case 11: case StartZoneIndex::Akanon:
{ {
in_pp->zone_id = 55; // akanon in_pp->zone_id = Zones::AKANON; // akanon
in_pp->binds[0].zone_id = 56; // steamfont in_pp->binds[0].zone_id = Zones::STEAMFONT; // steamfont
break; break;
} }
case 12: case StartZoneIndex::Cabilis:
{ {
in_pp->zone_id = 82; // cabwest in_pp->zone_id = Zones::CABWEST; // cabwest
in_pp->binds[0].zone_id = 78; // fieldofbone in_pp->binds[0].zone_id = Zones::FIELDOFBONE; // fieldofbone
break; break;
} }
case 13: case StartZoneIndex::SharVahl:
{ {
in_pp->zone_id = 155; // sharvahl in_pp->zone_id = Zones::SHARVAHL; // sharvahl
in_pp->binds[0].zone_id = 155; // sharvahl in_pp->binds[0].zone_id = Zones::SHARVAHL; // sharvahl
break; break;
} }
} }
} }
}
void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) { void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
rl.clear(); rl.clear();