Esempio n. 1
0
        protected override IEnumerable <RunStatus> Execute(object context)
        {
            RoutineContext ctx = context as RoutineContext;

            if (ctx != null)
            {
                if (ctx.SkillNames.Contains(SpellName))
                {
                    Gw2Skill spell = ctx.GetSpell(SpellName);
                    if (spell != null)
                    {
                        bool currentCondition = Condition == null || Condition(ctx);
                        if (currentCondition)
                        {
                            if (spell.IsReady)
                            {
                                Logger.WriteVerbose("Casting {0} on position {1}.", spell.Name, Vector3.Zero);
                                SpellManager.Cast(spell);
                                return(new List <RunStatus>()
                                {
                                    RunStatus.Success
                                });
                            }
                        }
                    }
                }
            }
            return(new List <RunStatus>()
            {
                RunStatus.Failure
            });
        }
Esempio n. 2
0
        protected override IEnumerable <RunStatus> Execute(object context)
        {
            RoutineContext ctx = context as RoutineContext;

            if (ctx != null)
            {
                if (ctx.CurrentWeapon != WeaponType)
                {
                    bool currentCondition = Condition == null || Condition(ctx);
                    if (currentCondition)
                    {
                        Logger.WriteVerbose("Switching weapons from {0} to {1}.", ctx.CurrentWeapon.ToString(), this.WeaponType.ToString());
                        BuddyGw.Me.SwitchWeapons();
                        return(new List <RunStatus>()
                        {
                            RunStatus.Success
                        });
                    }
                }
            }
            return(new List <RunStatus>()
            {
                RunStatus.Failure
            });
        }