using System.Linq; namespace Turbo.Plugins.LightningMod { public class CrusaderAkaratsChampionPlugin : AbstractSkillHandler, ISkillHandler { public CrusaderAkaratsChampionPlugin() : base(CastType.SimpleSkill, CastPhase.AutoCast, CastPhase.Collect, CastPhase.Move, CastPhase.Attack) { Enabled = false; } public override void Load(IController hud) { base.Load(hud); AssignedSnoPower = Hud.Sno.SnoPowers.Crusader_AkaratsChampion; CreateCastRule()//一般规则 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastSimple().ThenContinueElseNoCast() .IfTrue(ctx => !isSanGuang()).ThenContinueElseNoCast() .IfTrue(ctx => { bool isNoFatal = !ctx.Skill.Player.Powers.BuffIsActive(hud.Sno.SnoPowers.Crusader_Passive_Indestructible.Sno, 0) &&//铁胆钢心 ctx.Skill.Rune == 3;//先知化身 return isNoFatal ? true : !ctx.Skill.Player.Powers.BuffIsActive(Hud.Sno.SnoPowers.Crusader_SteedCharge.Sno); }).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 100, ctx => 1).ThenContinueElseNoCast() .IfPrimaryResourcePercentageIsBelow(20).ThenCastElseContinue() .IfEliteOrBossIsNearby(ctx => 40).ThenCastElseContinue() .IfTrue(ctx => { var set = Hud.Game.Me.GetSetItemCount(580748);// 阿克汗套 return (ctx.Skill.Player.Stats.CooldownReduction >= 0.75 || (ctx.Skill.Player.Stats.CooldownReduction >= 0.5 && (set >= 4 || ctx.Hud.Game.Me.Powers.BuffIsActive(402459) || ctx.Hud.Game.Me.Powers.BuffIsActive(ctx.Hud.Sno.SnoPowers.AkaratsAwakening.Sno))));//CDR大于75或(50且带了黄道或阿卡拉特顿悟或阿克汗4件) }).ThenContinueElseNoCast() .IfBuffIsAboutToExpire(100, 200).ThenCastElseContinue() ; CreateCastRule()//三光规则 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastSimple().ThenContinueElseNoCast() .IfSpecificBuffIsActive(Hud.Sno.SnoPowers.Crusader_SteedCharge).ThenNoCastElseContinue()//骑马时 .IfTrue(ctx => isSanGuang()).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 30, ctx => 1).ThenContinueElseNoCast() .IfTrue(ctx => { return ctx.Skill.Player.Powers.BuffIsActive(hud.Sno.SnoPowers.ConventionOfElements.Sno, 4); }).ThenContinueElseNoCast() .IfBuffIsAboutToExpire(100, 200).ThenCastElseContinue() ; } private bool isSanGuang() { bool isHeavensFury = Hud.Game.Me.Powers.UsedCrusaderPowers.HeavensFury?.Rune == 4; //天堂之火 bool isAegisofValor = Hud.Game.Me.GetSetItemCount(192736) >= 6;//勇气6件套 bool isFateoftheFell = Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.FateOfTheFell.Sno, 0);//妖邪必败 bool isConventionOfElements = Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.ConventionOfElements.Sno, 0);//元素戒指 return isAegisofValor && isHeavensFury && isFateoftheFell && isConventionOfElements; } } }