예제 #1
0
        protected override void OnTarget(Mobile from, object o)
        {
            IPoint3D p = o as IPoint3D;

            if (o is Mobile)
            {
                mob.SendMessage("You can't plant that on a creature!");
            }
            else if (o is Item && o is TAVFarmSpawn)
            {
                if (cropdel)
                {
                    TAVFarmSpawn FarmCrop = (TAVFarmSpawn)o;
                    if (FarmCrop.Farmer == mob)
                    {
                        FarmCrop.Delete();
                    }
                    else
                    {
                        mob.SendMessage("That is not your crop!");
                    }
                }
                else
                {
                    mob.SendMessage("You can't plant on top of another crop!");
                }
            }
            else if (!cropdel)
            {
                TAVFarmSpawn plantit = new TAVFarmSpawn(pick, mob);
                plantit.MoveToWorld(new Point3D(p.X, p.Y, p.Z), mob.Map);
                TeiravonMobile tm = (TeiravonMobile)mob;
                tm.FarmCrops += 1;
            }
        }
예제 #2
0
            public InternalTimer(TAVFarmSpawn spawner, TimeSpan delay) : base(delay)
            {
                if (spawner.IsFull)
                {
                    Priority = TimerPriority.FiveSeconds;
                }
                else
                {
                    Priority = TimerPriority.OneSecond;
                }

                m_Spawner = spawner;
            }