Get factions fully moved over [skip ci]

This commit is contained in:
Akkadius 2020-03-31 02:49:42 -05:00
parent dae20afcba
commit 63eca22aac
3 changed files with 9 additions and 10 deletions

View File

@ -61,7 +61,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo
} else if(my_primary < 0) { } else if(my_primary < 0) {
strcpy(namebuf, "(Special faction)"); strcpy(namebuf, "(Special faction)");
} else { } else {
if(!database.GetFactionName(my_primary, namebuf, sizeof(namebuf))) if(!content_db.GetFactionName(my_primary, namebuf, sizeof(namebuf)))
strcpy(namebuf, "(Unknown)"); strcpy(namebuf, "(Unknown)");
} }
towho->Message(Chat::White, ".. I am on faction %s (%d)\n", namebuf, my_primary); towho->Message(Chat::White, ".. I am on faction %s (%d)\n", namebuf, my_primary);
@ -170,7 +170,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
towho->Message(Chat::White, "...%s is on special faction %d", mob->GetName(), mob_primary); towho->Message(Chat::White, "...%s is on special faction %d", mob->GetName(), mob_primary);
} else { } else {
char namebuf[256]; char namebuf[256];
if(!database.GetFactionName(mob_primary, namebuf, sizeof(namebuf))) if(!content_db.GetFactionName(mob_primary, namebuf, sizeof(namebuf)))
strcpy(namebuf, "(Unknown)"); strcpy(namebuf, "(Unknown)");
std::list<struct NPCFaction*>::iterator cur,end; std::list<struct NPCFaction*>::iterator cur,end;
cur = faction_list.begin(); cur = faction_list.begin();

View File

@ -6849,7 +6849,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
for (auto iter = item_faction_bonuses.begin(); iter != item_faction_bonuses.end(); ++iter) { for (auto iter = item_faction_bonuses.begin(); iter != item_faction_bonuses.end(); ++iter) {
memset(&faction_buf, 0, sizeof(faction_buf)); memset(&faction_buf, 0, sizeof(faction_buf));
if(!database.GetFactionName((int32)((*iter).first), faction_buf, sizeof(faction_buf))) if(!content_db.GetFactionName((int32)((*iter).first), faction_buf, sizeof(faction_buf)))
strcpy(faction_buf, "Not in DB"); strcpy(faction_buf, "Not in DB");
if((*iter).second > 0) { if((*iter).second > 0) {
@ -7816,7 +7816,7 @@ FACTION_VALUE Client::GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_ra
if(pFaction > 0) if(pFaction > 0)
{ {
//Get the faction data from the database //Get the faction data from the database
if(database.GetFactionData(&fmods, p_class, p_race, p_deity, pFaction)) if(content_db.GetFactionData(&fmods, p_class, p_race, p_deity, pFaction))
{ {
//Get the players current faction with pFaction //Get the players current faction with pFaction
tmpFactionValue = GetCharacterFactionLevel(pFaction); tmpFactionValue = GetCharacterFactionLevel(pFaction);
@ -7867,8 +7867,7 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui
// Find out starting faction for this faction // Find out starting faction for this faction
// It needs to be used to adj max and min personal // It needs to be used to adj max and min personal
// The range is still the same, 1200-3000(4200), but adjusted for base // The range is still the same, 1200-3000(4200), but adjusted for base
database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), content_db.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id[i]);
faction_id[i]);
if (quest) if (quest)
{ {
@ -7917,7 +7916,7 @@ void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class
// Find out starting faction for this faction // Find out starting faction for this faction
// It needs to be used to adj max and min personal // It needs to be used to adj max and min personal
// The range is still the same, 1200-3000(4200), but adjusted for base // The range is still the same, 1200-3000(4200), but adjusted for base
database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), content_db.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(),
faction_id); faction_id);
// Adjust the amount you can go up or down so the resulting range // Adjust the amount you can go up or down so the resulting range
@ -8018,7 +8017,7 @@ return;
int32 Client::GetModCharacterFactionLevel(int32 faction_id) { int32 Client::GetModCharacterFactionLevel(int32 faction_id) {
int32 Modded = GetCharacterFactionLevel(faction_id); int32 Modded = GetCharacterFactionLevel(faction_id);
FactionMods fm; FactionMods fm;
if (database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id)) if (content_db.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id))
{ {
Modded += fm.base + fm.class_mod + fm.race_mod + fm.deity_mod; Modded += fm.base + fm.class_mod + fm.race_mod + fm.deity_mod;
@ -8039,7 +8038,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
// If a faction is involved, get the data. // If a faction is involved, get the data.
if (primaryfaction > 0) { if (primaryfaction > 0) {
if (database.GetFactionData(&fmod, GetClass(), GetFactionRace(), GetDeity(), primaryfaction)) { if (content_db.GetFactionData(&fmod, GetClass(), GetFactionRace(), GetDeity(), primaryfaction)) {
tmpFactionValue = GetCharacterFactionLevel(primaryfaction); tmpFactionValue = GetCharacterFactionLevel(primaryfaction);
lowestvalue = std::min(std::min(tmpFactionValue, fmod.deity_mod), lowestvalue = std::min(std::min(tmpFactionValue, fmod.deity_mod),
std::min(fmod.class_mod, fmod.race_mod)); std::min(fmod.class_mod, fmod.race_mod));

View File

@ -322,7 +322,7 @@ int main(int argc, char** argv) {
} }
LogInfo("Loading npc faction lists"); LogInfo("Loading npc faction lists");
if (!database.LoadNPCFactionLists(hotfix_name)) { if (!content_db.LoadNPCFactionLists(hotfix_name)) {
LogError("Loading npcs faction lists failed!"); LogError("Loading npcs faction lists failed!");
return 1; return 1;
} }