mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Scripts/Commands): Implement opendoor command (#21136)
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `acore_string` WHERE `entry` IN (5086, 5087);
|
||||||
|
INSERT INTO `acore_string` (`entry`, `content_default`) VALUES
|
||||||
|
(5086, 'No doors found within range ({} yards).'),
|
||||||
|
(5087, 'Door {} (Entry: {}) opened!');
|
||||||
|
|
||||||
|
DELETE FROM `command` WHERE `name` = 'opendoor';
|
||||||
|
INSERT INTO `command` (`name`, `security`, `help`) VALUES
|
||||||
|
('opendoor', 1, 'Syntax: .opendoor [$range]\nOpens the nearest door within the range provided (default 5.0yd)');
|
||||||
@@ -1145,7 +1145,10 @@ enum AcoreStrings
|
|||||||
|
|
||||||
LANG_CMD_GO_RESPAWN = 5085,
|
LANG_CMD_GO_RESPAWN = 5085,
|
||||||
|
|
||||||
// Room for more strings 5086-9999
|
LANG_CMD_NO_DOOR_FOUND = 5086,
|
||||||
|
LANG_CMD_DOOR_OPENED = 5087,
|
||||||
|
|
||||||
|
// Room for more strings 5088-9999
|
||||||
|
|
||||||
// Level requirement notifications
|
// Level requirement notifications
|
||||||
LANG_SAY_REQ = 6604,
|
LANG_SAY_REQ = 6604,
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ public:
|
|||||||
{ "playall", HandlePlayAllCommand, SEC_GAMEMASTER, Console::No },
|
{ "playall", HandlePlayAllCommand, SEC_GAMEMASTER, Console::No },
|
||||||
{ "skirmish", HandleSkirmishCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "skirmish", HandleSkirmishCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "mailbox", HandleMailBoxCommand, SEC_MODERATOR, Console::No },
|
{ "mailbox", HandleMailBoxCommand, SEC_MODERATOR, Console::No },
|
||||||
{ "string", HandleStringCommand, SEC_GAMEMASTER, Console::No }
|
{ "string", HandleStringCommand, SEC_GAMEMASTER, Console::No },
|
||||||
|
{ "opendoor", HandleOpenDoorCommand, SEC_GAMEMASTER, Console::No }
|
||||||
};
|
};
|
||||||
|
|
||||||
return commandTable;
|
return commandTable;
|
||||||
@@ -3034,6 +3035,19 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool HandleOpenDoorCommand(ChatHandler* handler, Optional<float> range)
|
||||||
|
{
|
||||||
|
if (GameObject* go = handler->GetPlayer()->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_DOOR, range ? *range : 5.0f))
|
||||||
|
{
|
||||||
|
go->SetGoState(GO_STATE_ACTIVE);
|
||||||
|
handler->PSendSysMessage(LANG_CMD_DOOR_OPENED, go->GetName(), go->GetEntry());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler->SendErrorMessage(LANG_CMD_NO_DOOR_FOUND, range ? *range : 5.0f);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_misc_commandscript()
|
void AddSC_misc_commandscript()
|
||||||
|
|||||||
Reference in New Issue
Block a user