Esempio n. 1
0
        public override void OnDeath(Container c)
        {
            Mobile       m  = this.FindMostRecentDamager(false);
            PlayerMobile pm = null;

            if (m is PlayerMobile)
            {
                pm = m as PlayerMobile;
            }
            else if (m is BaseCreature)
            {
                BaseCreature bc = m as BaseCreature;

                if (bc.Controlled == true)
                {
                    pm = bc.ControlMaster as PlayerMobile;
                }
            }

            if (pm != null)
            {
                AlfredsRat newrat = new AlfredsRat();

                Point3D nrpos = this.Location;
                newrat.Home      = this.Home;
                newrat.RangeHome = this.RangeHome;

                nrpos.X += Utility.Random(this.RangeHome) - 2 * this.RangeHome;
                nrpos.Y += Utility.Random(this.RangeHome) - 2 * this.RangeHome;


                newrat.MoveToWorld(nrpos, Map.Trammel);

                pm.Say("You can't believe, another rat just appeared");
            }

            base.OnDeath(c);
        }
Esempio n. 2
0
        public override void MoveToWorld(Point3D newLocation, Map map)
        {
            base.MoveToWorld(newLocation, map);

            /* Create the rabbits */
            Point3D pt     = newLocation,
                    ratpos = new Point3D();

            int i;

            for (i = 0; i < 5; i++)
            {
                ratpos.X = pt.X + Utility.Random(6) - 3;
                ratpos.Y = pt.Y + Utility.Random(6) - 3;
                ratpos.Z = pt.Z;

                AlfredsRat ar = new AlfredsRat();
                ar.Home      = pt;
                ar.RangeHome = 4;
                ar.MoveToWorld(ratpos, Map.Trammel);
            }

            Brian b = new Brian();

            pt.X += 6;
            b.MoveToWorld(pt, Map.Trammel);

            Charly c = new Charly();

            pt.X += 6;
            c.MoveToWorld(pt, Map.Trammel);

            David d = new David();

            pt.X += 6;
            d.MoveToWorld(pt, Map.Trammel);
        }