mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Changed enable/disable recipe to confirm change made.
This commit is contained in:
parent
466f541798
commit
37cacd27b1
@ -1,5 +1,8 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 12/14/2013 ==
|
||||||
|
JJ: Changed enable/disable recipe to confirm change made.
|
||||||
|
|
||||||
== 12/13/2013 ==
|
== 12/13/2013 ==
|
||||||
Kayen: Implemented additional functionality for SE_CurrentHP utilizing base2 values. (ie limit to body type)
|
Kayen: Implemented additional functionality for SE_CurrentHP utilizing base2 values. (ie limit to body type)
|
||||||
Kayen: Implemented SE_MitigateMeleeDamageSP (Partial Melee Rune that only is lowered if melee hits are over X amount of damage)
|
Kayen: Implemented SE_MitigateMeleeDamageSP (Partial Melee Rune that only is lowered if melee hits are over X amount of damage)
|
||||||
|
|||||||
@ -11462,6 +11462,7 @@ void command_questerrors(Client *c, const Seperator *sep)
|
|||||||
void command_enablerecipe(Client *c, const Seperator *sep)
|
void command_enablerecipe(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
uint32 recipe_id = 0;
|
uint32 recipe_id = 0;
|
||||||
|
bool success = false;
|
||||||
if (c) {
|
if (c) {
|
||||||
if (sep->argnum == 1) {
|
if (sep->argnum == 1) {
|
||||||
recipe_id = atoi(sep->arg[1]);
|
recipe_id = atoi(sep->arg[1]);
|
||||||
@ -11471,9 +11472,14 @@ void command_enablerecipe(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (recipe_id > 0) {
|
if (recipe_id > 0) {
|
||||||
database.EnableRecipe(recipe_id);
|
success = database.EnableRecipe(recipe_id);
|
||||||
|
if (success) {
|
||||||
c->Message(0, "Recipe enabled.");
|
c->Message(0, "Recipe enabled.");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
c->Message(0, "Recipe not enabled.");
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->Message(0, "Invalid recipe id.\nUsage: #enablerecipe recipe_id");
|
c->Message(0, "Invalid recipe id.\nUsage: #enablerecipe recipe_id");
|
||||||
}
|
}
|
||||||
@ -11483,6 +11489,7 @@ void command_enablerecipe(Client *c, const Seperator *sep)
|
|||||||
void command_disablerecipe(Client *c, const Seperator *sep)
|
void command_disablerecipe(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
uint32 recipe_id = 0;
|
uint32 recipe_id = 0;
|
||||||
|
bool success = false;
|
||||||
if (c) {
|
if (c) {
|
||||||
if (sep->argnum == 1) {
|
if (sep->argnum == 1) {
|
||||||
recipe_id = atoi(sep->arg[1]);
|
recipe_id = atoi(sep->arg[1]);
|
||||||
@ -11492,9 +11499,14 @@ void command_disablerecipe(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (recipe_id > 0) {
|
if (recipe_id > 0) {
|
||||||
database.DisableRecipe(recipe_id);
|
success = database.DisableRecipe(recipe_id);
|
||||||
|
if (success) {
|
||||||
c->Message(0, "Recipe disabled.");
|
c->Message(0, "Recipe disabled.");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
c->Message(0, "Recipe not disabled.");
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->Message(0, "Invalid recipe id.\nUsage: #disablerecipe recipe_id");
|
c->Message(0, "Invalid recipe id.\nUsage: #disablerecipe recipe_id");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3317,32 +3317,40 @@ XS(XS__enablerecipe);
|
|||||||
XS(XS__enablerecipe)
|
XS(XS__enablerecipe)
|
||||||
{
|
{
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
if (items != 1) {
|
if (items != 1) {
|
||||||
Perl_croak(aTHX_ "Usage: enablerecipe(recipe_id)");
|
Perl_croak(aTHX_ "Usage: enablerecipe(recipe_id)");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint32 recipe_id = (uint32)SvIV(ST(0));
|
uint32 recipe_id = (uint32)SvIV(ST(0));
|
||||||
quest_manager.EnableRecipe(recipe_id);
|
success = quest_manager.EnableRecipe(recipe_id);
|
||||||
|
}
|
||||||
|
if (!success) {
|
||||||
|
XSRETURN_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
XS(XS__disablerecipe);
|
XS(XS__disablerecipe);
|
||||||
XS(XS__disablerecipe)
|
XS(XS__disablerecipe)
|
||||||
{
|
{
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
if (items != 1) {
|
if (items != 1) {
|
||||||
Perl_croak(aTHX_ "Usage: disablerecipe(recipe_id)");
|
Perl_croak(aTHX_ "Usage: disablerecipe(recipe_id)");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint32 recipe_id = (uint32)SvIV(ST(0));
|
uint32 recipe_id = (uint32)SvIV(ST(0));
|
||||||
quest_manager.DisableRecipe(recipe_id);
|
success = quest_manager.DisableRecipe(recipe_id);
|
||||||
|
}
|
||||||
|
if (!success) {
|
||||||
|
XSRETURN_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1021,12 +1021,12 @@ void lua_clear_opcode(int op) {
|
|||||||
ClearMappedOpcode(static_cast<EmuOpcode>(op));
|
ClearMappedOpcode(static_cast<EmuOpcode>(op));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_enable_recipe(uint32 recipe_id) {
|
bool lua_enable_recipe(uint32 recipe_id) {
|
||||||
quest_manager.EnableRecipe(recipe_id);
|
return quest_manager.EnableRecipe(recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_disable_recipe(uint32 recipe_id) {
|
bool lua_disable_recipe(uint32 recipe_id) {
|
||||||
quest_manager.DisableRecipe(recipe_id);
|
return quest_manager.DisableRecipe(recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_general() {
|
luabind::scope lua_register_general() {
|
||||||
|
|||||||
@ -2901,16 +2901,20 @@ void QuestManager::CrossZoneMessagePlayerByName(uint32 Type, const char *CharNam
|
|||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::EnableRecipe(uint32 recipe_id)
|
bool QuestManager::EnableRecipe(uint32 recipe_id)
|
||||||
{
|
{
|
||||||
|
bool success = false;
|
||||||
if (recipe_id > 0)
|
if (recipe_id > 0)
|
||||||
database.EnableRecipe(recipe_id);
|
success = database.EnableRecipe(recipe_id);
|
||||||
|
return (success);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::DisableRecipe(uint32 recipe_id)
|
bool QuestManager::DisableRecipe(uint32 recipe_id)
|
||||||
{
|
{
|
||||||
|
bool success = false;
|
||||||
if (recipe_id > 0)
|
if (recipe_id > 0)
|
||||||
database.DisableRecipe(recipe_id);
|
success = database.DisableRecipe(recipe_id);
|
||||||
|
return (success);
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *QuestManager::GetInitiator() const {
|
Client *QuestManager::GetInitiator() const {
|
||||||
|
|||||||
@ -231,8 +231,8 @@ public:
|
|||||||
void CrossZoneSignalPlayerByCharID(int charid, uint32 data);
|
void CrossZoneSignalPlayerByCharID(int charid, uint32 data);
|
||||||
void CrossZoneSignalPlayerByName(const char *CharName, uint32 data);
|
void CrossZoneSignalPlayerByName(const char *CharName, uint32 data);
|
||||||
void CrossZoneMessagePlayerByName(uint32 Type, const char *CharName, const char *Message);
|
void CrossZoneMessagePlayerByName(uint32 Type, const char *CharName, const char *Message);
|
||||||
void EnableRecipe(uint32 recipe_id);
|
bool EnableRecipe(uint32 recipe_id);
|
||||||
void DisableRecipe(uint32 recipe_id);
|
bool DisableRecipe(uint32 recipe_id);
|
||||||
|
|
||||||
Client *GetInitiator() const;
|
Client *GetInitiator() const;
|
||||||
NPC *GetNPC() const;
|
NPC *GetNPC() const;
|
||||||
|
|||||||
@ -1600,30 +1600,35 @@ bool Client::CanIncreaseTradeskill(SkillUseTypes tradeskill) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDatabase::EnableRecipe(uint32 recipe_id)
|
bool ZoneDatabase::EnableRecipe(uint32 recipe_id)
|
||||||
{
|
{
|
||||||
char *query = 0;
|
char *query = 0;
|
||||||
uint32 qlen;
|
uint32 qlen;
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
|
uint32 affected_rows = 0;
|
||||||
|
|
||||||
qlen = MakeAnyLenString(&query, "UPDATE tradeskill_recipe SET enabled = 1 WHERE id = %u;", recipe_id);
|
qlen = MakeAnyLenString(&query, "UPDATE tradeskill_recipe SET enabled = 1 WHERE id = %u;", recipe_id);
|
||||||
|
|
||||||
if (!RunQuery(query, qlen, errbuf)) {
|
if (!RunQuery(query, qlen, errbuf, 0, &affected_rows)) {
|
||||||
LogFile->write(EQEMuLog::Error, "Error in EnableRecipe query '%s': %s", query, errbuf);
|
LogFile->write(EQEMuLog::Error, "Error in EnableRecipe query '%s': %s", query, errbuf);
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
|
|
||||||
|
return (affected_rows > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDatabase::DisableRecipe(uint32 recipe_id)
|
bool ZoneDatabase::DisableRecipe(uint32 recipe_id)
|
||||||
{
|
{
|
||||||
char *query = 0;
|
char *query = 0;
|
||||||
uint32 qlen;
|
uint32 qlen;
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
|
uint32 affected_rows = 0;
|
||||||
|
|
||||||
qlen = MakeAnyLenString(&query, "UPDATE tradeskill_recipe SET enabled = 0 WHERE id = %u;", recipe_id);
|
qlen = MakeAnyLenString(&query, "UPDATE tradeskill_recipe SET enabled = 0 WHERE id = %u;", recipe_id);
|
||||||
|
|
||||||
if (!RunQuery(query, qlen, errbuf)) {
|
if (!RunQuery(query, qlen, errbuf, 0, &affected_rows)) {
|
||||||
LogFile->write(EQEMuLog::Error, "Error in DisableRecipe query '%s': %s", query, errbuf);
|
LogFile->write(EQEMuLog::Error, "Error in DisableRecipe query '%s': %s", query, errbuf);
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
|
return (affected_rows > 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -385,8 +385,8 @@ public:
|
|||||||
uint32 GetZoneForage(uint32 ZoneID, uint8 skill); /* for foraging */
|
uint32 GetZoneForage(uint32 ZoneID, uint8 skill); /* for foraging */
|
||||||
uint32 GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, uint8 &npc_chance);
|
uint32 GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, uint8 &npc_chance);
|
||||||
void UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint32 madecount);
|
void UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint32 madecount);
|
||||||
void EnableRecipe(uint32 recipe_id);
|
bool EnableRecipe(uint32 recipe_id);
|
||||||
void DisableRecipe(uint32 recipe_id);
|
bool DisableRecipe(uint32 recipe_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tribute
|
* Tribute
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user