From 8145ece42026e6f569756ce1c25040ae7fca7ac6 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:50:06 -0300 Subject: [PATCH] feat: TransmogPlus - Skip Level Req (#162) --- conf/transmog.conf.dist | 6 ++++++ src/Transmogrification.cpp | 10 ++++++++-- src/Transmogrification.h | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/conf/transmog.conf.dist b/conf/transmog.conf.dist index 5ddaab8..1867676 100644 --- a/conf/transmog.conf.dist +++ b/conf/transmog.conf.dist @@ -288,6 +288,11 @@ Transmogrification.SetCopperCost = 0 # Example: Transmogrification.MembershipLevelsPet = "1,2,3" # Default: "" # +# Transmogrification.MembershipLevelsSkipLevelReq +# Description: Membership levels ID from acore_cms_subscriptions that define the eligibility for skipping level checks when transmogfrifying +# Example: Transmogrification.MembershipLevelsSkipLevelReq = "1,2,3" +# Default: "" +# # Transmogrification.PetSpellId # Description: The ID used by the transmog pet in the spell_dbc table # Example: Transmogrification.PetSpellId = 2000100 @@ -298,6 +303,7 @@ Transmogrification.EnablePlus = 0 Transmogrification.MembershipLevels = "" Transmogrification.MembershipLevelsLegendary = "" Transmogrification.MembershipLevelsPet = "" +Transmogrification.MembershipLevelsSkipLevelReq = "" Transmogrification.PetSpellId = 2000100 # diff --git a/src/Transmogrification.cpp b/src/Transmogrification.cpp index 48b6911..6749991 100644 --- a/src/Transmogrification.cpp +++ b/src/Transmogrification.cpp @@ -792,7 +792,7 @@ bool Transmogrification::SuitableForTransmogrification(Player* player, ItemTempl return false; } - if (!IgnoreReqLevel && player->GetLevel() < proto->RequiredLevel) + if (!IgnoreReqLevel && IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_SKIP_LEVEL_REQ) && player->GetLevel() < proto->RequiredLevel) return false; if (AllowLowerTiers && TierAvailable(player, 0, proto->SubClass)) @@ -881,7 +881,7 @@ bool Transmogrification::SuitableForTransmogrification(ObjectGuid guid, ItemTemp return false; } - if (!IgnoreReqLevel && playerLevel < proto->RequiredLevel) + if (!IgnoreReqLevel && IsPlusFeatureEligible(guid, PLUS_FEATURE_SKIP_LEVEL_REQ) && playerLevel < proto->RequiredLevel) return false; if (AllowLowerTiers && TierAvailable(NULL, playerGuid, proto->SubClass)) @@ -1154,6 +1154,12 @@ void Transmogrification::LoadConfig(bool reload) plusDataMap[PLUS_FEATURE_PET].push_back(Acore::StringTo(itr).value()); } + stringMembershipIds = sConfigMgr->GetOption("Transmogrification.MembershipLevelsSkipLevelReq", ""); + for (auto& itr : Acore::Tokenize(stringMembershipIds, ',', false)) + { + plusDataMap[PLUS_FEATURE_SKIP_LEVEL_REQ].push_back(Acore::StringTo(itr).value()); + } + PetSpellId = sConfigMgr->GetOption("Transmogrification.PetSpellId", 2000100); } diff --git a/src/Transmogrification.h b/src/Transmogrification.h index 248728a..7fd0325 100644 --- a/src/Transmogrification.h +++ b/src/Transmogrification.h @@ -91,7 +91,8 @@ enum PlusFeatures { PLUS_FEATURE_GREY_ITEMS, PLUS_FEATURE_LEGENDARY_ITEMS, - PLUS_FEATURE_PET + PLUS_FEATURE_PET, + PLUS_FEATURE_SKIP_LEVEL_REQ }; class Transmogrification