namespace Turbo.Plugins.LightningMod { public class NecSkeletalMagePlugin : AbstractSkillHandler, ISkillHandler { public NecSkeletalMagePlugin() : base(CastType.BuffSkill, CastPhase.AutoCast, CastPhase.Attack, CastPhase.AttackIdle) { Enabled = false; } public override void Load(IController hud) { base.Load(hud); AssignedSnoPower = Hud.Sno.SnoPowers.Necromancer_SkeletalMage; CreateCastRule() .IfTrue(ctx => ctx.Skill.Rune == 4).ThenContinueElseNoCast()//弓箭手符文 .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfPrimaryResourceAmountIsAbove(ctx => (int)(40 - 40 * Hud.Game.Me.Stats.ResourceCostReduction) + 1).ThenContinueElseNoCast()//确保有保底能量 .IfEliteOrBossIsNearby(ctx => 55).ThenContinueElseNoCast()//附近55码内有精英或BOSS .IfSpecificBuffIsActive(Hud.Sno.SnoPowers.AquilaCuirass, 1).ThenContinueElseNoCast()//天鹰激活 .IfSpecificBuffIsActive(Hud.Sno.SnoPowers.Necromancer_SkeletalMage, 6).ThenNoCastElseContinue()//骷髅法师激活 .IfSpecificBuffIsAboutToExpire(Hud.Sno.SnoPowers.Necromancer_SkeletalMage, 3, 100, 500).ThenCastElseContinue()//弓箭手BUFF即将过期(0.5秒以内) ; CreateCastRule() .IfTrue(ctx => ctx.Skill.Rune == 1).ThenContinueElseNoCast()//精魂灌注符文 有精英时 .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfEnoughMonstersNearby(ctx => 55, ctx => 1).ThenContinueElseNoCast()//至少周围要有怪 .IfPrimaryResourceAmountIsAbove(ctx => (int)(40 - 40 * Hud.Game.Me.Stats.ResourceCostReduction) + 1).ThenContinueElseNoCast()//确保有保底能量 .IfTrue(ctx => { int skeletons = 2; if (ctx.Hud.Game.ActorQuery.IsEliteOrBossCloserThan(55))//有精英时 { skeletons = 2; } else if (ctx.Skill.Player.Density.GetDensity(55) <= 15)//没有精英且小于等于15个怪时 { skeletons = 2; } else//没有精英且大于15个怪时 { skeletons = 8; } var buff = Hud.Game.Me.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_SkeletalMage.Sno); return (buff?.IconCounts[6] < skeletons);//小于指定骷髅数施放 }).ThenCastElseContinue()//优先保证骷髅最低数量再保证骷髅质量 .IfPrimaryResourcePercentageIsAbove(90).ThenCastElseContinue()//满能量时施放 ; } } }