diff --git a/src/Transmogrification.cpp b/src/Transmogrification.cpp index dc2003dd..8f5631a4 100644 --- a/src/Transmogrification.cpp +++ b/src/Transmogrification.cpp @@ -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) diff --git a/src/cs_transmog.cpp b/src/cs_transmog.cpp index 9074ff15..fbd72629 100644 --- a/src/cs_transmog.cpp +++ b/src/cs_transmog.cpp @@ -22,6 +22,7 @@ #include "Transmogrification.h" #include "Tokenize.h" #include "DatabaseEnv.h" +#include "SpellMgr.h" using namespace Acore::ChatCommands; @@ -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; };