feat: TransmogPlus - Skip Level Req (#162)

This commit is contained in:
Andrew
2024-08-16 11:50:06 -03:00
committed by GitHub
parent e994a149f2
commit 8145ece420
3 changed files with 16 additions and 3 deletions

View File

@@ -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
#

View File

@@ -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<uint32>(itr).value());
}
stringMembershipIds = sConfigMgr->GetOption<std::string>("Transmogrification.MembershipLevelsSkipLevelReq", "");
for (auto& itr : Acore::Tokenize(stringMembershipIds, ',', false))
{
plusDataMap[PLUS_FEATURE_SKIP_LEVEL_REQ].push_back(Acore::StringTo<uint32>(itr).value());
}
PetSpellId = sConfigMgr->GetOption<uint32>("Transmogrification.PetSpellId", 2000100);
}

View File

@@ -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