Scritpts/Commands: Fix area name display if no area present.
Port From (https://github.com/TrinityCore/TrinityCore/commit/abaf5d80685ff0dbfc766a074aa89b3481092f47)
This commit is contained in:
@@ -799,6 +799,7 @@ namespace Framework.Constants
|
|||||||
PinfoChrPlayedtime = 853,
|
PinfoChrPlayedtime = 853,
|
||||||
PinfoChrMails = 854,
|
PinfoChrMails = 854,
|
||||||
PinfoChrLevelHigh = 871,
|
PinfoChrLevelHigh = 871,
|
||||||
|
PinfoChrMapWithArea = 882,
|
||||||
|
|
||||||
CharacterGenderMale = 855,
|
CharacterGenderMale = 855,
|
||||||
CharacterGenderFemale = 856,
|
CharacterGenderFemale = 856,
|
||||||
@@ -828,7 +829,8 @@ namespace Framework.Constants
|
|||||||
// = 879, See PinfoChrRegmails
|
// = 879, See PinfoChrRegmails
|
||||||
AccountSecType = 880,
|
AccountSecType = 880,
|
||||||
RbacEmailRequired = 881,
|
RbacEmailRequired = 881,
|
||||||
// Room For In-Game Strings 882-999 Not Used
|
// = 882, LANG_PINFO_CHR_MAP_WITH_AREA
|
||||||
|
// Room For In-Game Strings 883-999 Not Used
|
||||||
|
|
||||||
// Level 4 (Cli Only Commands)
|
// Level 4 (Cli Only Commands)
|
||||||
CommandExit = 1000,
|
CommandExit = 1000,
|
||||||
|
|||||||
@@ -1559,8 +1559,8 @@ namespace Game.Chat
|
|||||||
// Position data print
|
// Position data print
|
||||||
uint mapId;
|
uint mapId;
|
||||||
uint areaId;
|
uint areaId;
|
||||||
string areaName = handler.GetCypherString(CypherStrings.Unknown);
|
string areaName = null;
|
||||||
string zoneName = handler.GetCypherString(CypherStrings.Unknown);
|
string zoneName = null;
|
||||||
|
|
||||||
// Guild data print variables defined so that they exist, but are not necessarily used
|
// Guild data print variables defined so that they exist, but are not necessarily used
|
||||||
ulong guildId = 0;
|
ulong guildId = 0;
|
||||||
@@ -1769,17 +1769,23 @@ namespace Game.Chat
|
|||||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(areaId);
|
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(areaId);
|
||||||
if (area != null)
|
if (area != null)
|
||||||
{
|
{
|
||||||
areaName = area.AreaName[locale];
|
zoneName = area.AreaName[locale];
|
||||||
|
|
||||||
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
|
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
|
||||||
if (zone != null)
|
if (zone != null)
|
||||||
|
{
|
||||||
|
areaName = zoneName;
|
||||||
zoneName = zone.AreaName[locale];
|
zoneName = zone.AreaName[locale];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target)
|
if (zoneName == null)
|
||||||
handler.SendSysMessage(CypherStrings.PinfoChrMap, map.MapName[locale],
|
zoneName = handler.GetCypherString(CypherStrings.Unknown);
|
||||||
(!zoneName.IsEmpty() ? zoneName : handler.GetCypherString(CypherStrings.Unknown)),
|
|
||||||
(!areaName.IsEmpty() ? areaName : handler.GetCypherString(CypherStrings.Unknown)));
|
if (areaName != null)
|
||||||
|
handler.SendSysMessage(CypherStrings.PinfoChrMapWithArea, map.MapName[locale], zoneName, areaName);
|
||||||
|
else
|
||||||
|
handler.SendSysMessage(CypherStrings.PinfoChrMap, map.MapName[locale], zoneName);
|
||||||
|
|
||||||
// Output XVII. - XVIX. if they are not empty
|
// Output XVII. - XVIX. if they are not empty
|
||||||
if (!guildName.IsEmpty())
|
if (!guildName.IsEmpty())
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `trinity_string` WHERE `entry` IN (848,882);
|
||||||
|
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
|
||||||
|
(848,'│ Map: %s, Zone: %s'),
|
||||||
|
(882,'│ Map: %s, Zone: %s, Area: %s');
|
||||||
Reference in New Issue
Block a user