diff --git a/sql/mangos.sql b/sql/mangos.sql index 85fdb13e3..ab4129d10 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -276,7 +276,7 @@ INSERT INTO `command` VALUES ('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent VALUESrecalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'), ('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'), ('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'), -('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails and auctions. Output item guids, item owner guid, owner account and owner name. Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'), +('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails, auctions, and guild banks. Output item guids, item owner guid, owner account and owner name (guild name and guid in case guild bank). Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'), ('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'), ('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'), ('lockaccount',0,'Syntax: .lockaccount [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'), @@ -2404,7 +2404,7 @@ INSERT INTO `mangos_string` VALUES (435,'Invalid item id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (436,'No items found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (437,'Invalid gameobject id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -(438,'Found items %u: %u ( inventory %u mail %u auction %u )',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(438,'Found items %u: %u ( inventory %u mail %u auction %u guild %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (439,'Found gameobjects %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (440,'Invalid creature id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (441,'Found creatures %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), @@ -2648,7 +2648,14 @@ INSERT INTO `mangos_string` VALUES (1108,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1109,'%d - %s %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1110,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -(1111,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +(1111,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1112,'Failed to open file: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1113,'Account %s (%u) have max amount allowed characters (client limit)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1114,'Dump file have broken data!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1115,'Invalid character name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1116,'Invalid character guid!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1117,'Character guid %u in use!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/2008_10_23_03_mangos_mangos_string.sql b/sql/updates/2008_10_23_03_mangos_mangos_string.sql new file mode 100644 index 000000000..0c409cabf --- /dev/null +++ b/sql/updates/2008_10_23_03_mangos_mangos_string.sql @@ -0,0 +1,5 @@ +DELETE FROM mangos_string WHERE entry IN (438,1118); + +INSERT INTO mangos_string VALUES +(438,'Found items %u: %u ( inventory %u mail %u auction %u guild %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/sql/updates/2008_10_23_04_mangos_command.sql b/sql/updates/2008_10_23_04_mangos_command.sql new file mode 100644 index 000000000..8850a32fc --- /dev/null +++ b/sql/updates/2008_10_23_04_mangos_command.sql @@ -0,0 +1,4 @@ +DELETE FROM command WHERE name IN ('list item'); + +INSERT INTO command VALUES +('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails, auctions, and guild banks. Output item guids, item owner guid, owner account and owner name (guild name and guid in case guild bank). Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index b66f32de4..d2bf3d489 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -103,6 +103,8 @@ pkgdata_DATA = \ 2008_10_22_02_mangos_mangos_string.sql \ 2008_10_23_01_mangos_command.sql \ 2008_10_23_02_mangos_mangos_string.sql \ + 2008_10_23_03_mangos_mangos_string.sql \ + 2008_10_23_04_mangos_command.sql \ README ## Additional files to include when running 'make dist' @@ -187,4 +189,6 @@ EXTRA_DIST = \ 2008_10_22_02_mangos_mangos_string.sql \ 2008_10_23_01_mangos_command.sql \ 2008_10_23_02_mangos_mangos_string.sql \ + 2008_10_23_03_mangos_mangos_string.sql \ + 2008_10_23_04_mangos_command.sql \ README diff --git a/src/game/Language.h b/src/game/Language.h index cd4875495..acdd14b49 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -682,7 +682,8 @@ enum MangosStrings LANG_INVALID_CHARACTER_NAME = 1115, LANG_INVALID_CHARACTER_GUID = 1116, LANG_CHARACTER_GUID_IN_USE = 1117, - // Room for more level 3 1118-1199 not used + LANG_ITEMLIST_GUILD = 1118, + // Room for more level 3 1119-1199 not used // FREE IDS 1200-9999 diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index de6a10072..f616ee1f9 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2194,14 +2194,53 @@ bool ChatHandler::HandleListItemCommand(const char* args) delete result; } - if(inv_count+mail_count+auc_count == 0) + // guild bank case + uint32 guild_count = 0; + result=CharacterDatabase.PQuery("SELECT COUNT(item_entry) FROM guild_bank_item WHERE item_entry='%u'",item_id); + if(result) + { + guild_count = (*result)[0].GetUInt32(); + delete result; + } + + result=CharacterDatabase.PQuery( + // 0 1 2 + "SELECT gi.item_guid, gi.guildid, guild.name " + "FROM guild_bank_item AS gi, guild WHERE gi.item_entry='%u' AND gi.guildid = guild.guildid LIMIT %u ", + item_id,uint32(count)); + + if(result) + { + do + { + Field *fields = result->Fetch(); + uint32 item_guid = fields[0].GetUInt32(); + uint32 guild_guid = fields[1].GetUInt32(); + std::string guild_name = fields[2].GetCppString(); + + char const* item_pos = "[in guild bank]"; + + PSendSysMessage(LANG_ITEMLIST_GUILD,item_guid,guild_name.c_str(),guild_guid,item_pos); + } while (result->NextRow()); + + int64 res_count = result->GetRowCount(); + + delete result; + + if(count > res_count) + count-=res_count; + else if(count) + count = 0; + } + + if(inv_count+mail_count+auc_count+guild_count == 0) { SendSysMessage(LANG_COMMAND_NOITEMFOUND); SetSentErrorMessage(true); return false; } - PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE,item_id,inv_count+mail_count+auc_count,inv_count,mail_count,auc_count); + PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE,item_id,inv_count+mail_count+auc_count+guild_count,inv_count,mail_count,auc_count,guild_count); return true; }