Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Transmogrification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,9 @@ bool Transmogrification::IsPlusFeatureEligible(ObjectGuid const &playerGuid, uin
if (!player)
return false;

if (player->IsGameMaster())
return true; // GM can use all features

const auto membershipLevel = GetPlayerMembershipLevel(player);

if (!membershipLevel)
Expand Down
29 changes: 17 additions & 12 deletions src/cs_transmog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Transmogrification.h"
#include "Tokenize.h"
#include "DatabaseEnv.h"
#include "SpellMgr.h"

using namespace Acore::ChatCommands;

Expand Down Expand Up @@ -280,27 +281,31 @@ class transmog_commandscript : public CommandScript
{
if (!sTransmogrification->IsPortableNPCEnabled)
{
handler->GetPlayer()->SendSystemMessage("The portable transmogrification NPC is disabled.");
handler->SetSentErrorMessage(true);
handler->SendErrorMessage("The portable transmogrification NPC is disabled.");
return true;
}

if (Player* player = PlayerIdentifier::FromSelf(handler)->GetConnectedPlayer())
if (!sTransmogrification->IsTransmogPlusEnabled)
{
handler->SendErrorMessage("The portable transmogrification NPC is a plus feature. Plus features are currently disabled.");
return true;
}

if (sTransmogrification->IsTransmogPlusEnabled)
if (sTransmogrification->IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_PET))
{
player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true);
return true;
}
Player* player = PlayerIdentifier::FromSelf(handler)->GetConnectedPlayer();

if (player->GetSession()->GetSecurity() < SEC_MODERATOR)
return true;
if (!sTransmogrification->IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_PET))
{
handler->SendErrorMessage("You are not eligible for the portable transmogrification NPC. Please check your subscription level.");
return true;
}

player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true);
if (!sSpellMgr->GetSpellInfo(sTransmogrification->PetSpellId))
{
handler->SendErrorMessage("The portable transmogrification NPC spell is not available.");
return true;
}

player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true);
return true;
};

Expand Down