Core/Battlegrounds: Move to scripts And a lot of misc commits i couldn't recover.

Port From (https://github.com/TrinityCore/TrinityCore/commit/d0d5d309bb5877dc2fcb27f6cb123707a31ec1e8)
This commit is contained in:
Hondacrx
2024-08-04 15:18:22 -04:00
parent bca02a24b0
commit e9b21a91be
139 changed files with 8322 additions and 8700 deletions
+3 -29
View File
@@ -17,35 +17,10 @@ namespace Game.Chat
if (info == null)
return default;
ChatCommandResult errorResult = ChatCommandResult.FromErrorMessage(handler.GetCypherString(CypherStrings.CmdparserLinkdataInvalid));
// store value
switch (Type.GetTypeCode(type))
{
case TypeCode.UInt32:
{
if (!uint.TryParse(info.Data, out uint tempValue))
return errorResult;
value = tempValue;
break;
}
case TypeCode.UInt64:
{
if (!ulong.TryParse(info.Data, out ulong tempValue))
return errorResult;
value = tempValue;
break;
}
case TypeCode.String:
{
value = info.Data;
break;
}
default:
return errorResult;
}
HyperlinkDataTokenizer t = new(info.Data, true);
if (!t.TryConsumeTo(out value, type))
return new ChatCommandResult(handler.GetCypherString(CypherStrings.CmdparserLinkdataInvalid));
// finally, skip any potential delimiters
var (token, next) = info.Tail.Tokenize();
@@ -101,7 +76,6 @@ namespace Game.Chat
static byte toHex(char c) { return (byte)((c >= '0' && c <= '9') ? c - '0' + 0x10 : (c >= 'a' && c <= 'f') ? c - 'a' + 0x1a : 0x00); }
//|color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r
public static HyperlinkInfo ParseHyperlink(string currentString)
{
if (currentString.IsEmpty())