mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10125] Add pool/event ids to diff creature/gameobject list output commands.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
ef1358c901
commit
9379e3b81d
10 changed files with 83 additions and 16 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
|||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`cache_id` int(10) default '0',
|
||||
`required_10119_01_mangos_creature_model_info` bit(1) default NULL
|
||||
`required_10125_01_mangos_mangos_string` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
@ -3396,9 +3396,9 @@ INSERT INTO `mangos_string` VALUES
|
|||
(512,'%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(513,'%d - |cffffffff|Hquest:%d:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(514,'%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(515,'%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(515,'%d%s - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(516,'%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(517,'%d, Entry %d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(517,'%d%s, Entry %d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(518,'%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
|
|
@ -3668,8 +3668,8 @@ INSERT INTO `mangos_string` VALUES
|
|||
(1107,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1108,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1109,'%d - %s %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),
|
||||
(1110,'%d%s - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1111,'%d%s - %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),
|
||||
|
|
@ -3695,7 +3695,7 @@ INSERT INTO `mangos_string` VALUES
|
|||
(1134,' Follow <NULL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1135,'List known talents:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1136,' (Found talents: %u used talent points: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1137,'%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1137,'%d%s - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1138,'=================================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1139,'| GUID | Name | Race | Class | Level |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1140,'| %10u | %20s | %15s | %15s | %5u |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
|
|
@ -3707,6 +3707,9 @@ INSERT INTO `mangos_string` VALUES
|
|||
(1146,'Part of pool %u, top pool %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1147,'The (top)pool %u is spawned by event %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1148,'The (top)pool %u is despawned by event %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1149,' (Pool %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1150,' (Event %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1151,' (Pool %u Event %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
|
||||
|
|
|
|||
17
sql/updates/10125_01_mangos_mangos_string.sql
Normal file
17
sql/updates/10125_01_mangos_mangos_string.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_10119_01_mangos_creature_model_info required_10125_01_mangos_mangos_string bit;
|
||||
|
||||
DELETE FROM mangos_string WHERE entry BETWEEN 1149 AND 1151;
|
||||
|
||||
INSERT INTO mangos_string VALUES
|
||||
(1149,' (Pool %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1150,' (Event %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(1151,' (Pool %u Event %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
DELETE FROM mangos_string WHERE entry in (515, 517, 1110, 1111, 1137);
|
||||
|
||||
INSERT INTO mangos_string VALUES
|
||||
(515,'%d%s - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -- LANG_CREATURE_LIST_CHAT (.list creature)
|
||||
(517,'%d%s, Entry %d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -- LANG_GO_MIXED_LIST_CHAT (.gobject near)
|
||||
(1110,'%d%s - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -- LANG_CREATURE_LIST_CONSOLE
|
||||
(1111,'%d%s - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -- LANG_GO_LIST_CONSOLE
|
||||
(1137,'%d%s - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -- LANG_GO_LIST_CHAT (.list object)
|
||||
|
|
@ -96,6 +96,7 @@ pkgdata_DATA = \
|
|||
10107_01_mangos_mangos_string.sql \
|
||||
10109_01_mangos_creature_model_info.sql \
|
||||
10119_01_mangos_creature_model_info.sql \
|
||||
10125_01_mangos_mangos_string.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -172,4 +173,5 @@ EXTRA_DIST = \
|
|||
10107_01_mangos_mangos_string.sql \
|
||||
10109_01_mangos_creature_model_info.sql \
|
||||
10119_01_mangos_creature_model_info.sql \
|
||||
10125_01_mangos_mangos_string.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -2561,6 +2561,43 @@ void ChatHandler::ShowNpcOrGoSpawnInformation(uint32 guid)
|
|||
}
|
||||
}
|
||||
|
||||
// Prepare ShortString for a NPC or GO (by guid) with pool or game event IDs
|
||||
template <typename T>
|
||||
std::string ChatHandler::PrepareStringNpcOrGoSpawnInformation(uint32 guid)
|
||||
{
|
||||
std::string str = "";
|
||||
if (uint16 pool_id = sPoolMgr.IsPartOfAPool<T>(guid))
|
||||
{
|
||||
uint16 top_pool_id = sPoolMgr.IsPartOfTopPool<T>(guid);
|
||||
if (int16 event_id = sGameEventMgr.GetGameEventId<Pool>(top_pool_id))
|
||||
{
|
||||
char buffer[100];
|
||||
const char* format = GetMangosString(LANG_NPC_GO_INFO_POOL_EVENT_STRING);
|
||||
sprintf(buffer, format, pool_id, event_id);
|
||||
str = buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[100];
|
||||
const char* format = GetMangosString(LANG_NPC_GO_INFO_POOL_STRING);
|
||||
sprintf(buffer, format, pool_id);
|
||||
str = buffer;
|
||||
}
|
||||
}
|
||||
else if (int16 event_id = sGameEventMgr.GetGameEventId<T>(guid))
|
||||
{
|
||||
char buffer[100];
|
||||
const char* format = GetMangosString(LANG_NPC_GO_INFO_EVENT_STRING);
|
||||
sprintf(buffer, format, event_id);
|
||||
str = buffer;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
// Instantiate template for helper function
|
||||
template void ChatHandler::ShowNpcOrGoSpawnInformation<Creature>(uint32 guid);
|
||||
template void ChatHandler::ShowNpcOrGoSpawnInformation<GameObject>(uint32 guid);
|
||||
|
||||
template std::string ChatHandler::PrepareStringNpcOrGoSpawnInformation<Creature>(uint32 guid);
|
||||
template std::string ChatHandler::PrepareStringNpcOrGoSpawnInformation<GameObject>(uint32 guid);
|
||||
|
|
|
|||
|
|
@ -562,6 +562,8 @@ class ChatHandler
|
|||
bool HandleGoHelper(Player* _player, uint32 mapid, float x, float y, float const* zPtr = NULL, float const* ortPtr = NULL);
|
||||
template<typename T>
|
||||
void ShowNpcOrGoSpawnInformation(uint32 guid);
|
||||
template <typename T>
|
||||
std::string PrepareStringNpcOrGoSpawnInformation(uint32 guid);
|
||||
|
||||
/**
|
||||
* Stores informations about a deleted character
|
||||
|
|
@ -615,4 +617,7 @@ class CliHandler : public ChatHandler
|
|||
Print* m_print;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -846,7 +846,10 @@ enum MangosStrings
|
|||
LANG_NPC_GO_INFO_TOP_POOL = 1146,
|
||||
LANG_NPC_GO_INFO_POOL_GAME_EVENT_S = 1147,
|
||||
LANG_NPC_GO_INFO_POOL_GAME_EVENT_D = 1148,
|
||||
// Room for more level 3 1149-1199 not used
|
||||
LANG_NPC_GO_INFO_POOL_STRING = 1149,
|
||||
LANG_NPC_GO_INFO_EVENT_STRING = 1150,
|
||||
LANG_NPC_GO_INFO_POOL_EVENT_STRING = 1151,
|
||||
// Room for more level 3 1152-1199 not used
|
||||
|
||||
// Debug commands
|
||||
LANG_CINEMATIC_NOT_EXIST = 1200,
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args)
|
|||
"(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
|
||||
"FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
|
||||
pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
|
||||
pl->GetMapId(), pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
|
@ -863,7 +863,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args)
|
|||
if (!gInfo)
|
||||
continue;
|
||||
|
||||
PSendSysMessage(LANG_GO_MIXED_LIST_CHAT, guid, entry, guid, gInfo->name, x, y, z, mapid);
|
||||
PSendSysMessage(LANG_GO_MIXED_LIST_CHAT, guid, PrepareStringNpcOrGoSpawnInformation<GameObject>(guid).c_str(), entry, guid, gInfo->name, x, y, z, mapid);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
|
|
|||
|
|
@ -2530,9 +2530,9 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
|||
int mapid = fields[4].GetUInt16();
|
||||
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_GO_LIST_CHAT, guid, guid, gInfo->name, x, y, z, mapid);
|
||||
PSendSysMessage(LANG_GO_LIST_CHAT, guid, PrepareStringNpcOrGoSpawnInformation<GameObject>(guid).c_str(), guid, gInfo->name, x, y, z, mapid);
|
||||
else
|
||||
PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name, x, y, z, mapid);
|
||||
PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, PrepareStringNpcOrGoSpawnInformation<GameObject>(guid).c_str(), gInfo->name, x, y, z, mapid);
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
|
@ -2605,10 +2605,10 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
|
|||
float z = fields[3].GetFloat();
|
||||
int mapid = fields[4].GetUInt16();
|
||||
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name, x, y, z, mapid);
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, PrepareStringNpcOrGoSpawnInformation<Creature>(guid).c_str(), guid, cInfo->Name, x, y, z, mapid);
|
||||
else
|
||||
PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name, x, y, z, mapid);
|
||||
PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, PrepareStringNpcOrGoSpawnInformation<Creature>(guid).c_str(), cInfo->Name, x, y, z, mapid);
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10124"
|
||||
#define REVISION_NR "10125"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_10051_01_characters_character_aura"
|
||||
#define REVISION_DB_MANGOS "required_10119_01_mangos_creature_model_info"
|
||||
#define REVISION_DB_MANGOS "required_10125_01_mangos_mangos_string"
|
||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue