Browse Source

support for /itemsearch broker to input item id

Fixes #77
Image 4 years ago
parent
commit
1ae5f04961
1 changed files with 15 additions and 2 deletions
  1. 15 2
      EQ2/source/WorldServer/Items/Items.cpp

+ 15 - 2
EQ2/source/WorldServer/Items/Items.cpp

@@ -617,8 +617,21 @@ vector<Item*>* MasterItemList::GetItems(map<string, string> criteria){
 	int16 minlevel = 0;
 	int16 maxlevel = 0;
 	sint8 itemclass = 0;
-	if(criteria.count("ITEM") > 0)
-		name = criteria["ITEM"];
+	int32 itemID = 0;
+	if (criteria.count("ITEM") > 0)
+	{
+		if (IsNumber(criteria["ITEM"].c_str()))
+		{
+			itemID = atoul(criteria["ITEM"].c_str());
+			Item* itm = GetItem(itemID);
+			vector<Item*>* ret = new vector<Item*>;
+			if (itm)
+				ret->push_back(itm);
+			return ret;
+		}
+		else
+			name = criteria["ITEM"];
+	}
 	if(criteria.count("MINSKILL") > 0)
 		minskill = (int8)ParseIntValue(criteria["MINSKILL"]);
 	if(criteria.count("MAXSKILL") > 0)