public int GetDropItemCount(int instanceLevel, string roleId) { DropItem dropItem = GetDropItem(instanceLevel, roleId); if (dropItem != null) { return(Tang.Tools.RandomWithWeight(100 - dropItem.DropOne - dropItem.DropTwo - dropItem.DropThree, dropItem.DropOne, dropItem.DropTwo, dropItem.DropThree)); } return(0); }
public DropItem GetDropItem(int instanceLevel, string roleId) { DropItem dropItem = DropItemList.Find(item => { if (roleId == item.RoleId && instanceLevel >= item.LvFrom && instanceLevel <= item.LvTo) { return(true); } return(false); }); return(dropItem); }
public int GetDropSoulCount(int instanceLevel, string roleId) { var itemList = DropItemList.AsParallel().Where(item => { return(item.RoleId == roleId && (instanceLevel >= item.LvFrom && instanceLevel <= item.LvTo)); }); if (itemList.Count() > 0) { DropItem dropItem = itemList.First(); return(dropItem.DropSoul); } return(0); }