private string DoBossItem(GameUser user, BossItem bossItem, int randId) { string prizeItemMsg = string.Empty; ////筛选物品 var itemInfoList = new ConfigCacheSet <ItemBaseInfo>().FindAll(m => m.ItemType == bossItem.Type && m.MedicineLv == bossItem.ItemLv); if (itemInfoList.Count > 0) { for (int i = 0; i < bossItem.Num; i++) { ItemBaseInfo itemInfo = itemInfoList[RandomUtils.GetRandom(0, itemInfoList.Count)]; if (itemInfo == null) { continue; } UserItemHelper.AddUserItem(user.UserID, itemInfo.ItemID, 1); if (prizeItemMsg.Length > 0) { prizeItemMsg += " "; } prizeItemMsg += string.Format(LanguageManager.GetLang().St5405_CombatNum, itemInfo.ItemName, 1); } } return(prizeItemMsg); }
internal Boss(BossItem boss, int order) { Order = order; Name = boss.Mirage; Hp = boss.Hp; Elemental = new ElementalResistances { Fire = boss.Fire, Ice = boss.Ice, Thunder = boss.Thunder, Aero = boss.Aero, Water = boss.Water, Earth = boss.Earth, Light = boss.Light, Dark = boss.Dark }; Ailment = new AilmentResistances { Poison = boss.Poison, Confuse = boss.Confuse, Sleep = boss.Sleep, Blind = boss.Blind, Oblivion = boss.Oblivion, Berserk = boss.Berserk, Slow = boss.Slow, Doom = boss.Doom }; Exp = boss.Exp; Gil = boss.Gil; Drops = boss.Drop; Notes = boss.Notes; }
private string DoBossItem(GameUser user, BossItem bossItem, int randId) { string prizeItemMsg = string.Empty; //筛选物品 var itemInfoList = new ConfigCacheSet <ItemBaseInfo>().FindAll(m => { bool result = false; if (m.ItemType == bossItem.Type) { if (m.ItemID == bossItem.ItemId) { return(true); } if (m.ItemType == ItemType.TuZhi) { result = m.MedicineLv <= bossItem.ItemLv; } else { if (bossItem.ItemLv > 0 && bossItem.Quality > 0) { result = m.DemandLv == bossItem.ItemLv && (short)m.QualityType == bossItem.Quality; } else if (bossItem.ItemLv > 0) { result = m.DemandLv == bossItem.ItemLv; } else if (bossItem.Quality > 0) { result = (short)m.QualityType == bossItem.Quality; } } } return(result); }); if (itemInfoList.Count > 0) { for (int i = 0; i < bossItem.Num; i++) { ItemBaseInfo itemInfo = itemInfoList[RandomUtils.GetRandom(0, itemInfoList.Count)]; if (itemInfo == null) { continue; } UserItemHelper.AddUserItem(user.UserID, itemInfo.ItemID, 1); if (prizeItemMsg.Length > 0) { prizeItemMsg += " "; } prizeItemMsg += string.Format("{0}*{1}", itemInfo.ItemName, 1); } } return(prizeItemMsg); }