Example #1
0
        public override bool activate()
        {
            // Get the current Skill in the hotbar slot we want to use
            SNOPower currentlyEquippedSkillInHotbarSlot = Zeta.Game.ZetaDia.CPlayer.GetPowerForSlot(this.hotbarSlot);

            // Check if Skill in slot is off cooldown, out of resource, or slot is empty so we can switch it
            PowerManager.CanCastFlags castFlag = PowerManager.CanCastFlags.None;
            bool wasSet      = false;
            bool offCooldown = PowerManager.CanCast(currentlyEquippedSkillInHotbarSlot, out castFlag);

            if (offCooldown || castFlag == PowerManager.CanCastFlags.PowerUnusableGeneric || currentlyEquippedSkillInHotbarSlot == SNOPower.None)
            {
                // Set the skill
                Zeta.Game.ZetaDia.Me.SetActiveSkill(this.getSnoPower(), this.getRuneId(), this.getHotbarSlot());
                Zeta.Game.ZetaDia.Actors.Update();
                // Check to see if it actually was set
                if (Zeta.Game.ZetaDia.CPlayer.GetPowerForSlot(this.getHotbarSlot()) == this.getSnoPower() && Zeta.Game.ZetaDia.CPlayer.GetRuneIndexForSlot(this.getHotbarSlot()) == this.getRuneId())
                {
                    wasSet = true;
                }
            }
            return(wasSet);
        }
Example #2
0
        //Resets Properties
        internal void SetupAbilityForUse()
        {
            MinimumRange=Range;
                 TargetPosition_=Vector3.Zero;
                 TargetRAGUID_=-1;
                 WaitLoopsBefore_=this.WaitVars.PreLoops;
                 WaitLoopsAfter_=this.WaitVars.PostLoops;

                 CanCastFlags=PowerManager.CanCastFlags.None;
                 SuccessUsed_=null;

                 //Check Clustering First.. we verify that cluster condition was last to be tested.

                 //Cluster Target -- Aims for Centeroid Unit
                 if (this.UsageType.HasFlag(AbilityUseType.ClusterTarget)&&CheckClusterConditions(this.ClusterConditions)) //Cluster ACDGUID
                 {
                        TargetRAGUID_=Bot.Combat.Clusters(this.ClusterConditions)[0].GetNearestUnitToCenteroid().AcdGuid.Value;
                        return;
                 }
                 //Cluster Location -- Aims for Center of Cluster
                 if (this.UsageType.HasFlag(AbilityUseType.ClusterLocation)&&CheckClusterConditions(this.ClusterConditions)) //Cluster Target Position
                 {
                      TargetPosition_=(Vector3)Bot.Combat.Clusters(this.ClusterConditions)[0].Midpoint;
                        return;
                 }
                 //Cluster Target Nearest -- Gets nearest unit in cluster as target.
                 if (this.UsageType.HasFlag(AbilityUseType.ClusterTargetNearest)&&CheckClusterConditions(this.ClusterConditions)) //Cluster Target Position
                 {
                      TargetRAGUID_=Bot.Combat.Clusters(this.ClusterConditions)[0].ListUnits[0].AcdGuid.Value;
                      return;
                 }

                 if (this.UsageType.HasFlag(AbilityUseType.Location)) //Current Target Position
                        TargetPosition_=Bot.Target.CurrentTarget.Position;
                 else if (this.UsageType.HasFlag(AbilityUseType.Self)) //Current Bot Position
                        TargetPosition_=Bot.Character.Position;
                 else if (this.UsageType.HasFlag(AbilityUseType.ZigZagPathing)) //Zig-Zag Pathing
                 {
                        Bot.Combat.vPositionLastZigZagCheck=Bot.Character.Position;
                        if (Bot.Class.ShouldGenerateNewZigZagPath())
                             Bot.Class.GenerateNewZigZagPath();

                        TargetPosition_=Bot.Combat.vSideToSideTarget;
                 }
                 else if (this.UsageType.HasFlag(AbilityUseType.Target)) //Current Target ACDGUID
                        TargetRAGUID_=Bot.Target.CurrentTarget.AcdGuid.Value;
        }