Core/Entities: Added GetStringId helper methods

This commit is contained in:
ModoX
2024-04-09 16:33:39 +02:00
parent 9ac03bf2b8
commit 5cea37153e
3 changed files with 9 additions and 0 deletions

View File

@@ -258,6 +258,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
bool HasStringId(std::string_view id) const;
void SetScriptStringId(std::string id);
std::array<std::string_view, 3> const& GetStringIds() const { return m_stringIds; }
std::string_view const& GetStringId(StringIdType type) const { return m_stringIds[AsUnderlyingType(type)]; }
// override WorldObject function for proper name localization
std::string GetNameForLocaleIdx(LocaleConstant locale) const override;

View File

@@ -381,6 +381,7 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
bool HasStringId(std::string_view id) const;
void SetScriptStringId(std::string id);
std::array<std::string_view, 3> const& GetStringIds() const { return m_stringIds; }
std::string_view const& GetStringId(StringIdType type) const { return m_stringIds[AsUnderlyingType(type)]; }
void SetDisplayId(uint32 displayid);
uint32 GetDisplayId() const { return m_gameObjectData->DisplayID; }

View File

@@ -4781,6 +4781,13 @@ enum class CreatureClassifications : uint32
MinusMob = 6
};
enum class StringIdType : int32
{
Template = 0,
Spawn = 1,
Script = 2
};
// Holidays.dbc (9.0.2.37176)
enum HolidayIds
{