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 committed 2010-03-01 19:28:21 -06:00
1 parent 22d7ceaabb
commit 81f6779102
7 files changed
+48 -1

No files matched your search

+31
View File
@@ -2123,6 +2123,37 @@ bool ChatHandler::HandleModifyPhaseCommand(const char* args)
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
bool ChatHandler::HandlePInfoCommand(const char* args)