|
22 | 22 | #include "Transmogrification.h" |
23 | 23 | #include "Tokenize.h" |
24 | 24 | #include "DatabaseEnv.h" |
| 25 | +#include "SpellMgr.h" |
25 | 26 |
|
26 | 27 | using namespace Acore::ChatCommands; |
27 | 28 |
|
@@ -280,27 +281,31 @@ class transmog_commandscript : public CommandScript |
280 | 281 | { |
281 | 282 | if (!sTransmogrification->IsPortableNPCEnabled) |
282 | 283 | { |
283 | | - handler->GetPlayer()->SendSystemMessage("The portable transmogrification NPC is disabled."); |
284 | | - handler->SetSentErrorMessage(true); |
| 284 | + handler->SendErrorMessage("The portable transmogrification NPC is disabled."); |
285 | 285 | return true; |
286 | 286 | } |
287 | 287 |
|
288 | | - if (Player* player = PlayerIdentifier::FromSelf(handler)->GetConnectedPlayer()) |
| 288 | + if (!sTransmogrification->IsTransmogPlusEnabled) |
289 | 289 | { |
| 290 | + handler->SendErrorMessage("The portable transmogrification NPC is a plus feature. Plus features are currently disabled."); |
| 291 | + return true; |
| 292 | + } |
290 | 293 |
|
291 | | - if (sTransmogrification->IsTransmogPlusEnabled) |
292 | | - if (sTransmogrification->IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_PET)) |
293 | | - { |
294 | | - player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true); |
295 | | - return true; |
296 | | - } |
| 294 | + Player* player = PlayerIdentifier::FromSelf(handler)->GetConnectedPlayer(); |
297 | 295 |
|
298 | | - if (player->GetSession()->GetSecurity() < SEC_MODERATOR) |
299 | | - return true; |
| 296 | + if (!sTransmogrification->IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_PET)) |
| 297 | + { |
| 298 | + handler->SendErrorMessage("You are not eligible for the portable transmogrification NPC. Please check your subscription level."); |
| 299 | + return true; |
| 300 | + } |
300 | 301 |
|
301 | | - player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true); |
| 302 | + if (!sSpellMgr->GetSpellInfo(sTransmogrification->PetSpellId)) |
| 303 | + { |
| 304 | + handler->SendErrorMessage("The portable transmogrification NPC spell is not available."); |
| 305 | + return true; |
302 | 306 | } |
303 | 307 |
|
| 308 | + player->CastSpell((Unit*)nullptr, sTransmogrification->PetSpellId, true); |
304 | 309 | return true; |
305 | 310 | }; |
306 | 311 |
|
|
0 commit comments