Esempio n. 1
0
        private void SpawnSlaves()
        {
            List <MapObject> targets = FindAllTargets(10, CurrentLocation);

            int count = Math.Min(8, (targets.Count * 5) - SlaveList.Count);

            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;

            for (int i = 0; i < count; i++)
            {
                MonsterObject mob = null;
                switch (Envir.Random.Next(4))
                {
                case 0:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.BehemothMonster1));
                    break;

                case 1:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.BehemothMonster2));
                    break;

                case 2:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.BehemothMonster3));
                    break;
                }

                if (mob == null)
                {
                    continue;
                }

                if (!mob.Spawn(CurrentMap, Front))
                {
                    mob.Spawn(CurrentMap, CurrentLocation);
                }

                mob.Target     = targets[Envir.Random.Next(targets.Count)];
                mob.ActionTime = Envir.Time + 2000;
                SlaveList.Add(mob);
            }
        }
Esempio n. 2
0
        private void SpawnSlaves()
        {
            int count = Math.Min(3, 6 - SlaveList.Count);

            for (int i = 0; i < count; i++)
            {
                MonsterObject mob = null;
                switch (Envir.Random.Next(4))
                {
                case 0:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.GeneralMeowMeowMob1));
                    break;

                case 1:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.GeneralMeowMeowMob2));
                    break;

                case 2:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.GeneralMeowMeowMob3));
                    break;

                case 3:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.GeneralMeowMeowMob4));
                    break;
                }

                if (mob == null)
                {
                    continue;
                }

                if (!mob.Spawn(CurrentMap, Front))
                {
                    mob.Spawn(CurrentMap, CurrentLocation);
                }

                mob.Target     = Target;
                mob.ActionTime = Envir.Time + 2000;
                SlaveList.Add(mob);
            }
        }
Esempio n. 3
0
        private void SpawnSlave()
        {
            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;

            var mob = GetMonster(Envir.GetMonsterInfo(Settings.HornedCommanderMob));

            if (mob == null)
            {
                return;
            }

            if (!mob.Spawn(CurrentMap, Front))
            {
                mob.Spawn(CurrentMap, CurrentLocation);
            }

            mob.Target     = Target;
            mob.ActionTime = Envir.Time;
            SlaveList.Add(mob);
        }
Esempio n. 4
0
        private void SpawnSlave()
        {
            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;

            MonsterObject mob = null;

            mob = GetMonster(Envir.GetMonsterInfo(Settings.TucsonGeneralEgg));

            if (mob == null)
            {
                return;
            }
            if (!mob.Spawn(CurrentMap, Front))
            {
                mob.Spawn(CurrentMap, CurrentLocation);
            }

            mob.Target     = Target;
            mob.ActionTime = Envir.Time + 2000;
            SlaveList.Add(mob);
        }
Esempio n. 5
0
        private void SpawnSlaves()
        {
            int count = System.Math.Min(5, 25 - SlaveList.Count);

            MonsterObject mob = null;
            var           nr  = Envir.Random.Next(3);


            for (int i = 0; i < count; i++)
            {
                switch (nr)
                {
                case 0:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar1Mob));
                    break;

                case 1:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar2Mob));
                    break;

                case 2:
                    mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar3Mob));
                    break;
                }

                if (mob == null)
                {
                    continue;
                }

                mob.Spawn(CurrentMap, Target.CurrentLocation);

                mob.Target     = Target;
                mob.ActionTime = Envir.Time + 2000;
                SlaveList.Add(mob);
            }
        }
Esempio n. 6
0
        public override void Die()
        {
            if (!ChildRock)
            {
                if (Target != null)
                {
                    if (CurrentMap == Target.CurrentMap && Functions.InRange(CurrentLocation, Target.CurrentLocation, 1))
                    {
                        Target.InTrapRock = false;
                    }
                }

                for (int i = SlaveList.Count - 1; i >= 0; i--)
                {
                    if (!SlaveList[i].Dead || SlaveList[i].Node != null)
                    {
                        SlaveList[i].Die();
                        SlaveList.RemoveAt(i);
                    }
                }
            }

            base.Die();
        }
Esempio n. 7
0
        protected override void ProcessTarget()
        {
            if (!CanAttack || Target == null)
            {
                return;
            }

            if (Envir.Random.Next(8) == 1 && SpawnedMobs == false && Envir.Time > SpawnDelay)
            {
                var mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar2Mob));
                SpawnDelay = Envir.Time + 60 * Settings.Second;

                if (mob != null)
                {
                    if (!mob.Spawn(CurrentMap, Front))
                    {
                        mob.Spawn(CurrentMap, CurrentLocation);
                    }

                    mob.Target     = Target;
                    mob.ActionTime = Envir.Time + 2000;
                    SlaveList.Add(mob);
                }

                mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar2Mob));

                if (mob != null)
                {
                    if (!mob.Spawn(CurrentMap, Back))
                    {
                        mob.Spawn(CurrentMap, CurrentLocation);
                    }

                    mob.Target     = Target;
                    mob.ActionTime = Envir.Time + 2000;
                    SlaveList.Add(mob);
                }

                SpawnedMobs = true;
            }
            else
            {
                List <MapObject> targets = FindAllTargets(7, CurrentLocation, false);
                if (targets.Count == 0)
                {
                    return;
                }

                ShockTime = 0;

                Broadcast(new S.ObjectAttack {
                    ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation
                });

                Target = targets[Envir.Random.Next(0, targets.Count)];

                MirDirection pushdir = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
                Target.Attacked(this, GetAttackPower(MinDC, MaxDC), DefenceType.None);
                Broadcast(new S.ObjectEffect {
                    ObjectID = Target.ObjectID, Effect = SpellEffect.Jar2Effect
                });

                if (Envir.Random.Next(25) == 0)
                {
                    Target.ApplyPoison(new Poison {
                        PType = PoisonType.Frozen, Duration = 5, TickSpeed = 1000
                    }, this);
                }
            }

            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;
        }
Esempio n. 8
0
 private void Awake()
 {
     sharedInstance = this;
 }
Esempio n. 9
0
        protected override void ProcessTarget()
        {
            if (!CanAttack || Target == null)
            {
                return;
            }

            if (Envir.Random.Next(8) == 1 && SpawnedMobs == false && Envir.Time > SpawnDelay)
            {
                var mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar1Mob));
                SpawnDelay = Envir.Time + 60 * Settings.Second;

                if (mob != null)
                {
                    if (!mob.Spawn(CurrentMap, Front))
                    {
                        mob.Spawn(CurrentMap, CurrentLocation);
                    }

                    mob.Target     = Target;
                    mob.ActionTime = Envir.Time + 2000;
                    SlaveList.Add(mob);
                }

                mob = GetMonster(Envir.GetMonsterInfo(Settings.Jar1Mob));

                if (mob != null)
                {
                    if (!mob.Spawn(CurrentMap, Back))
                    {
                        mob.Spawn(CurrentMap, CurrentLocation);
                    }

                    mob.Target     = Target;
                    mob.ActionTime = Envir.Time + 2000;
                    SlaveList.Add(mob);
                }

                SpawnedMobs = true;
            }
            else
            {
                List <MapObject> targets = FindAllTargets(1, CurrentLocation, false);
                if (targets.Count == 0)
                {
                    return;
                }

                ShockTime = 0;

                Broadcast(new S.ObjectAttack {
                    ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation
                });
                for (int i = 0; i < targets.Count; i++)
                {
                    Target = targets[i];

                    MirDirection pushdir = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
                    Target.Pushed(this, pushdir, 1 + Envir.Random.Next(3));
                }
            }

            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;
        }
Esempio n. 10
0
        private void SpawnSlaves()
        {
            int count = Math.Min(8, 40 - SlaveList.Count);

            Broadcast(new S.ObjectAttack {
                ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1
            });
            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;

            for (int i = 0; i < count; i++)
            {
                MonsterObject mob = null;
                if (Info.Name.Contains("Ancient"))
                {
                    switch (Envir.Random.Next(4))
                    {
                    case 0:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncBoneMonster1));
                        break;

                    case 1:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncBoneMonster2));
                        break;

                    case 2:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncBoneMonster3));
                        break;

                    case 3:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncBoneMonster4));
                        break;
                    }
                }
                else
                {
                    switch (Envir.Random.Next(4))
                    {
                    case 0:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.BoneMonster1));
                        break;

                    case 1:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.BoneMonster2));
                        break;

                    case 2:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.BoneMonster3));
                        break;

                    case 3:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.BoneMonster4));
                        break;
                    }
                }
                if (mob == null)
                {
                    continue;
                }

                if (!mob.Spawn(CurrentMap, Front))
                {
                    mob.Spawn(CurrentMap, CurrentLocation);
                }

                mob.Target     = Target;
                mob.ActionTime = Envir.Time + 2000;
                SlaveList.Add(mob);
            }
        }
Esempio n. 11
0
        protected override void ProcessTarget()
        {
            if (!CanAttack)
            {
                return;
            }

            ActionTime = Envir.Time + 300;
            AttackTime = Envir.Time + AttackSpeed;

            var targets = FindAllNearby(Info.ViewRange, CurrentLocation, true);

            targets.Shuffle();

            if (targets.Count == 0)
            {
                return;
            }

            for (int i = 0; i < targets.Count; i++)
            {
                if (targets[i].Race != ObjectType.Monster)
                {
                    continue;
                }

                var target = (MonsterObject)targets[i];

                if (target.Info.AI == Info.AI)
                {
                    continue;
                }

                var mob = GetMonster(Envir.GetMonsterInfo(target.Info.Name));

                mob.PetLevel   = target.PetLevel;
                mob.ActionTime = Envir.Time + 1000;

                if (Envir.Random.Next(3) == 0)
                {
                    var attempts = 4;
                    var distance = 5;

                    for (int j = 0; j < attempts; j++)
                    {
                        var location = new Point(CurrentLocation.X + Envir.Random.Next(-distance, distance + 1),
                                                 CurrentLocation.Y + Envir.Random.Next(-distance, distance + 1));

                        if (location == CurrentLocation)
                        {
                            continue;
                        }

                        if (mob.Spawn(CurrentMap, location))
                        {
                            Direction = Functions.DirectionFromPoint(CurrentLocation, target.CurrentLocation);

                            Broadcast(new S.ObjectRangeAttack {
                                ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, TargetID = mob.ObjectID
                            });

                            SlaveList.Add(mob);

                            break;
                        }
                    }
                }

                break;
            }
        }
Esempio n. 12
0
        private void SpawnSlaves()
        {
            int count = Math.Min(8, 40 - SlaveList.Count);

            for (int i = 0; i < count; i++)
            {
                MonsterObject mob = null;
                if (Info.Name.Contains("Ancient"))
                {
                    switch (Envir.Random.Next(7))
                    {
                    case 0:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma1));
                        break;

                    case 1:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma2));
                        break;

                    case 2:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma3));
                        break;

                    case 3:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma4));
                        break;

                    case 4:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma5));
                        break;

                    case 5:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma6));
                        break;

                    case 6:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.AncZuma7));
                        break;
                    }
                }
                else
                {
                    switch (Envir.Random.Next(7))
                    {
                    case 0:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma1));
                        break;

                    case 1:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma2));
                        break;

                    case 2:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma3));
                        break;

                    case 3:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma4));
                        break;

                    case 4:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma5));
                        break;

                    case 5:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma6));
                        break;

                    case 6:
                        mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma7));
                        break;
                    }
                }

                if (mob == null)
                {
                    continue;
                }

                if (!mob.Spawn(CurrentMap, Front))
                {
                    mob.Spawn(CurrentMap, CurrentLocation);
                }

                mob.Target     = Target;
                mob.ActionTime = Envir.Time + 2000;
                SlaveList.Add(mob);
            }
        }