Exemplo n.º 1
0
        private void ChooseBowl_OnTarget(Mobile from, object targeted, object state)
        {
            if (targeted is BaseBowl)
            {
                if (Deleted || !Movable || !from.CheckAlive())
                {
                    return;
                }

                BaseBowl bowl   = (BaseBowl)targeted;
                object[] states = (object[])state;
                Point3D  p      = (Point3D)states[0];

                if (from.Mounted)
                {
                    from.SendMessage("Vous ne pouvez verser la terre en étant sur une monture.");
                }
                else if (!bowl.IsChildOf(from.Backpack))
                {
                    from.SendMessage("{0} doit être dans votre sac.", bowl is EarthBag ? "La poche" : "Le pot");
                }
                else if (bowl.HasEarth)
                {
                    from.SendMessage("{0} doit être vide.", bowl is EarthBag ? "La poche" : "Le pot");
                }
                else
                {
                    if (ContainsPoint(p))
                    {
                        from.SendMessage("Il n'y a pas assez de terre ici. Essayez ailleurs.");
                    }
                    else
                    {
                        TileType  tile = (TileType)states[1];
                        EarthType earthType;

                        switch (tile)
                        {
                        case TileType.Desert: earthType = EarthType.Desert; break;

                        case TileType.Forest: earthType = EarthType.Forest; break;

                        case TileType.Jungle: earthType = EarthType.Jungle; break;

                        case TileType.Swamp: earthType = EarthType.Swamp; break;

                        default: earthType = EarthType.Dirt; break;
                        }

                        bowl.AddEarth(earthType);
                        from.SendMessage("Vous remplissez {0} de terre.", bowl is EarthBag ? "la poche" : "le pot");

                        AddPoint(p);
                        new InternalTimer(p).Start();
                    }
                }
            }
            else
            {
                from.SendMessage("Vous devez choisir un pot ou une poche.");
            }
        }
Exemplo n.º 2
0
        public void ChooseTarget_OnTarget(Mobile from, object targeted)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (targeted is BaseBowl)
            {
                BaseBowl bowl = targeted as BaseBowl;

                if (!bowl.HasEarth)
                {
                    from.SendMessage("Le pot est vide.");
                }
                else if (bowl.HasPlant)
                {
                    from.SendMessage("Il y a déja une graine dans ce pot.");
                }
                else
                {
                    if (this.PlantType == PlantType.None)
                    {
                        from.SendMessage("Cette graine n'est pas valide.");
                    }
                    else
                    {
                        bowl.AddSeed(this);
                        from.SendMessage("Vous plantez la graine dans le pot.");
                    }
                }
                return;
            }
            if (targeted is StaticTarget)
            {
                from.SendMessage("Vous devez pointez vers de la terre !");
            }
            else if (targeted is LandTarget)
            {
                LandTarget point = (LandTarget)targeted;

                //Terre Fertile
                if ((point.TileID > 8) && (point.TileID < 22))
                {
                    /*m_seed.Name = m_seed.Nom;
                     * m_seed.Planted = true;
                     * m_seed.Owner = from;
                     * m_seed.ItemID = m_seed.ArtID;
                     * m_seed.Dirt = false;
                     * int seconds = 172800 - (from.Skills.Agriculture.Fixed * 800);
                     * TimeSpan duration = TimeSpan.FromSeconds(seconds);
                     * m_seed.m_evoTimer = new AgriEvoTimer(from, m_seed, duration, duration);
                     * m_seed.m_evoTimer.Start();
                     * m_seed.m_waterTimer = new AgriWaterTimer(from, m_seed, TimeSpan.FromHours(6), TimeSpan.FromHours(6));
                     * m_seed.m_waterTimer.Start();
                     * m_seed.MoveToWorld(point.Location);
                     * m_seed.Movable = false;*/
                }
                //Dirt
                else if ((point.TileID > 112) && (point.TileID < 141))
                {
                    /*m_seed.Name = m_seed.Nom;
                     * m_seed.Planted = true;
                     * m_seed.Owner = from;
                     * m_seed.ItemID = m_seed.ArtID;
                     * m_seed.Dirt = true;
                     * int seconds = 172800 - (from.Skills.Agriculture.Fixed * 800);
                     * TimeSpan duration = TimeSpan.FromSeconds(seconds);
                     * m_seed.m_evoTimer = new AgriEvoTimer(from, m_seed, duration, duration);
                     * m_seed.m_evoTimer.Start();
                     * m_seed.m_waterTimer = new AgriWaterTimer(from, m_seed, TimeSpan.FromHours(6), TimeSpan.FromHours(6));
                     * m_seed.m_waterTimer.Start();
                     * m_seed.MoveToWorld(point.Location);
                     * m_seed.Movable = false;*/
                }
                else
                {
                    from.SendMessage("Vous devez pointez vers de la terre !");
                }
            }
            else if (targeted is Mobile)
            {
                from.SendMessage("Vous devez pointez vers de la terre !");
            }
            else if (targeted is Item)
            {
                from.SendMessage("Vous devez pointez vers de la terre !");
            }
            else
            {
                from.SendMessage("Vous devez choisir un pot ou le sol.");
            }
        }