protected virtual void FinishEffect(Point3D p, Map map, Mobile from)
        {
            from.RevealingAction();

            int count = GetSpawnCount();

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

                switch (Utility.Random(4))
                {
                default:
                case 0: spawn = new SeaSerpent(); break;

                case 1: spawn = new DeepSeaSerpent(); break;

                case 2: spawn = new WaterElemental(); break;

                case 3: spawn = new Kraken(); break;
                }

                Spawn(p, map, spawn);

                spawn.Combatant = from;
            }

            Delete();
        }
Пример #2
0
        public static void HandleThrow(BaseBeverage beverage, WaterElemental elemental, Mobile thrower)
        {
            if (!beverage.IsFull)
            {
                thrower.SendLocalizedMessage(1113038);  // It is not full.
            }
            else if (!thrower.InRange(elemental.Location, 5))
            {
                thrower.SendLocalizedMessage(500295);   // You are too far away to do that.
            }
            else if (!elemental.HasDecanter)
            {
                thrower.SendLocalizedMessage(1115895);  // It seems that this water elemental no longer has a magical decanter...
            }
            else if (0.1 > Utility.RandomDouble())
            {
                thrower.RevealingAction();
                elemental.Damage(1, thrower);

                elemental.HasDecanter = false;
                beverage.Delete();
                thrower.AddToBackpack(new EndlessDecanter());
                thrower.SendLocalizedMessage(1115897);  // The water elemental has thrown a magical decanter back to you!
            }
            else
            {
                thrower.RevealingAction();
                elemental.Damage(1, thrower);

                beverage.Delete();
                thrower.PlaySound(0x040);
                thrower.SendLocalizedMessage(1115896);  // The water pitcher has shattered.
            }
        }
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(10))
                {
                default:
                case 0: spawn = new AirElemental(); break;

                case 1: spawn = new EarthElemental(); break;

                case 2: spawn = new WaterElemental(); break;

                case 3: spawn = new FireElemental(); break;

                case 4: spawn = new IceElemental(); break;

                case 5: spawn = new SnowElemental(); break;

                case 6: spawn = new Efreet(); break;

                case 7: spawn = new BloodElemental(); break;

                case 8: spawn = new PoisonElemental(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                m_Item.Delete();
            }
Пример #4
0
        private void FinishEffect(Point3D p)
        {
            int count = Utility.RandomMinMax(5, 7);

            if (Hue != 0x8A0)
            {
                count += Utility.RandomMinMax(1, 2);
            }

            Map map = this.Map;

            Leviathan lev = new Leviathan();

            lev.MoveToWorld(p, map);

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

                switch (Utility.Random(4))
                {
                default:
                case 0: spawn = new SeaSerpent(); break;

                case 1: spawn = new DeepSeaSerpent(); break;

                case 2: spawn = new WaterElemental(); break;

                case 3: spawn = new Kraken(); break;
                }

                int x = p.X, y = p.Y;

                for (int j = 0; j < 20; ++j)
                {
                    int tx = p.X - 5 + Utility.Random(11);
                    int ty = p.Y - 5 + Utility.Random(11);

                    Tile t = map.Tiles.GetLandTile(tx, ty);

                    if (t.Z == p.Z && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, p.Z), map))
                    {
                        x = tx;
                        y = ty;
                        break;
                    }
                }

                spawn.MoveToWorld(new Point3D(x, y, p.Z), map);

                if (spawn is Kraken && 0.2 > Utility.RandomDouble())
                {
                    spawn.PackItem(new MessageInABottle(map == Map.Felucca ? Map.Felucca : Map.Trammel));
                }
            }

            Delete();
        }
Пример #5
0
        private void FinishEffect(Point3D p)
        {
            int count = Utility.RandomMinMax(1, 3);

            if (Hue != 0x8A0)
            {
                count += Utility.RandomMinMax(1, 2);
            }

            Map map = this.Map;

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

                switch (Utility.Random(2))
                {
                default:
                case 0: spawn = new SeaSerpent(); break;

                case 1: spawn = new WaterElemental(); break;
                }

                int x = p.X, y = p.Y;

                for (int j = 0; j < 20; ++j)
                {
                    int tx = p.X - 5 + Utility.Random(11);
                    int ty = p.Y - 5 + Utility.Random(11);

                    LandTile t = map.Tiles.GetLandTile(tx, ty);

                    if (t.Z == p.Z && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, p.Z), map))
                    {
                        x = tx;
                        y = ty;
                        break;
                    }
                }

                spawn.Map      = map;
                spawn.Location = new Point3D(x, y, p.Z);
            }

            Delete();
        }
Пример #6
0
        protected virtual void SpawnBaddies(Point3D p, Map map, Mobile from)
        {
            if (from != null || map != null)
            {
                from.RevealingAction();

                int          count = GetSpawnCount();
                BaseCreature spawn;

                for (int i = 0; i < count; ++i)
                {
                    switch (Utility.Random(4))
                    {
                    default:
                    case 0:
                        spawn = new SeaSerpent();
                        break;

                    case 1:
                        spawn = new DeepSeaSerpent();
                        break;

                    case 2:
                        spawn = new WaterElemental();
                        break;

                    case 3:
                        spawn = new Kraken();
                        break;
                    }

                    Spawn(p, map, spawn);
                    spawn.Combatant = from;
                }
            }
        }
Пример #7
0
        public void FindCreature(Mobile from, int creatureLevel)
        {
            if (from == null)
            {
                return;
            }

            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }

            int waterLocationChecks = 20;

            int minSpawnRadius = 3;
            int maxSpawnRadius = 6;

            bool foundWaterSpot   = false;
            bool spawnedCreatures = false;

            Point3D spawnLocation = Location;
            Point3D newLocation   = new Point3D();

            for (int a = 0; a < waterLocationChecks; a++)
            {
                int x = X;

                int xOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius);
                if (Utility.RandomDouble() >= .5)
                {
                    xOffset *= -1;
                }

                x += xOffset;

                int y = Y;

                int yOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius);
                if (Utility.RandomDouble() >= .5)
                {
                    yOffset *= -1;
                }

                y += yOffset;

                newLocation.X = x;
                newLocation.Y = y;
                newLocation.Z = -5;

                bool waterTile = BaseBoat.IsWaterTile(newLocation, Map);

                if (waterTile)
                {
                    if (BaseBoat.FindBoatAt(newLocation, Map) != null)
                    {
                        continue;
                    }

                    SpellHelper.AdjustField(ref spawnLocation, Map, 12, false);

                    foundWaterSpot = true;
                    break;
                }
            }

            if (!foundWaterSpot)
            {
                return;
            }

            int count = 0;

            switch (creatureLevel)
            {
            case 1:
                count = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < count; a++)
                {
                    BaseCreature bc_Creature = new Puddle();

                    bc_Creature.m_WasFishedUp = true;
                    bc_Creature.MoveToWorld(spawnLocation, from.Map);
                    spawnedCreatures = true;
                }

                if (spawnedCreatures)
                {
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*");
                }
                break;

            case 2:
                count = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < count; a++)
                {
                    BaseCreature bc_Creature = new WaterElemental();

                    bc_Creature.m_WasFishedUp = true;
                    bc_Creature.MoveToWorld(spawnLocation, from.Map);
                    spawnedCreatures = true;
                }

                if (spawnedCreatures)
                {
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*");
                }
                break;

            case 3:
                count = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < count; a++)
                {
                    BaseCreature bc_Creature = new DeepSeaSerpent();

                    bc_Creature.m_WasFishedUp = true;
                    bc_Creature.MoveToWorld(spawnLocation, from.Map);
                    spawnedCreatures = true;
                }

                if (spawnedCreatures)
                {
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*");
                }
                break;

            case 4:
                count = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < count; a++)
                {
                    BaseCreature bc_Creature = new Kraken();

                    bc_Creature.m_WasFishedUp = true;
                    bc_Creature.MoveToWorld(spawnLocation, from.Map);
                    spawnedCreatures = true;
                }

                if (spawnedCreatures)
                {
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*");
                }
                break;
            }
        }
Пример #8
0
        public override Item Construct(Type type, Mobile from)
        {
            if (type == typeof(TreasureMap))
            {
                int level;
                //if ( from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland( from ) )
                //	level = 0;
                //else
                level = 1;

                return(new TreasureMap(level, Map.Felucca));
            }
            else if (type == typeof(MessageInABottle))
            {
                return(new MessageInABottle(/*from.Map == Map.Felucca ?*/ Map.Felucca /* : Map.Trammel*/));
            }

            Container pack = from.Backpack;

            if (pack != null)
            {
                List <SOS> messages = pack.FindItemsByType <SOS>();

                for (int i = 0; i < messages.Count; ++i)
                {
                    SOS sos = messages[i];

                    if (from.Map == sos.TargetMap &&
                        from.InRange(sos.TargetLocation, (int)(from.Skills[SkillName.Fishing].Value - 75.0)))
                    {
                        Item preLoot = null;

                        switch (Utility.Random(8))
                        {
                        case 0:                                 // Body parts
                        {
                            var list = new[]
                            {
                                0x1CDD, 0x1CE5,                                                // arm
                                0x1CE0, 0x1CE8,                                                // torso
                                0x1CE1, 0x1CE9,                                                // head
                                0x1CE2, 0x1CEC                                                 // leg
                            };

                            preLoot = new ShipwreckedItem(Utility.RandomList(list));
                            break;
                        }

                        case 1:                                 // Bone parts
                        {
                            var list = new[]
                            {
                                0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4,                         // skulls
                                0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
                                0x1B15, 0x1B16                                                  // pelvis bones
                            };

                            preLoot = new ShipwreckedItem(Utility.RandomList(list));
                            break;
                        }

                        case 2:                                 // Paintings and portraits
                        {
                            preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10));
                            break;
                        }

                        case 3:                                 // Pillows
                        {
                            preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11));
                            break;
                        }

                        case 4:                                 // Shells
                        {
                            preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9));
                            break;
                        }

                        case 5:                                 //Hats
                        {
                            if (Utility.RandomBool())
                            {
                                preLoot = new SkullCap();
                            }
                            else
                            {
                                preLoot = new TricorneHat();
                            }

                            break;
                        }

                        case 6:                                 // Misc
                        {
                            var list = new[]
                            {
                                0x1EB5,                                                // unfinished barrel
                                0xA2A,                                                 // stool
                                0xC1F,                                                 // broken clock
                                0x1047, 0x1048,                                        // globe
                                0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4                         // barrel staves
                            };

                            if (Utility.Random(list.Length + 1) == 0)
                            {
                                preLoot = new Candelabra();
                            }
                            else
                            {
                                preLoot = new ShipwreckedItem(Utility.RandomList(list));
                            }

                            break;
                        }
                        }

                        if (preLoot != null)
                        {
                            if (preLoot is IShipwreckedItem)
                            {
                                ((IShipwreckedItem)preLoot).IsShipwreckedItem = true;
                            }

                            return(preLoot);
                        }

                        LockableContainer chest = null;

                        switch (Utility.Random(3))
                        {
                        case 0:
                            chest = new MetalGoldenChest();
                            break;

                        case 1:
                            chest = new MetalChest();
                            break;

                        default:
                        case 2:
                            chest = new WoodenChest();
                            break;
                        }
                        chest.Breakable = false;
                        chest.Locked    = false;

                        if (sos.IsAncient)
                        {
                            int hue = 1150;

                            if (0.20 > Utility.RandomDouble())
                            {
                                switch (Utility.Random((chest is WoodenChest) ? 6 : 14))
                                {
                                case 0:
                                    hue = 1193;
                                    break;

                                case 1:
                                    hue = 1281;
                                    break;

                                case 2:
                                    hue = 1190;
                                    break;

                                case 3:
                                    hue = 1165;
                                    break;

                                case 4:
                                    hue = 1160;
                                    break;

                                case 5:
                                    hue = 1126;
                                    break;

                                case 6:
                                    hue = CraftResources.GetInfo(CraftResource.Valorite).Hue;
                                    break;

                                case 7:
                                    hue = CraftResources.GetInfo(CraftResource.Verite).Hue;
                                    break;

                                case 8:
                                    hue = CraftResources.GetInfo(CraftResource.Agapite).Hue;
                                    break;

                                case 9:
                                    hue = CraftResources.GetInfo(CraftResource.Gold).Hue;
                                    break;

                                case 10:
                                    hue = CraftResources.GetInfo(CraftResource.Bronze).Hue;
                                    break;

                                case 11:
                                    hue = CraftResources.GetInfo(CraftResource.Copper).Hue;
                                    break;

                                case 12:
                                    hue = CraftResources.GetInfo(CraftResource.ShadowIron).Hue;
                                    break;

                                case 13:
                                    hue = CraftResources.GetInfo(CraftResource.DullCopper).Hue;
                                    break;
                                }
                            }

                            chest.Hue = hue;
                        }
                        else if ((chest is MetalChest || chest is MetalGoldenChest) && (0.5 * sos.Level) >= Utility.RandomDouble())
                        {
                            int randhue  = Utility.Random(120);
                            var resource = CraftResource.None;

                            if (randhue >= 118)
                            {
                                resource = CraftResource.Valorite;
                            }
                            else if (randhue >= 115)
                            {
                                resource = CraftResource.Verite;
                            }
                            else if (randhue >= 110)
                            {
                                resource = CraftResource.Agapite;
                            }
                            else if (randhue >= 100)
                            {
                                resource = CraftResource.Gold;
                            }
                            else if (randhue >= 90)
                            {
                                resource = CraftResource.Bronze;
                            }
                            else if (randhue >= 70)
                            {
                                resource = CraftResource.Copper;
                            }
                            else if (randhue >= 40)
                            {
                                resource = CraftResource.ShadowIron;
                            }
                            else
                            {
                                resource = CraftResource.DullCopper;
                            }

                            chest.Hue = CraftResources.GetInfo(resource).Hue;
                        }

                        int soslevel = sos.Level;

                        TreasureMapChest.Fill(chest, soslevel, from.Expansion);

                        if (!sos.IsAncient)
                        {
                            chest.Locked = false;
                        }

                        double       chance = Utility.RandomDouble();
                        BaseCreature mibmonster1;
                        BaseCreature mibmonster2;
                        mibmonster1 = new DeepWaterElemental();
                        if (chance <= 0.02 && from.Skills[SkillName.Fishing].Base >= 115)
                        {
                            mibmonster2 = new Osiredon();
                            int choice = Utility.Random(5);
                            switch (choice)
                            {
                            case 4:
                                mibmonster2.PackItem(new SmallFishingNetDeed());
                                break;

                            case 3:
                                mibmonster2.PackItem(new LargeFishingNetDeed());
                                break;

                            case 2:
                                mibmonster2.PackItem(new Shell());
                                break;

                            case 1:
                                mibmonster2.PackItem(new Anchor());
                                break;

                            case 0:
                                mibmonster2.PackItem(new Hook());
                                break;
                            }
                        }
                        else if (soslevel < 5)
                        {
                            mibmonster2 = new WaterElemental();
                        }
                        else
                        {
                            mibmonster2 = new DeepWaterElemental();
                        }
                        int x = from.X, y = from.Y;

                        Map map = from.Map;

                        mibmonster1.MoveToWorld(new Point3D(x, y, -5), map);
                        mibmonster2.MoveToWorld(new Point3D(x, y, -5), map);

                        mibmonster1.Home      = mibmonster1.Location;
                        mibmonster1.HomeMap   = mibmonster1.Map;
                        mibmonster1.RangeHome = 10;

                        mibmonster2.Home      = mibmonster2.Location;
                        mibmonster2.HomeMap   = mibmonster2.Map;
                        mibmonster2.RangeHome = 10;

                        if (sos.IsAncient)
                        {
                            chest.DropItem(new FabledFishingNet());
                        }
                        else
                        {
                            chest.DropItem(new SpecialFishingNet());
                        }

                        chest.Movable           = true;
                        chest.Name              = "treasure chest";
                        chest.IsShipwreckedItem = true;

                        if (sos.Level > 0)
                        {
                            chest.TrapType  = TrapType.ExplosionTrap;
                            chest.TrapPower = soslevel * Utility.RandomMinMax(9, 19);
                            chest.TrapLevel = 0;
                        }
                        else
                        {
                            chest.TrapType  = TrapType.None;
                            chest.TrapPower = 1;
                            chest.TrapLevel = 1;
                        }

                        sos.Delete();

                        return(chest);
                    }
                }
            }

            return(base.Construct(type, from));
        }
Пример #9
0
        public virtual void Pour_OnTarget(Mobile from, object targ)
        {
            if (IsEmpty || !Pourable || !ValidateUse(from, false))
            {
                return;
            }

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

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

                if (bev.IsFull && bev.Content == this.Content)
                {
                    from.SendLocalizedMessage(500848);                       // Couldn't pour it there.  It was already full.
                }
                else if (!bev.IsEmpty)
                {
                    from.SendLocalizedMessage(500846);                       // Can't pour it there.
                }
                else
                {
                    bev.Content  = this.Content;
                    bev.Poison   = this.Poison;
                    bev.Poisoner = this.Poisoner;

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

                    from.PlaySound(0x4E);
                }
            }
            else if (from == targ)
            {
                if (from.Thirst < 20)
                {
                    from.Thirst += 1;
                }

                if (ContainsAlchohol)
                {
                    int bac = 0;

                    switch (this.Content)
                    {
                    case BeverageType.Ale: bac = 1; break;

                    case BeverageType.Wine: bac = 2; break;

                    case BeverageType.Cider: bac = 3; break;

                    case BeverageType.Liquor: bac = 4; break;
                    }

                    from.BAC += bac;

                    if (from.BAC > 60)
                    {
                        from.BAC = 60;
                    }

                    CheckHeaveTimer(from);
                }

                from.PlaySound(Utility.RandomList(0x30, 0x2D6));

                if (m_Poison != null)
                {
                    from.ApplyPoison(m_Poisoner, m_Poison);
                }

                --Quantity;
            }
            else if (targ is PlantItem)
            {
                ((PlantItem)targ).Pour(from, this);
            }
            else if (targ is AddonComponent &&
                     (((AddonComponent)targ).Addon is WaterVatEast || ((AddonComponent)targ).Addon is WaterVatSouth) &&
                     this.Content == BeverageType.Water)
            {
                PlayerMobile player = from as PlayerMobile;

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

                    if (qs != null)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(GatherWaterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            BaseAddon vat = ((AddonComponent)targ).Addon;

                            if (vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 &&
                                ((qs.RedSolen && vat.Map == Map.Trammel) || (!qs.RedSolen && vat.Map == Map.Felucca)))
                            {
                                if (obj.CurProgress + Quantity > obj.MaxProgress)
                                {
                                    int delta = obj.MaxProgress - obj.CurProgress;

                                    Quantity       -= delta;
                                    obj.CurProgress = obj.MaxProgress;
                                }
                                else
                                {
                                    obj.CurProgress += Quantity;
                                    Quantity         = 0;
                                }
                            }
                        }
                    }
                }
            }
            else if (targ is WaterElemental)
            {
                WaterElemental we = targ as WaterElemental;

                if (this is Pitcher && this.Quantity == this.MaxQuantity)
                {
                    if (we.Summoned == true)
                    {
                        from.SendLocalizedMessage(1115895);                           // It seems that this water elemental no longer has a magical decanter...
                    }
                    else if (we.HasPitcher == false)
                    {
                        from.SendLocalizedMessage(1115895);                           // It seems that this water elemental no longer has a magical decanter...
                    }
                    else
                    {
                        Effects.SendMovingEffect(from, we, this.ItemID, 7, 0, false, false, this.Hue, 0);

                        if (Utility.Random(100) < 3)
                        {
                            EndlessDecanterOfWater edw = new EndlessDecanterOfWater();

                            Effects.SendMovingEffect(we, from, edw.ItemID, 7, 0, false, false, edw.Hue, 0);

                            from.AddToBackpack(edw);
                            from.SendLocalizedMessage(1115897);                               // The water elemental has thrown a magical decanter back to you!
                            we.HasPitcher = false;
                        }
                        else
                        {
                            from.SendLocalizedMessage(1115896);                               // The water pitcher has shattered.
                            //Play Sound?
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500846);                       // Can't pour it there.
                }
            }
            else
            {
                from.SendLocalizedMessage(500846);                   // Can't pour it there.
            }
        }
Пример #10
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();
        }
Пример #11
0
        public void RetrievalAttempt(Mobile from, bool fishing)
        {
            if (m_CurrentItem >= m_MaxItems)
            {
                return;
            }

            PlayerMobile pm_From = from as PlayerMobile;

            if (pm_From == null)
            {
                return;
            }

            if (!from.InRange(Location, 2) && from.AccessLevel == AccessLevel.Player)
            {
                from.SendMessage("You are too far from the fountain to continue searching.");
                return;
            }

            pm_From.RevealingAction();

            double baseChance = .10;

            if (fishing)
            {
                baseChance *= 1.25 + (.25 * (from.Skills.Fishing.Value / 120));
            }

            if (Utility.RandomDouble() <= baseChance)
            {
                m_CurrentItem++;

                Item item = null;

                switch (m_CurrentItem)
                {
                case 1:
                    Bag bag = new Bag();

                    for (int a = 0; a < 10; a++)
                    {
                        bag.DropItem(CraftingComponent.GetRandomCraftingComponent(1));
                    }

                    item = bag;
                    break;

                case 2: item = new MiniatureHouse(); break;

                case 3:                        switch (m_TreasurePileLevel)
                    {
                    case 1: item = new TreasurePileSmallAddonDeed(); break;

                    case 2: item = new TreasurePileMediumAddonDeed(); break;

                    case 3: item = new TreasurePileLargeAddonDeed(); break;

                    case 4: item = new TreasurePileHugeAddonDeed(); break;
                    }
                    break;

                case 4: item = new MiniatureTree(); break;

                //case 5: item = DungeonArmor.CreateDungeonArmor(DungeonEnum.None, DungeonArmor.ArmorTierEnum.Tier1, DungeonArmor.ArmorLocation.Unspecified); break;
                case 6: item = new MiniatureFountain(); break;
                    //case 7: item = new DungeonArmorUpgradeHammer(); break;


                    break;
                }

                if (item != null)
                {
                    if (pm_From.AddToBackpack(item))
                    {
                        pm_From.SendMessage("You retrieve an item from the fountain!");
                        pm_From.PlaySound(0x025);

                        return;
                    }

                    else
                    {
                        item.MoveToWorld(from.Location, from.Map);

                        pm_From.PlaySound(0x025);
                        pm_From.SendMessage("You retrieve an item from the fountain! Your pack, however, was full and the item has been placed at your feet.");

                        return;
                    }
                }

                int waterCount = Utility.RandomMinMax(1, 2);
                for (int a = 0; a < waterCount; a++)
                {
                    TimedStatic water = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), 10);
                    water.Name = "foul water";
                    water.Hue  = 1107;

                    Point3D waterLocation = new Point3D(Location.X + Utility.RandomMinMax(-1, 1), Location.Y + Utility.RandomMinMax(-1, 1), Location.Z);

                    SpellHelper.AdjustField(ref waterLocation, Map, 12, false);
                    water.MoveToWorld(waterLocation, Map);
                }
            }

            else
            {
                if (Utility.RandomDouble() <= .25)
                {
                    PublicOverheadMessage(MessageType.Regular, 0, false, "something ancient stirs from within the fountain!");

                    int waterCount = Utility.RandomMinMax(3, 5);
                    for (int a = 0; a < waterCount; a++)
                    {
                        TimedStatic water = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), 10);
                        water.Name = "foul water";
                        water.Hue  = 1107;

                        Point3D waterLocation = new Point3D(Location.X + Utility.RandomMinMax(-2, 2), Location.Y + Utility.RandomMinMax(-2, 2), Location.Z);

                        SpellHelper.AdjustField(ref waterLocation, Map, 12, false);
                        water.MoveToWorld(waterLocation, Map);
                    }

                    int creatureCount = 0;

                    double result = Utility.RandomDouble();

                    if (result < .10)
                    {
                        creatureCount = 1;

                        for (int a = 0; a < creatureCount; a++)
                        {
                            new FountainOfEvil().MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else if (result < .15)
                    {
                        creatureCount = Utility.RandomMinMax(1, 2);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            new ElderWaterElemental().MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else if (result < .20)
                    {
                        creatureCount = Utility.RandomMinMax(1, 2);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            new ElderToxicElemental().MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else if (result < .25)
                    {
                        creatureCount = Utility.RandomMinMax(1, 2);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            new ElderPoisonElemental().MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else if (result < .50)
                    {
                        creatureCount = Utility.RandomMinMax(2, 4);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            WaterElemental waterElemental = new WaterElemental();
                            waterElemental.Hue  = 1107;
                            waterElemental.Name = "foul water";
                            waterElemental.MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else if (result < .75)
                    {
                        creatureCount = Utility.RandomMinMax(2, 4);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            new VoidSlime().MoveToWorld(from.Location, from.Map);
                        }
                    }

                    else
                    {
                        creatureCount = Utility.RandomMinMax(3, 5);

                        for (int a = 0; a < creatureCount; a++)
                        {
                            Puddle foulPuddle = new Puddle();
                            foulPuddle.Hue  = 1107;
                            foulPuddle.Name = "foul puddle";
                            foulPuddle.MoveToWorld(from.Location, from.Map);
                        }
                    }

                    return;
                }

                else
                {
                    pm_From.SendMessage("You search the fountain but are unable to locate anything of value.");
                    return;
                }
            }
        }