feat(Core/Commands): Introduce .npc guid (#12440)
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `command` WHERE `name` = 'npc guid';
|
||||||
|
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('npc guid', 1, 'Syntax: .npc guid\r\n\r\nDisplays GUID, faction, NPC flags, Entry ID, Model ID for selected creature.');
|
||||||
@@ -186,6 +186,7 @@ public:
|
|||||||
static ChatCommandTable npcCommandTable =
|
static ChatCommandTable npcCommandTable =
|
||||||
{
|
{
|
||||||
{ "info", HandleNpcInfoCommand, SEC_GAMEMASTER, Console::No },
|
{ "info", HandleNpcInfoCommand, SEC_GAMEMASTER, Console::No },
|
||||||
|
{ "guid", HandleNpcGuidCommand, SEC_GAMEMASTER, Console::No },
|
||||||
{ "near", HandleNpcNearCommand, SEC_GAMEMASTER, Console::No },
|
{ "near", HandleNpcNearCommand, SEC_GAMEMASTER, Console::No },
|
||||||
{ "move", HandleNpcMoveCommand, SEC_GAMEMASTER, Console::No },
|
{ "move", HandleNpcMoveCommand, SEC_GAMEMASTER, Console::No },
|
||||||
{ "playemote", HandleNpcPlayEmoteCommand, SEC_GAMEMASTER, Console::No },
|
{ "playemote", HandleNpcPlayEmoteCommand, SEC_GAMEMASTER, Console::No },
|
||||||
@@ -651,6 +652,36 @@ public:
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
static bool HandleNpcGuidCommand(ChatHandler* handler)
|
||||||
|
{
|
||||||
|
Creature* target = handler->getSelectedCreature();
|
||||||
|
|
||||||
|
if (!target)
|
||||||
|
{
|
||||||
|
handler->SendSysMessage(LANG_SELECT_CREATURE);
|
||||||
|
handler->SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 faction = target->GetFaction();
|
||||||
|
uint32 npcflags = target->GetNpcFlags();
|
||||||
|
uint32 displayid = target->GetDisplayId();
|
||||||
|
uint32 nativeid = target->GetNativeDisplayId();
|
||||||
|
uint32 entry = target->GetEntry();
|
||||||
|
uint32 id1 = 0;
|
||||||
|
uint32 id2 = 0;
|
||||||
|
uint32 id3 = 0;
|
||||||
|
if (CreatureData const* cData = target->GetCreatureData())
|
||||||
|
{
|
||||||
|
id1 = cData->id1;
|
||||||
|
id2 = cData->id2;
|
||||||
|
id3 = cData->id3;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static bool HandleNpcNearCommand(ChatHandler* handler, Optional<float> dist)
|
static bool HandleNpcNearCommand(ChatHandler* handler, Optional<float> dist)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user