From b8d0b4bf2e2106557d3d88bca384539a794f1f9a Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 5 Aug 2024 14:57:21 -0400 Subject: [PATCH] Core/Entities: Added GetStringId helper methods Port From (https://github.com/TrinityCore/TrinityCore/commit/5cea37153eb6675bf0a25320a1c11cd0ec4969b6) --- Source/Framework/Constants/SharedConst.cs | 7 +++++++ Source/Game/Entities/Creature/Creature.cs | 1 + Source/Game/Entities/GameObject/GameObject.cs | 1 + 3 files changed, 9 insertions(+) diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 8ca1289a8..feb2f0daf 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -1024,6 +1024,13 @@ namespace Framework.Constants BelongsToLayer = 0x100000, } + public enum StringIdType + { + Template = 0, + Spawn = 1, + Script = 2 + } + // values based at Holidays.dbc public enum HolidayIds { diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 05b739c19..577c5f39a 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2935,6 +2935,7 @@ namespace Game.Entities } public string[] GetStringIds() { return m_stringIds; } + public string GetStringId(StringIdType type) { return m_stringIds[(int)type]; } public VendorItemData GetVendorItems() { diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index f5ecf1cef..5355dfcf4 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -2685,6 +2685,7 @@ namespace Game.Entities } public string[] GetStringIds() { return m_stringIds; } + public string GetStringId(StringIdType type) { return m_stringIds[(int)type]; } public override string GetName(Locale locale = Locale.enUS) {