diff options
author | panikon <panikon@zoho.com> | 2014-05-10 05:31:49 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-05-10 05:31:49 -0300 |
commit | 90c8d73473f77422a2bd755951264f71514609ff (patch) | |
tree | 282fa47dc4ccea0300358fb2b507315e379358a7 /src/map/npc.c | |
parent | 508d9cb5d10df9662ea9fb06aa4295ab7f282bc8 (diff) | |
download | hercules-90c8d73473f77422a2bd755951264f71514609ff.tar.gz hercules-90c8d73473f77422a2bd755951264f71514609ff.tar.bz2 hercules-90c8d73473f77422a2bd755951264f71514609ff.tar.xz hercules-90c8d73473f77422a2bd755951264f71514609ff.zip |
Optimized THQS_TTShop.txt and corrected a minor mistake
Added npc_market_data_db to inter-server.conf
Added shop message to messages.conf
Fixed small typo in clif_GM_kickack
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 5596b8e23..8e5854dbf 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1426,8 +1426,7 @@ void npc_market_fromsql(void) { int itemid; int amount; - /* TODO inter-server.conf npc_market_data */ - if ( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `name`, `itemid`, `amount` FROM `npc_market_data`") + if ( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `name`, `itemid`, `amount` FROM `%s`", map->npc_market_data_db) || SQL_ERROR == SQL->StmtExecute(stmt) ) { SqlStmt_ShowDebug(stmt); @@ -1474,20 +1473,20 @@ void npc_market_fromsql(void) { * Saves persistent NPC Market Data into SQL **/ void npc_market_tosql(struct npc_data *nd, unsigned short index) { - /* TODO inter-server.conf npc_market_data */ - if( SQL_ERROR == SQL->Query(map->mysql_handle, "REPLACE INTO `npc_market_data` VALUES ('%s','%d','%d')", nd->exname, nd->u.scr.shop->item[index].nameid, nd->u.scr.shop->item[index].qty) ) + if( SQL_ERROR == SQL->Query(map->mysql_handle, "REPLACE INTO `%s` VALUES ('%s','%d','%d')", + map->npc_market_data_db, nd->exname, nd->u.scr.shop->item[index].nameid, nd->u.scr.shop->item[index].qty) ) Sql_ShowDebug(map->mysql_handle); } /** * Removes persistent NPC Market Data from SQL */ void npc_market_delfromsql_sub(const char *npcname, unsigned short index) { - /* TODO inter-server.conf npc_market_data */ if( index == USHRT_MAX ) { - if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `npc_market_data` WHERE `name`='%s'", npcname) ) + if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `name`='%s'", map->npc_market_data_db, npcname) ) Sql_ShowDebug(map->mysql_handle); } else { - if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `npc_market_data` WHERE `name`='%s' AND `itemid`='%d' LIMIT 1", npcname, index) ) + if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `name`='%s' AND `itemid`='%d' LIMIT 1", + map->npc_market_data_db, npcname, index) ) Sql_ShowDebug(map->mysql_handle); } } @@ -1520,7 +1519,7 @@ bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) { /* nothing to display, no items available */ if( i == nd->u.scr.shop->items ) { - clif->colormes(sd->fd,COLOR_RED,"Shop is out of stock! Come again later!");/* TODO messages.conf-it */ + clif->colormes(sd->fd,COLOR_RED, msg_txt(881)); return false; } |