通过命令来调出物品的属性,比较老的代码,适用于魔兽世界私服服务端的Mangos服务端代码
diff --git a/src/game/Chat.cpp b/src/game/Chat.cppindex 6572162..7180bc2 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -707,7 +707,6 @@ ChatCommand * ChatHandler::getCommandTable()
{ "cometome", SEC_ADMINISTRATOR, false, &ChatHandler::HandleComeToMeCommand, "", NULL },
+ { "kan", SEC_PLAYER, false, &ChatHandler::HandleWorldKan, "", NULL }, //装备查看命令
{ "damage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDamageCommand, "", NULL },
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
{ "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 1e58baf..ad6754d 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -274,7 +274,6 @@ class ChatHandler
+ bool HandleWorldKan(const char* args); //查看装备命令
bool HandleModifyRepCommand(const char* args);
bool HandleModifyArenaCommand(const char* args);
bool HandleModifyPhaseCommand(const char* args);
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 5b257a0..cf90946 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -6011,46 +6011,6 @@ bool ChatHandler::HandleWorldCast(const char* args) //
+bool ChatHandler::HandleWorldKan(const char* args)
+{
+ if(!*args)
+ return false;
+
+ std::wstring wnamepart;
+ uint32 itemId = 0;
+
+ char* cId = extractKeyFromLink((char*)args,"Hitem");
+ if(!cId)
+ return false;
+ itemId = atol(cId);
+
+ wstrToLower(wnamepart);
+
+ ItemPrototype const *pProto = sObjectMgr.GetItemPrototype( itemId );
+ if(!pProto)
+ {
+ PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ else if(pProto)
+ {
+ std::string name = pProto->Name1;
+
+ if(name.empty()) //当机这里
+ PSendSysMessage("No name");
+ else if (Utf8FitTo(name, wnamepart))
+ {
+ if (m_session)
+ PSendSysMessage(LANG_ITEM_LIST_CHAT, itemId, itemId, name.c_str());
+ else
+ PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemId, name.c_str());
+ }
+
+ }
+ return true;
+}//装备查看命令(试衣间)
+
bool ChatHandler::HandleCastDistCommand(const char* args)
{
if(!*args)
|