mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
Morph command update (#2641)
* changed morph command removed demorph and adapted morph to include a reset option * command info updated * Update data/sql/updates/pending_db_world/rev_1580747652284896800.sql Co-Authored-By: Barbz <BarbzYHOOL@users.noreply.github.com> * Added subcommand system for Morph - Subcommands - Descriptions on database * travis * two single quotes query * Update data/sql/updates/pending_db_world/rev_1580747652284896800.sql Co-Authored-By: Barbz <BarbzYHOOL@users.noreply.github.com> * Update data/sql/updates/pending_db_world/rev_1580747652284896800.sql Co-Authored-By: Barbz <BarbzYHOOL@users.noreply.github.com> * Update data/sql/updates/pending_db_world/rev_1580747652284896800.sql Co-Authored-By: Barbz <BarbzYHOOL@users.noreply.github.com> Co-authored-by: Barbz <BarbzYHOOL@users.noreply.github.com>
This commit is contained in:
@@ -60,11 +60,17 @@ public:
|
||||
{ "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "" },
|
||||
{ "speed", SEC_GAMEMASTER, false, nullptr, "", modifyspeedCommandTable }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> morphCommandTable =
|
||||
{
|
||||
{ "reset", SEC_GAMEMASTER, false, &HandleMorphResetCommand, "" },
|
||||
{ "target", SEC_GAMEMASTER, false, &HandleMorphTargetCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "morph", SEC_MODERATOR, false, &HandleModifyMorphCommand, "" },
|
||||
{ "demorph", SEC_MODERATOR, false, &HandleDeMorphCommand, "" },
|
||||
{ "modify", SEC_GAMEMASTER, false, nullptr, "", modifyCommandTable }
|
||||
{ "morph", SEC_MODERATOR, false, nullptr, "", morphCommandTable },
|
||||
{ "modify", SEC_GAMEMASTER, false, nullptr, "", modifyCommandTable }
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -1247,15 +1253,12 @@ public:
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
return true;
|
||||
}
|
||||
|
||||
//morph creature or player
|
||||
static bool HandleModifyMorphCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleMorphTargetCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 display_id = (uint32)atoi((char*)args);
|
||||
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (!target)
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
@@ -1269,6 +1272,21 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
//morph creature or player
|
||||
static bool HandleMorphResetCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (!target)
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
|
||||
return false;
|
||||
|
||||
target->DeMorph();
|
||||
return true;
|
||||
}
|
||||
|
||||
//set temporary phase mask for player
|
||||
static bool HandleModifyPhaseCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
@@ -1384,21 +1402,6 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//demorph player or unit
|
||||
static bool HandleDeMorphCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (!target)
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
|
||||
return false;
|
||||
|
||||
target->DeMorph();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_modify_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user