mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
feat(Scripts/Commands): Add command ".npc do" for calling DoAction() (#24281)
This commit is contained in:
@@ -671,6 +671,8 @@ enum AcoreStrings
|
||||
|
||||
LANG_REWARDED = 602,
|
||||
|
||||
LANG_NPC_DO_ACTION = 603,
|
||||
|
||||
// 603-704 - free
|
||||
|
||||
LANG_WAIT_BEFORE_SPEAKING = 705,
|
||||
|
||||
@@ -188,6 +188,7 @@ public:
|
||||
{ "whisper", HandleNpcWhisperCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "yell", HandleNpcYellCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "tame", HandleNpcTameCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "do", HandleNpcDoActionCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "add", npcAddCommandTable },
|
||||
{ "delete", npcDeleteCommandTable },
|
||||
{ "follow", npcFollowCommandTable },
|
||||
@@ -1212,6 +1213,20 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleNpcDoActionCommand(ChatHandler* handler, uint32 actionId)
|
||||
{
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
if (!creature)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_SELECT_CREATURE);
|
||||
return false;
|
||||
}
|
||||
|
||||
creature->AI()->DoAction(actionId);
|
||||
handler->PSendSysMessage(LANG_NPC_DO_ACTION, creature->GetGUID().ToString(), creature->GetEntry(), creature->GetName(), actionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleNpcAddFormationCommand(ChatHandler* handler, ObjectGuid::LowType leaderGUID)
|
||||
{
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
Reference in New Issue
Block a user