using System.Linq; namespace Turbo.Plugins.LightningMod { public class NecDecrepify : AbstractSkillHandler, ISkillHandler { public NecDecrepify() : 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_Decrepify; CreateCastRule() .IfCanCastSkill(100, 150, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfPrimaryResourceAmountIsBelow(ctx => 10).ThenNoCastElseContinue() .IfTrue(ctx => { var monster = Hud.Game.SelectedMonster2; return monster != null && !monster.Cursed; }).ThenCastElseContinue() ; } } }