Skip to content

Commit

Permalink
feat: TransmogPlus - Skip Level Req (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Aug 16, 2024
1 parent e994a14 commit 8145ece
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions conf/transmog.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -298,6 +303,7 @@ Transmogrification.EnablePlus = 0
Transmogrification.MembershipLevels = ""
Transmogrification.MembershipLevelsLegendary = ""
Transmogrification.MembershipLevelsPet = ""
Transmogrification.MembershipLevelsSkipLevelReq = ""
Transmogrification.PetSpellId = 2000100

#
Expand Down
10 changes: 8 additions & 2 deletions src/Transmogrification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Transmogrification.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8145ece

Please sign in to comment.