示例#1
0
        protected virtual void FinishEffect(Point3D p, Map map, Mobile from)
        {
            from.RevealingAction();

            int     count   = Utility.RandomMinMax(1, 6);
            int     onBoat  = 0;
            string  monster = "";
            Point3D SpawnAt = p;

            switch (Utility.Random(12))
            {
            case 0: monster = "AquaticGhoul"; SpawnAt = from.Location; onBoat = 1; break;

            case 1: monster = "SeaWeeder"; SpawnAt = from.Location; onBoat = 1; break;

            case 2: monster = "SeaSnake"; break;

            case 3: monster = "WaterBeetle"; break;

            case 4: monster = "WaterStrider"; break;

            case 5: monster = "OilSlick"; break;

            case 6: monster = "FloatingEye"; break;

            case 7: monster = "SeaTroll"; SpawnAt = from.Location; onBoat = 1; break;

            case 8: monster = "WaterElemental"; break;

            case 9: monster = "GiantCrab"; break;

            case 10: monster = "GiantLamprey"; break;

            case 11: monster = "Locathah"; SpawnAt = from.Location; onBoat = 1; break;
            }

            for (int i = 0; map != null && i < count; ++i)
            {
                BaseCreature spawn = new AquaticGhoul();

                if (monster == "AquaticGhoul")
                {
                    spawn = new AquaticGhoul();
                }
                else if (monster == "SeaWeeder")
                {
                    spawn = new SeaWeeder();
                }
                else if (monster == "SeaSnake")
                {
                    spawn = new SeaSnake();
                }
                else if (monster == "WaterBeetle")
                {
                    spawn = new WaterBeetle();
                }
                else if (monster == "WaterStrider")
                {
                    spawn = new WaterStrider();
                }
                else if (monster == "OilSlick")
                {
                    spawn = new OilSlick();
                }
                else if (monster == "FloatingEye")
                {
                    spawn = new FloatingEye();
                }
                else if (monster == "SeaTroll")
                {
                    spawn = new SeaTroll();
                }
                else if (monster == "WaterElemental")
                {
                    spawn = new WaterElemental();
                }
                else if (monster == "GiantCrab")
                {
                    spawn = new GiantCrab();
                }
                else if (monster == "GiantLamprey")
                {
                    spawn = new GiantLamprey();
                }
                else if (monster == "Locathah")
                {
                    spawn = new Locathah();
                }

                Spawn(SpawnAt, map, spawn, onBoat);

                spawn.WhisperHue = 999;                 // SO TASK MANAGER DELETES THEM EVENTUALLY
                spawn.Combatant  = from;
            }

            Delete();
        }
        public virtual void Fill_OnTarget(Mobile from, object targ)
        {
            if (!IsEmpty || !Fillable || !ValidateUse(from, false))
            {
                return;
            }

            if (targ is BaseBeverage)
            {
                BaseBeverage bev = (BaseBeverage)targ;

                if (bev.IsEmpty || !bev.ValidateUse(from, true))
                {
                    return;
                }

                this.Content  = bev.Content;
                this.Poison   = bev.Poison;
                this.Poisoner = bev.Poisoner;

                if (bev.Quantity > this.MaxQuantity)
                {
                    this.Quantity = this.MaxQuantity;
                    bev.Quantity -= this.MaxQuantity;
                }
                else
                {
                    this.Quantity += bev.Quantity;
                    bev.Quantity   = 0;
                }
            }
            else if (targ is BaseWaterContainer)
            {
                BaseWaterContainer bwc = targ as BaseWaterContainer;

                if (Quantity == 0 || (this.Content == BeverageType.Water && !this.IsFull))
                {
                    int I_Need = Math.Min((MaxQuantity - Quantity), bwc.Quantity);

                    if ((I_Need > 0) && !bwc.IsEmpty && !IsFull)
                    {
                        bwc.Quantity -= I_Need;
                        Quantity     += I_Need;
                        Content       = BeverageType.Water;

                        from.PlaySound(0x4E);
                    }
                }
            }
            else if (targ is Item)
            {
                Item         item = (Item)targ;
                IWaterSource src;

                src = (item as IWaterSource);

                if (src == null && item is AddonComponent)
                {
                    src = (((AddonComponent)item).Addon as IWaterSource);
                }

                if (src == null || src.Quantity <= 0)
                {
                    return;
                }

                if (from.Map != item.Map || !from.InRange(item.GetWorldLocation(), 2) || !from.InLOS(item))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                       // I can't reach that.
                    return;
                }

                this.Content  = BeverageType.Water;
                this.Poison   = null;
                this.Poisoner = null;

                if (src.Quantity > this.MaxQuantity)
                {
                    this.Quantity = this.MaxQuantity;
                    src.Quantity -= this.MaxQuantity;
                }
                else
                {
                    this.Quantity += src.Quantity;
                    src.Quantity   = 0;
                }

                from.SendLocalizedMessage(1010089);                   // You fill the container with water.
            }
            else if (targ is Cow)
            {
                Cow cow = (Cow)targ;

                if (cow.TryMilk(from))
                {
                    Content  = BeverageType.Milk;
                    Quantity = MaxQuantity;
                    from.SendLocalizedMessage(1080197);                       // You fill the container with milk.
                }
            }
            else if (targ is WaterBeetle)
            {
                WaterBeetle waterbeetle = (WaterBeetle)targ;

                if (waterbeetle.TryMilkingWater(from))
                {
                    Content  = BeverageType.Water;
                    Quantity = MaxQuantity;
                    from.SendMessage("You fill the container with water.");
                }
            }
            else if (targ is WaterLizard)
            {
                WaterLizard waterlizard = (WaterLizard)targ;

                if (waterlizard.TryMilkingWater(from))
                {
                    Content  = BeverageType.Water;
                    Quantity = MaxQuantity;
                    from.SendMessage("You fill the container with water.");
                }
            }
            else if (targ is WaterLizardScout)
            {
                WaterLizardScout waterlizardscout = (WaterLizardScout)targ;

                if (waterlizardscout.TryMilkingWater(from))
                {
                    Content  = BeverageType.Water;
                    Quantity = MaxQuantity;
                    from.SendMessage("You fill the container with water.");
                }
            }
            else if (targ is InteriorCrocodileAlligator)
            {
                InteriorCrocodileAlligator interiorcrocodilealligator = (InteriorCrocodileAlligator)targ;

                if (interiorcrocodilealligator.TryMilkingCider(from))
                {
                    Content  = BeverageType.Cider;
                    Quantity = MaxQuantity;
                    from.SendMessage("You fill the container with cider.");
                }
            }
            else if (targ is LandTarget)
            {
                int tileID = ((LandTarget)targ).TileID;

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is WitchApprenticeQuest)
                    {
                        FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                        if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.SwampWater)
                        {
                            bool contains = false;

                            for (int i = 0; !contains && i < m_SwampTiles.Length; i += 2)
                            {
                                contains = (tileID >= m_SwampTiles[i] && tileID <= m_SwampTiles[i + 1]);
                            }

                            if (contains)
                            {
                                Delete();

                                player.SendLocalizedMessage(1055035);                                   // You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
                                obj.Complete();
                            }
                        }
                    }
                }
            }
        }