diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-12-02 15:29:02 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-12-02 15:29:02 +0100 |
| commit | 1fb4acc25ae89360e71d33a8f7cba99bcc028b32 (patch) | |
| tree | 6a12714df0e1bd8a96b1f5452fbc4efcb83f7200 /src/server/game/Entities/GameObject | |
| parent | 49699bc966e4543044da7f1fd75d57fbebfac4e4 (diff) | |
Core/Quests: Implemented QUEST_OBJECTIVE_KILL_WITH_LABEL
Diffstat (limited to 'src/server/game/Entities/GameObject')
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index ce475f4424f..43812641cec 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -3602,6 +3602,16 @@ std::string GameObject::GetNameForLocaleIdx(LocaleConstant locale) const return GetName(); } +bool GameObject::HasLabel(int32 gameobjectLabel) const +{ + return advstd::ranges::contains(GetLabels(), gameobjectLabel); +} + +std::span<int32 const> GameObject::GetLabels() const +{ + return sDB2Manager.GetGameObjectLabels(GetEntry()); +} + void GameObject::UpdatePackedRotation() { static const int32 PACK_YZ = 1 << 20; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 07db9755d86..00cbe9bfecd 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -223,6 +223,9 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject> // overwrite WorldObject function for proper name localization std::string GetNameForLocaleIdx(LocaleConstant locale) const override; + bool HasLabel(int32 gameobjectLabel) const; + std::span<int32 const> GetLabels() const; + void SaveToDB(); void SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDifficulties); bool LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap, bool = true); // arg4 is unused, only present to match the signature on Creature |
