Add command similar to pinfo but for gameobjects.

Displays Entry, Type, DisplayId, and Name.
Created in response to issue #768.

--HG--
branch : trunk
This commit is contained in:
p0wer
2010-03-01 19:28:21 -06:00
parent 22d7ceaabb
commit 81f6779102
7 changed files with 48 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
INSERT INTO comand VALUES ('gobject info', 2, 'Syntax: .gobject info [$object_entry]\r\n\r\nQuery Gameobject information for selected gameobject or given entry.");
@@ -0,0 +1,4 @@
INSERT INTO trinity_string (`entry`, `content_default`) VALUES (5024, 'Entry: %u');
INSERT INTO trinity_string (`entry`, `content_default`) VALUES (5025, 'Type: %u');
INSERT INTO trinity_string (`entry`, `content_default`) VALUES (5026, 'DisplayID: %u');
INSERT INTO trinity_string (`entry`, `content_default`) VALUES (5027, 'Name: %s');
+5
View File
@@ -403,6 +403,7 @@ INSERT INTO `command` VALUES
('gobject activate','2','Syntax: .gobject activate #guid\r\n\r\nActivates an object like a door or a button.'), ('gobject activate','2','Syntax: .gobject activate #guid\r\n\r\nActivates an object like a door or a button.'),
('gobject add','2','Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'), ('gobject add','2','Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'),
('gobject delete','2','Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'), ('gobject delete','2','Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'),
('gobject info', 2, 'Syntax: .gobject info [$object_entry]\r\n\r\nQuery Gameobject information for selected gameobject or given entry.');
('gobject move','2','Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'), ('gobject move','2','Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'),
('gobject near','2','Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'), ('gobject near','2','Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),
('gobject setphase','2','Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'), ('gobject setphase','2','Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'),
@@ -14791,6 +14792,10 @@ INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_
(5021, 'Armor: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (5021, 'Armor: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5022, 'Channel password not changed due to channel being marked public. GM Powers required.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (5022, 'Channel password not changed due to channel being marked public. GM Powers required.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5023, 'Channel: %s publicity set to: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (5023, 'Channel: %s publicity set to: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5024, 'Entry: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5025, 'Type: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5026, 'DisplayID: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5027, 'Name: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6614, 'Notification to GM''s - ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (6614, 'Notification to GM''s - ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+1
View File
@@ -235,6 +235,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL }, { "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL },
{ "add", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectAddCommand, "", NULL }, { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectAddCommand, "", NULL },
{ "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectDeleteCommand, "", NULL }, { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectDeleteCommand, "", NULL },
{ "info", SEC_GAMEMASTER, false, &ChatHandler::HandleGOInfoCommand, "", NULL },
{ "move", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectMoveCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectMoveCommand, "", NULL },
{ "near", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectNearCommand, "", NULL }, { "near", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectNearCommand, "", NULL },
{ "state", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectStateCommand, "", NULL }, { "state", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectStateCommand, "", NULL },
+1
View File
@@ -192,6 +192,7 @@ class ChatHandler
bool HandleGameObjectAddCommand(const char* args); bool HandleGameObjectAddCommand(const char* args);
bool HandleGameObjectDeleteCommand(const char* args); bool HandleGameObjectDeleteCommand(const char* args);
bool HandleGOInfoCommand(const char* args);
bool HandleGameObjectMoveCommand(const char* args); bool HandleGameObjectMoveCommand(const char* args);
bool HandleGameObjectNearCommand(const char* args); bool HandleGameObjectNearCommand(const char* args);
bool HandleGameObjectPhaseCommand(const char* args); bool HandleGameObjectPhaseCommand(const char* args);
+5 -1
View File
@@ -879,7 +879,11 @@ enum TrinityStrings
LANG_NPCINFO_ARMOR = 5021, LANG_NPCINFO_ARMOR = 5021,
LANG_CHANNEL_NOT_PUBLIC = 5022, LANG_CHANNEL_NOT_PUBLIC = 5022,
LANG_CHANNEL_PUBLIC_CHANGED = 5023, LANG_CHANNEL_PUBLIC_CHANGED = 5023,
// Room for more Trinity strings 5024-9999 LANG_GOINFO_ENTRY = 5024,
LANG_GOINFO_TYPE = 5025,
LANG_GOINFO_DISPLAYID = 5026,
LANG_GOINFO_NAME = 5027,
// Room for more Trinity strings 5028-9999
// Used for GM Announcements // Used for GM Announcements
LANG_GM_BROADCAST = 6613, LANG_GM_BROADCAST = 6613,
LANG_GM_NOTIFY = 6614, LANG_GM_NOTIFY = 6614,
+31
View File
@@ -2123,6 +2123,37 @@ bool ChatHandler::HandleModifyPhaseCommand(const char* args)
return true; return true;
} }
//show info of gameobject
bool ChatHandler::HandleGOInfoCommand(const char* args)
{
uint32 entry = atoi((char*)args);
uint32 type = 0;
uint32 displayid = 0;
std::string name;
if(!*args)
{
WorldObject * obj = getSelectedObject();
entry = obj->GetEntry();
}
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT `type` `displayid` `name` FROM gameobject_template WHERE entry = %u", entry);
if(!result)
return false;
Field * fields = result->Fetch();
type = fields[0].GetUInt32();
displayid = fields[1].GetUInt32();
name = fields[3].GetString();
PSendSysMessage(LANG_GOINFO_ENTRY, entry);
PSendSysMessage(LANG_GOINFO_TYPE, type);
PSendSysMessage(LANG_GOINFO_DISPLAYID, displayid);
PSendSysMessage(LANG_GOINFO_NAME, name.c_str());
return true;
}
//show info of player //show info of player
bool ChatHandler::HandlePInfoCommand(const char* args) bool ChatHandler::HandlePInfoCommand(const char* args)