예제 #1
0
        /// <summary>
        /// Checks the Abilities
        /// </summary>
        public override void CheckAbilities()
        {
            ////load up abilities
            if (Body.Abilities != null && Body.Abilities.Count > 0)
            {
                foreach (Ability ab in Body.Abilities.Values)
                {
                    switch (ab.KeyName)
                    {
                    case Abilities.Intercept:
                    {
                        if (GetPlayerOwner() is GamePlayer player)
                        {
                            //the pet should intercept even if a player is till intercepting for the owner
                            new InterceptEffect().Start(Body, player);
                        }
                        break;
                    }

                    case Abilities.Guard:
                    {
                        if (GetPlayerOwner() is GamePlayer player)
                        {
                            new GuardEffect().Start(Body, player);
                        }
                        break;
                    }

                    case Abilities.Protect:
                    {
                        if (GetPlayerOwner() is GamePlayer player)
                        {
                            new ProtectEffect().Start(player);
                        }
                        break;
                    }

                    case Abilities.ChargeAbility:
                    {
                        if (Body.TargetObject is GameLiving target &&
                            GameServer.ServerRules.IsAllowedToAttack(Body, target, true) &&
                            !Body.IsWithinRadius(target, 500))
                        {
                            ChargeAbility charge = Body.GetAbility <ChargeAbility>();
                            if (charge != null && Body.GetSkillDisabledDuration(charge) <= 0)
                            {
                                charge.Execute(Body);
                            }
                        }
                        break;
                    }
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Checks the Abilities
        /// </summary>
        public override void CheckAbilities()
        {
            ////load up abilities
            if (Body.Abilities != null && Body.Abilities.Count > 0)
            {
                foreach (Ability ab in Body.Abilities.Values)
                {
                    switch (ab.KeyName)
                    {
                    case GS.Abilities.Intercept:
                    {
                        GamePlayer player = Owner as GamePlayer;

                        // the pet should intercept even if a player is till intercepting for the owner
                        new InterceptEffect().Start(Body, player);
                        break;
                    }

                    case GS.Abilities.Guard:
                    {
                        GamePlayer player = Owner as GamePlayer;
                        new GuardEffect().Start(Body, player);
                        break;
                    }

                    case Abilities.ChargeAbility:
                    {
                        if (!Body.IsWithinRadius(Body.TargetObject, 500))
                        {
                            ChargeAbility charge = Body.GetAbility <ChargeAbility>();
                            if (charge != null && Body.GetSkillDisabledDuration(charge) <= 0)
                            {
                                charge.Execute(Body);
                            }
                        }

                        break;
                    }
                    }
                }
            }
        }
 /// <summary>
 /// Checks the Abilities
 /// </summary>
 public override void CheckAbilities()
 {
     //load up abilities
     if (Body.Abilities != null && Body.Abilities.Count > 0)
     {
         foreach (Ability ab in Body.Abilities.Values)
         {
             switch (ab.KeyName)
             {
             case Abilities.ChargeAbility:
                 if (!Body.IsWithinRadius(Body.TargetObject, 500))
                 {
                     ChargeAbility charge = Body.GetAbility <ChargeAbility>();
                     if (charge != null && Body.GetSkillDisabledDuration(charge) <= 0)
                     {
                         charge.Execute(Body);
                     }
                 }
                 break;
             }
         }
     }
 }