[cs]public string getObjectType(int objectID)
{
// Filtering Gold is pretty easy:
if (objectID == 1 objectID == 2 objectID == 3)
return "OT_GOLD";
string foundObj = findObject(objectID);
if (foundObj != "")
{
if (foundObj.Contains("CHAR_"))
{
return "OT_CHARACTER";
}
else if (foundObj.Contains("MOB_"))
{
return "OT_MONSTER";
}
else if (foundObj.Contains("_AMMO") foundObj.Contains("_QUIVER"))
{
return "OT_AMMO";
}
else if (foundObj.Contains("ITEM_"))
{
if (foundObj.Contains("ETC_"))
{
if (foundObj.Contains("_POTION"))
{
if (foundObj.Contains("HP_POTION") foundObj.Contains("MP_POTION"))
{
return "OT_POTION";
}
}
else if (foundObj.Contains("_SCROLL"))
{
return "OT_SCROLL";
}
else if (foundObj.Contains("ARCHEMY_"))
{
if (foundObj.Contains("MATERIAL_"))
return "OT_ALCHEMY_MATERIAL";
return "OT_ALCHEMY";
}
else if (foundObj.Contains("TRADE_"))
{
return "OT_TRADE";
}
return "OT_ETC";
}
else if (foundObj.Contains("_RARE"))
{
return "OT_ITEM_RARE";
}
else if (foundObj.Contains("COS_"))
{
if (foundObj.Contains("COS_T_"))
return "OT_COS_T";
if (foundObj.Contains("COS_C_"))
return "OT_COS_C";
return "OT_COS";
}
else if (foundObj.Contains("QSP_"))
{
return "OT_QUEST";
}
else if (foundObj.Contains("EVENT_"))
{
return "OT_EVENT";
}
else if (foundObj.Contains("MALL_"))
{
return "OT_MALL";
}
return "OT_ITEM";
}
}
return "OT_NONE";
}
string findObject(int objectID)
{
foreach (string s in itemData) //itemData ist das String Array, das die Liste beinhaltet
{
if (s.Split(',')[0] == objectID.ToString())
return s.Split(',')[1];
}
return "";
}[/cs]