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() .IfTrue(ctx => {//毒骷髅不继续往下了 return ctx.Skill.Rune == 3; } ).ThenNoCastElseContinue() .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfPrimaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfTrue(ctx => {//选中BOSS时 var monster = Hud.Game.SelectedMonster2; if (monster == null) return false; 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 == true)//血歌锁甲 { 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() ; CreateCastRule() .IfTrue(ctx => {//毒骷髅不继续往下了 return ctx.Skill.Rune == 3; } ).ThenNoCastElseContinue() .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfPrimaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfTrue(ctx => Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.Necromancer_CommandSkeletons.Sno)).ThenNoCastElseContinue()//激活时不继续 .IfTrue(ctx => {//选中任意怪时 var monster = Hud.Game.SelectedMonster2; if (monster == null) { return false; } else { bool JessethArms = ctx.Skill.Player.Powers.BuffIsActive(476047);//刀盾套 bool ObsidianRingoftheZodiac = ctx.Skill.Player.Powers.BuffIsActive(402459);//黄道 if (JessethArms && !ObsidianRingoftheZodiac)//骷髅打手+刀盾+没有黄道 = 激活一次 { return true; } } return false; }).ThenCastElseContinue() ; CreateCastRule() .IfTrue(ctx => {//毒骷髅不继续往下了 return ctx.Skill.Rune == 3; } ).ThenNoCastElseContinue() .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfPrimaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfTrue(ctx => {//选中任意怪时 var monster = Hud.Game.SelectedMonster2; if (monster == null) { return false; } else { bool JessethArms = ctx.Skill.Player.Powers.BuffIsActive(476047);//刀盾套 bool ObsidianRingoftheZodiac = ctx.Skill.Player.Powers.BuffIsActive(402459);//黄道 int Rune = ctx.Skill.Rune; if (Rune == 0 && JessethArms && ObsidianRingoftheZodiac)//骷髅打手+刀盾+黄道 = 持续施放 { return true; } } return false; }).ThenCastElseContinue() ; } } }