mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Commands] Cleanup #disablerecipe Command. (#1816)
- Cleanup message and logic.
This commit is contained in:
parent
8b5b19ae2c
commit
1a2897c423
@ -152,7 +152,7 @@ int command_init(void)
|
|||||||
command_add("depopzone", "- Depop the zone", AccountStatus::GMAdmin, command_depopzone) ||
|
command_add("depopzone", "- Depop the zone", AccountStatus::GMAdmin, command_depopzone) ||
|
||||||
command_add("devtools", "- Manages devtools", AccountStatus::GMMgmt, command_devtools) ||
|
command_add("devtools", "- Manages devtools", AccountStatus::GMMgmt, command_devtools) ||
|
||||||
command_add("details", "- Change the details of your target (Drakkin Only)", AccountStatus::QuestTroupe, command_details) ||
|
command_add("details", "- Change the details of your target (Drakkin Only)", AccountStatus::QuestTroupe, command_details) ||
|
||||||
command_add("disablerecipe", "[recipe_id] - Disables a recipe using the recipe id.", AccountStatus::QuestTroupe, command_disablerecipe) ||
|
command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) ||
|
||||||
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) ||
|
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) ||
|
||||||
command_add("distance", "- Reports the distance between you and your target.", AccountStatus::QuestTroupe, command_distance) ||
|
command_add("distance", "- Reports the distance between you and your target.", AccountStatus::QuestTroupe, command_distance) ||
|
||||||
command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) ||
|
command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) ||
|
||||||
|
|||||||
@ -2,28 +2,28 @@
|
|||||||
|
|
||||||
void command_disablerecipe(Client *c, const Seperator *sep)
|
void command_disablerecipe(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
uint32 recipe_id = 0;
|
int arguments = sep->argnum;
|
||||||
bool success = false;
|
if (!arguments || !sep->IsNumber(1)) {
|
||||||
if (c) {
|
c->Message(Chat::White, "Usage: #disablerecipe [Recipe ID]");
|
||||||
if (sep->argnum == 1) {
|
return;
|
||||||
recipe_id = atoi(sep->arg[1]);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Invalid number of arguments.\nUsage: #disablerecipe recipe_id");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (recipe_id > 0) {
|
|
||||||
success = content_db.DisableRecipe(recipe_id);
|
|
||||||
if (success) {
|
|
||||||
c->Message(Chat::White, "Recipe disabled.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Recipe not disabled.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Invalid recipe id.\nUsage: #disablerecipe recipe_id");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
auto recipe_id = std::stoul(sep->arg[1]);
|
||||||
|
if (!recipe_id) {
|
||||||
|
c->Message(Chat::White, "Usage: #disablerecipe [Recipe ID]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Recipe ID {} {} disabled.",
|
||||||
|
recipe_id,
|
||||||
|
(
|
||||||
|
content_db.DisableRecipe(recipe_id) ?
|
||||||
|
"successfully" :
|
||||||
|
"failed to be"
|
||||||
|
)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user