aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authorp0wer <none@none>2010-03-01 19:28:21 -0600
committerp0wer <none@none>2010-03-01 19:28:21 -0600
commit81f6779102561df0719b0471b101bb5c15d2609a (patch)
treea78192d7f7d3ef61b70dc936d39e5e4ae58fb48d /src/game/Level2.cpp
parent22d7ceaabb13d86d30986fe37808c38b98a74ff6 (diff)
Add command similar to pinfo but for gameobjects.
Displays Entry, Type, DisplayId, and Name. Created in response to issue #768. --HG-- branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 62fc94b541a..56b28aabd9b 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -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)