private static (IEnumerable <SkillViewModel> selectedSkills, SkillViewModel weakenSkill, SkillViewModel inanimateSkill) GetPsychopathSkills(Player bot) { var allMySkills = SkillProcedures.GetSkillViewModelsOwnedByPlayer(bot.Id).Where(s => s.StaticSkill.ExclusiveToFormSourceId == null && s.StaticSkill.ExclusiveToItemSourceId == null); var selectedSkills = new List <SkillViewModel>(); SkillViewModel weakenSkill = null; var inanimateSkill = allMySkills.FirstOrDefault(s => s.MobilityType == PvPStatics.MobilityInanimate || s.MobilityType == PvPStatics.MobilityPet); if (inanimateSkill != null) { selectedSkills.Add(inanimateSkill); } if (bot.FirstName.Contains("Evil ") || bot.FirstName.Contains("Ruthless ") || bot.FirstName.Contains("Eternal ")) { weakenSkill = allMySkills.FirstOrDefault(s => s.StaticSkill.Id == PvPStatics.Spell_WeakenId); if (weakenSkill != null) { selectedSkills.Add(weakenSkill); } } if (bot.FirstName.Contains("Eternal ")) { var animateSkill = allMySkills.FirstOrDefault(s => s.MobilityType == PvPStatics.MobilityFull); if (animateSkill != null) { selectedSkills.Add(animateSkill); } } return(selectedSkills, weakenSkill, inanimateSkill); }
public static IEnumerable <SkillViewModel> AvailableSkills(Player attacker, Player target, bool includeArchived) { IEnumerable <SkillViewModel> output = SkillProcedures.GetSkillViewModelsOwnedByPlayer(attacker.Id); if (!includeArchived) { output = output.Where(s => !s.dbSkill.IsArchived); } // filter out spells that you can't use on your target if (FriendProcedures.PlayerIsMyFriend(attacker, target) || target.BotId < AIStatics.ActivePlayerBotId) { // do nothing, all spells are okay } // both players are in protection; only allow animate spells else if (attacker.GameMode == (int)GameModeStatics.GameModes.Protection && target.GameMode == (int)GameModeStatics.GameModes.Protection) { output = output.Where(s => s.MobilityType == PvPStatics.MobilityFull); } // attack or the target is in superprotection and not a friend or bot; no spells work else if (target.GameMode == (int)GameModeStatics.GameModes.Superprotection || (attacker.GameMode == (int)GameModeStatics.GameModes.Superprotection && target.BotId == AIStatics.ActivePlayerBotId)) { output = output.Where(s => s.MobilityType == "NONEXISTANT"); } // either player invisible; no spells work else if (target.GameMode == (int)GameModeStatics.GameModes.Invisible || attacker.GameMode == (int)GameModeStatics.GameModes.Invisible) { output = output.Where(s => s.MobilityType == "NONEXISTENT"); } // filter out MC spells for bots if (target.BotId < AIStatics.ActivePlayerBotId) { output = output.Where(s => s.MobilityType != PvPStatics.MobilityMindControl); } // only show inanimates for rat thieves if (target.BotId == AIStatics.MaleRatBotId || target.BotId == AIStatics.FemaleRatBotId) { output = output.Where(s => s.MobilityType == PvPStatics.MobilityInanimate); } // only show Weaken for valentine if (target.BotId == AIStatics.ValentineBotId) { output = output.Where(s => s.dbSkill.SkillSourceId == PvPStatics.Spell_WeakenId); } // only bimbo spell works on nerd mouse boss if (target.BotId == AIStatics.MouseNerdBotId) { output = output.Where(s => s.StaticSkill.Id == BossProcedures_Sisters.BimboSpellSourceId); } // only nerd spell works on nerd bimbo boss if (target.BotId == AIStatics.MouseBimboBotId) { output = output.Where(s => s.StaticSkill.Id == BossProcedures_Sisters.NerdSpellSourceId); } // Vanquish and weaken only works against dungeon demons if (target.BotId == AIStatics.DemonBotId) { output = output.Where(s => s.StaticSkill.Id == PvPStatics.Dungeon_VanquishSpellSourceId || s.StaticSkill.Id == PvPStatics.Spell_WeakenId); } // Filter out Vanquish when attacking non-Dungeon Demon player if (target.BotId != AIStatics.DemonBotId) { output = output.Where(s => s.StaticSkill.Id != PvPStatics.Dungeon_VanquishSpellSourceId); } // Fae-In-A-Bottle only works against Narcissa if (target.BotId == AIStatics.FaebossBotId) { output = output.Where(s => s.StaticSkill.Id == BossProcedures_FaeBoss.SpellUsedAgainstNarcissaSourceId); } // Filter out Fae-In-A-Bottle when attacking non-Narcissa player if (target.BotId != AIStatics.FaebossBotId) { output = output.Where(s => s.StaticSkill.Id != BossProcedures_FaeBoss.SpellUsedAgainstNarcissaSourceId); } // only inanimate and animal spells work on minibosses, donna, and lovebringer if (AIStatics.IsAMiniboss(target.BotId) || target.BotId == AIStatics.MotorcycleGangLeaderBotId || target.BotId == AIStatics.BimboBossBotId) { output = output.Where(s => s.MobilityType == PvPStatics.MobilityInanimate || s.MobilityType == PvPStatics.MobilityPet); } return(output); }