namespace Turbo.Plugins.LightningMod { public class NecCommandSkeletonsPlugin : AbstractSkillHandler, ISkillHandler { private bool isCast = false; public NecCommandSkeletonsPlugin() : base(CastType.SimpleSkill, CastPhase.AutoCast, CastPhase.UseWpStart, CastPhase.Move, CastPhase.Attack, CastPhase.AttackIdle) { Enabled = true; } public override void Load(IController hud) { base.Load(hud); AssignedSnoPower = Hud.Sno.SnoPowers.Necromancer_CommandSkeletons; CreateCastRule() .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfTrue(ctx => {//毒骷髅不使用 return ctx.Skill.Rune == 3; } ).ThenNoCastElseContinue() .IfPrimaryResourceAmountIsAbove(ctx => 50).ThenContinueElseNoCast() .IfTrue(ctx => {//选中BOSS时 var monster = Hud.Game.SelectedMonster2; return monster?.Rarity == ActorRarity.Boss; }).ThenContinueElseNoCast() .IfTrue(ctx => {//不激活的时候激活一次 return !Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno); }).ThenCastElseContinue() .IfTrue(ctx => { bool cast = false; if (Hud.Game.Me.Powers.UsedLegendaryPowers.BloodsongMail.Active) { if (Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.Necromancer_LandOfTheDead.Sno)) { if (!isCast) { isCast = true; cast = true; } } else { isCast = false; } } else { isCast = false; } return cast; }).ThenCastElseContinue(); } } }