Migrate tradeskills and traps [skip ci]

This commit is contained in:
Akkadius 2020-03-11 03:41:09 -05:00
parent df66c75df2
commit f5cba5ecab
5 changed files with 15 additions and 12 deletions

View File

@ -12150,7 +12150,7 @@ void command_enablerecipe(Client *c, const Seperator *sep)
return;
}
if (recipe_id > 0) {
success = database.EnableRecipe(recipe_id);
success = content_db.EnableRecipe(recipe_id);
if (success) {
c->Message(Chat::White, "Recipe enabled.");
}
@ -12177,7 +12177,7 @@ void command_disablerecipe(Client *c, const Seperator *sep)
return;
}
if (recipe_id > 0) {
success = database.DisableRecipe(recipe_id);
success = content_db.DisableRecipe(recipe_id);
if (success) {
c->Message(Chat::White, "Recipe disabled.");
}

View File

@ -3158,7 +3158,7 @@ bool QuestManager::EnableRecipe(uint32 recipe_id)
{
bool success = false;
if (recipe_id > 0)
success = database.EnableRecipe(recipe_id);
success = content_db.EnableRecipe(recipe_id);
return (success);
}
@ -3166,7 +3166,7 @@ bool QuestManager::DisableRecipe(uint32 recipe_id)
{
bool success = false;
if (recipe_id > 0)
success = database.DisableRecipe(recipe_id);
success = content_db.DisableRecipe(recipe_id);
return (success);
}

View File

@ -336,7 +336,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
}
DBTradeskillRecipe_Struct spec;
if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) {
if (!content_db.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) {
user->MessageString(Chat::Emote,TRADESKILL_NOCOMBINE);
auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp);
@ -489,7 +489,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
"FROM tradeskill_recipe_entries AS tre "
"WHERE tre.componentcount > 0 AND tre.recipe_id = %u",
rac->recipe_id);
auto results = database.QueryDatabase(query);
auto results = content_db.QueryDatabase(query);
if (!results.Success()) {
user->QueuePacket(outapp);
safe_delete(outapp);
@ -706,7 +706,7 @@ EQEmu::skills::SkillType Object::TypeToSkill(uint32 type)
void Client::TradeskillSearchResults(const std::string &query, unsigned long objtype, unsigned long someid) {
auto results = database.QueryDatabase(query);
auto results = content_db.QueryDatabase(query);
if (!results.Success()) {
return;
}
@ -759,7 +759,7 @@ void Client::SendTradeskillDetails(uint32 recipe_id) {
"LEFT JOIN items AS i ON tre.item_id = i.id "
"WHERE tre.componentcount > 0 AND tre.recipe_id = %u",
recipe_id);
auto results = database.QueryDatabase(query);
auto results = content_db.QueryDatabase(query);
if (!results.Success()) {
return;
}
@ -1427,7 +1427,10 @@ void Client::LearnRecipe(uint32 recipeID)
"FROM char_recipe_list WHERE char_id = %u) AS crl "
"ON tr.id = crl.recipe_id "
"WHERE tr.id = %u ;", CharacterID(), recipeID);
auto results = database.QueryDatabase(query);
// TODO: BOUNDARY REWRITE
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}

View File

@ -557,6 +557,6 @@ void Trap::UpdateTrap(bool respawn, bool repopnow)
charid = 0;
if (respawn)
{
database.SetTrapData(this, repopnow);
content_db.SetTrapData(this, repopnow);
}
}

View File

@ -956,7 +956,7 @@ bool Zone::Init(bool iStaticZone) {
}
LogInfo("Loading traps");
if (!database.LoadTraps(short_name, GetInstanceVersion()))
if (!content_db.LoadTraps(short_name, GetInstanceVersion()))
{
LogError("Loading traps failed");
return false;
@ -1042,7 +1042,7 @@ void Zone::ReloadStaticData() {
LogInfo("Reloading traps");
entity_list.RemoveAllTraps();
if (!database.LoadTraps(GetShortName(), GetInstanceVersion()))
if (!content_db.LoadTraps(GetShortName(), GetInstanceVersion()))
{
LogError("Reloading traps failed");
}