Beispiel #1
0
        public override void OnDoubleClick(Mobile from)
        {
            Container pack = from.Backpack;

            if (!(pack != null && Parent == pack))
            {
                from.SendLocalizedMessage(1080058);                   // This must be in your backpack to use it.
                return;
            }
            else if (!(from is PlayerMobile))
            {
                return;
            }

            List <Mobile> pets      = ((PlayerMobile)from).AllFollowers;
            bool          cansummon = true;

            for (int i = 0; i < pets.Count; i++)
            {
                if (pets[i] is BloodGolem || pets[i] is ClayGolem || pets[i] is IronGolem || pets[i] is FireGolem)
                {
                    cansummon = false;
                    break;
                }
            }

            if (!cansummon)
            {
                from.SendMessage("You can only summon one golem at any given time.");
                return;
            }

            BaseCreature bc = null;

            switch (m_Golem)
            {
            case GolemType.Blood: bc = new BloodGolem(); break;

            case GolemType.Clay: bc = new ClayGolem(); break;

            case GolemType.Iron: { from.Target = new InternalTarget(this); } break;

            case GolemType.Fire: bc = new FireGolem(); break;
            }

            if (bc != null)
            {
                bc.SetControlMaster(from);
                from.SendMessage(1192, "You summon the golem.");
                bc.MoveToWorld(new Point3D(from.X + Utility.RandomMinMax(-1, 1), from.Y + Utility.RandomMinMax(-1, 1), from.Z), from.Map);
                Delete();
            }
        }