Example #1
0
        protected override void CompleteRangeAttack(IList <object> data)
        {
            MapObject   target  = (MapObject)data[0];
            int         damage  = (int)data[1];
            DefenceType defence = (DefenceType)data[2];
            bool        poison  = (bool)data[3];

            if (target == null || !target.IsAttackTarget(this) || target.CurrentMap != CurrentMap || target.Node == null)
            {
                return;
            }

            if (target.Attacked(this, damage, defence) <= 0)
            {
                return;
            }

            if (poison)
            {
                if (Envir.Random.Next(4) > 0)
                {
                    PoisonTarget(target, 2, 5, PoisonType.Slow, 1000);
                }
                else
                {
                    PoisonTarget(target, 4, 5, PoisonType.Frozen, 1000);
                }
            }
            else
            {
                var stats = new Stats
                {
                    [Stat.MaxDC] = damage * -1,
                    [Stat.MaxMC] = damage * -1,
                    [Stat.MaxSC] = damage * -1
                };

                target.AddBuff(BuffType.RhinoPriestDebuff, this, Settings.Second * (5 + damage), stats);
            }
        }
Example #2
0
        protected override void CompleteAttack(IList <object> data)
        {
            MapObject   target  = (MapObject)data[0];
            int         damage  = (int)data[1];
            DefenceType defence = (DefenceType)data[2];



            if (Target == null)
            {
                return;
            }

            List <MapObject> targets = FindAllNearby(12, Target.CurrentLocation);

            for (int i = 0; i < targets.Count; i++)
            {
                target = targets[i];
                if (target == null || !target.IsFriendlyTarget(this) || target.CurrentMap != CurrentMap || target.Node == null)
                {
                    continue;
                }

                if (target.IsFriendlyTarget(this))
                {
                    BuffType type = BuffType.MonsterMACBuff;

                    var stats = new Stats
                    {
                        [Stat.HP] = 1000
                    };

                    target.AddBuff(type, this, Settings.Second * 10, stats);
                    target.OperateTime = 0;
                }
            }
        }
Example #3
0
        protected override void CompleteRangeAttack(IList <object> data)
        {
            MapObject target = (MapObject)data[0];

            if (target == null || target.CurrentMap != CurrentMap || target.Node == null)
            {
                return;
            }

            if (Info.Effect == 0)
            {
                if (target.IsAttackTarget(this))
                {
                    var damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
                    if (damage == 0)
                    {
                        return;
                    }

                    target.Attacked(this, damage, DefenceType.MACAgility);
                }
            }
            else if (Info.Effect == 1)
            {
                if (target.IsFriendlyTarget(this))
                {
                    for (int i = 0; i < target.Buffs.Count; i++)
                    {
                        var buff = target.Buffs[i];

                        if (!buff.Properties.HasFlag(BuffProperty.Debuff))
                        {
                            continue;
                        }

                        target.RemoveBuff(buff.Type);
                    }

                    if (target.PoisonList.Count == 0)
                    {
                        return;
                    }

                    if (target.PoisonList.Any(x => x.PType == PoisonType.DelayedExplosion))
                    {
                        target.ExplosionInflictedTime  = 0;
                        target.ExplosionInflictedStage = 0;

                        target.Broadcast(new S.RemoveDelayedExplosion {
                            ObjectID = target.ObjectID
                        });
                    }

                    target.PoisonList.Clear();
                    target.OperateTime = 0;
                }
            }
            else if (Info.Effect == 2)
            {
                if (target.IsFriendlyTarget(this))
                {
                    var protect = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
                    if (protect == 0)
                    {
                        return;
                    }

                    target.AddBuff(BuffType.PowerBeadBuff, this, Info.AttackSpeed, new Stats {
                        [Stat.MaxAC] = protect, [Stat.MaxMAC] = protect
                    });
                    target.OperateTime = 0;
                }
            }
        }