Example #1
0
        public override void OnThink()
        {
            if (Controlled)
            {
                if (BodyMod != 0)
                {
                    BaseMobileHelper.Return(this, m_Items);
                }

                return;
            }

            if (BodyMod != 0)
            {
                if (Utility.RandomDouble() < ReturnChance)
                {
                    BaseMobileHelper.Return(this, m_Items);
                }
            }
            else
            {
                if (Utility.RandomDouble() < TurnChance)
                {
                    InitOutfit();
                    BaseMobileHelper.Turn(this, m_Items, 0x190, Utility.RandomSkinHue(), NameList.RandomName("male"), "the mystic traveller", true);
                }
            }

            base.OnThink();
        }
Example #2
0
        public override void OnThink()
        {
            if (Controlled || Combatant != null)
            {
                if (BodyMod != 0)
                {
                    BaseMobileHelper.Return(this, m_Items);
                }

                return;
            }

            if (BodyMod != 0)
            {
                if (Utility.RandomDouble() < ReturnChance)
                {
                    BaseMobileHelper.Return(this, m_Items);
                }
            }
            else
            {
                if (Utility.RandomDouble() < TurnChance)
                {
                    InitOutfit();
                    BaseMobileHelper.Turn(this, m_Items, 0x190, Utility.RandomSkinHue(), null, "the mystic llamaherder", true);
                }
            }

            base.OnThink();
        }
Example #3
0
        private void InitOutfit()
        {
            Item hair = BaseMobileHelper.GetRandomHair();

            m_Items.Add(hair);

            if (Utility.RandomBool())
            {
                m_Items.Add(BaseMobileHelper.GetRandomBeard(hair.Hue));
            }

            m_Items.Add(BaseMobileHelper.GetRandomShirt());
            m_Items.Add(BaseMobileHelper.GetRandomPants());
            m_Items.Add(BaseMobileHelper.GetRandomFeet());
        }
Example #4
0
        public override void OnThink()
        {
            if (BodyMod != 0)
            {
                if (CountAliveMinions() == 0 || DateTime.Now > m_NextReturnTime)
                {
                    m_Minions.Clear();

                    BaseMobileHelper.ShowMorphEffect(this);

                    BodyMod = 0;
                }
            }

            if (!OverrideRules || Combatant == null)
            {
                base.OnThink();

                return;
            }

            if (DateTime.Now >= m_NextAbilityTime)
            {
                if (m_AbilityChance > Utility.RandomDouble())
                {
                    if (Utility.RandomBool())
                    {
                        PoisonAttack();
                    }
                    else
                    {
                        SpawnMinions();
                    }
                }

                m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(m_MinTime, m_MaxTime));
            }

            base.OnThink();
        }
Example #5
0
        private void SpawnMinions()
        {
            if (CountAliveMinions() != 0)
            {
                return;
            }

            m_Minions.Clear();

            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int type = Utility.Random(2);

            BaseMobileHelper.ShowMorphEffect(this);

            switch (type)
            {
            default:
            case 0:
                BodyMod = Utility.RandomList(50, 56);
                break;

            case 1:
                BodyMod = 3;
                break;
            }

            int minions = Utility.RandomMinMax(5, 8);

            for (int i = 0; i < minions; ++i)
            {
                BaseCreature minion;

                switch (type)
                {
                default:
                case 0:
                    minion = new Skeleton();
                    break;

                case 1:
                    minion = new Zombie();
                    break;
                }

                minion.Team = this.Team;

                bool validLocation = false;

                Point3D loc = this.Location;

                for (int j = 0; !validLocation && j < 5; ++j)
                {
                    int x = X + Utility.Random(8) - 4;
                    int y = Y + Utility.Random(8) - 4;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                    {
                        loc = new Point3D(x, y, Z);
                    }
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }

                minion.MoveToWorld(loc, map);
                minion.Combatant = Combatant;

                m_Minions.Add(minion);
            }

            m_NextReturnTime = DateTime.Now + TimeSpan.FromSeconds(m_ReturnTime);
        }