mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
[Quest API] Add Recipe Methods (#2393)
- Add $client->GetRecipeMadeCount(recipe_id) to Perl. - Add $client->HasRecipeLearned(recipe_id) to Perl. - Add quest::getrecipemadecount(recipe_id) to Perl. - Add quest::getrecipename(recipe_id) to Perl. - Add quest::hasrecipelearned(recipe_id) to Perl. - Add client:GetRecipeMadeCount(recipe_id) to Lua. - Add client:HasRecipeLearned(recipe_id) to Lua. - Add eq.get_recipe_made_count(recipe_id) to Lua. - Add eq.get_recipe_name(recipe_id) to Lua. - Add eq.has_recipe_learned(recipe_id) to Lua.
This commit is contained in:
@@ -63,6 +63,7 @@ extern volatile bool RunLoops;
|
||||
#include "../common/expedition_lockout_timer.h"
|
||||
#include "cheat_manager.h"
|
||||
|
||||
#include "../common/repositories/char_recipe_list_repository.h"
|
||||
#include "../common/repositories/character_spells_repository.h"
|
||||
#include "../common/repositories/character_disciplines_repository.h"
|
||||
#include "../common/repositories/character_data_repository.h"
|
||||
@@ -11759,3 +11760,31 @@ void Client::SetTrackingID(uint32 entity_id)
|
||||
|
||||
MessageString(Chat::Skills, TRACKING_BEGIN, m->GetCleanName());
|
||||
}
|
||||
|
||||
int Client::GetRecipeMadeCount(uint32 recipe_id)
|
||||
{
|
||||
auto r = CharRecipeListRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("char_id = {} AND recipe_id = {}", CharacterID(), recipe_id)
|
||||
);
|
||||
|
||||
if (!r.empty() && r[0].recipe_id) {
|
||||
return r[0].madecount;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Client::HasRecipeLearned(uint32 recipe_id)
|
||||
{
|
||||
auto r = CharRecipeListRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("char_id = {} AND recipe_id = {}", CharacterID(), recipe_id)
|
||||
);
|
||||
|
||||
if (!r.empty() && r[0].recipe_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user