private static bool CanEquipInsignia(GameSession session, short insigniaId) { string type = InsigniaMetadataStorage.GetConditionType(insigniaId); switch (type) // TODO: handling survivallevel { case "vip": return(session.Player.IsVIP); case "level": return(session.Player.Levels.Level >= 50); case "enchant": return(session.Player.Equips.FirstOrDefault(x => x.Value.Enchants >= 12).Value != null); case "trophy_point": return(session.Player.Trophy[0] + session.Player.Trophy[1] + session.Player.Trophy[2] > 1000); case "title": return(session.Player.Titles.Contains(InsigniaMetadataStorage.GetTitleId(insigniaId))); case "adventure_level": return(session.Player.Levels.PrestigeLevel >= 100); default: Console.WriteLine("Unhandled condition type for insigniaid: " + insigniaId + ", type: " + type); break; } return(false); }
private static bool CanEquipInsignia(GameSession session, short insigniaId) { string type = InsigniaMetadataStorage.GetConditionType(insigniaId); switch (type) // TODO: handling survivallevel { case "vip": return(session.Player.Account.IsVip()); case "level": return(session.Player.Levels.Level >= 50); case "enchant": return(session.Player.Inventory.Equips.FirstOrDefault(x => x.Value.EnchantLevel >= 12).Value != null); case "trophy_point": return(session.Player.TrophyCount[0] + session.Player.TrophyCount[1] + session.Player.TrophyCount[2] > 1000); case "title": return(session.Player.Titles.Contains(InsigniaMetadataStorage.GetTitleId(insigniaId))); case "adventure_level": return(session.Player.Levels.PrestigeLevel >= 100); default: Logger.Warning("Unhandled condition type for insigniaid: {insigniaId}, type: {type}", insigniaId, type); return(false); } }
private bool CanEquipInsignia(GameSession session, short insigniaId) { string type = InsigniaMetadataStorage.GetConditionType(insigniaId); switch (type) // TODO: handling survivallevel and vip { case "level": return(session.Player.Levels.Level >= 50); case "enchant": foreach (KeyValuePair <ItemSlot, Item> item in session.Player.Equips) { if (item.Value.Enchants >= 12) { return(true); } } break; case "trophy_point": return(session.Player.Trophy[0] + session.Player.Trophy[1] + session.Player.Trophy[2] > 1000); case "title": return(session.Player.Titles.Contains(InsigniaMetadataStorage.GetTitleId(insigniaId))); case "adventure_level": return(session.Player.Levels.PrestigeLevel >= 100); default: Console.WriteLine("Unhandled condition type for insigniaid: " + insigniaId + ", type: " + type); break; } return(false); }