Ejemplo n.º 1
0
        public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource)
        {
            if (FishInfo.IsRareFish(type))
            {
                return(type);
            }

            bool deepWater = IsDeepWater(loc, map);
            bool junkproof = HasTypeHook(tool, HookType.JunkProof);

            double skillBase  = from.Skills[SkillName.Fishing].Base;
            double skillValue = from.Skills[SkillName.Fishing].Value;

            MutateEntry[] table = Siege.SiegeShard ? m_SiegeMutateTable : m_MutateTable;

            for (int i = 0; i < table.Length; ++i)
            {
                MutateEntry entry = m_MutateTable[i];

                // RedHerring / MudPuppy
                if (i == 6 && (from.Region == null || !from.Region.IsPartOf("Underworld")))
                {
                    continue;
                }

                if (junkproof && i == 5 && 0.80 >= Utility.RandomDouble())
                {
                    continue;
                }

                if (!deepWater && entry.m_DeepWater)
                {
                    continue;
                }

                if (skillBase >= entry.m_ReqSkill)
                {
                    double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill);

                    if (chance > Utility.RandomDouble())
                    {
                        return(entry.m_Types[Utility.Random(entry.m_Types.Length)]);
                    }
                }
            }

            return(type);
        }
Ejemplo n.º 2
0
        public override void SendSuccessTo(Mobile from, Item item, HarvestResource resource)
        {
            if (item is BigFish)
            {
                from.SendLocalizedMessage(1042635); // Your fishing pole bends as you pull a big fish from the depths!

                ((BigFish)item).Fisher     = from;
                ((BigFish)item).DateCaught = DateTime.Now;
            }

            #region Stygian Abyss
            else if (item is RedHerring)
            {
                from.SendLocalizedMessage(1095047, null, 0x23); // You take the Red Herring and put it into your pack.  The only thing more surprising than the fact that there is a fish called the Red Herring is the fact that you fished for it!
            }
            else if (item is MudPuppy)
            {
                from.SendLocalizedMessage(1095064, null, 0x23); // You take the Mud Puppy and put it into your pack.  Not surprisingly, it is very muddy.
            }
            #endregion

            else if (item is WoodenChest || item is MetalGoldenChest)
            {
                from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean!
            }
            else
            {
                int    number;
                string name;

                if (item is BaseMagicFish)
                {
                    number = 1008124;
                    name   = "a mess of small fish";
                }
                else if (item is Fish)
                {
                    number = 1008124;
                    name   = item.ItemData.Name;
                }
                else if (item is BaseShoes)
                {
                    number = 1008124;
                    name   = item.ItemData.Name;
                }
                else if (item is TreasureMap)
                {
                    number = 1008125;
                    name   = "a sodden piece of parchment";
                }
                else if (item is MessageInABottle)
                {
                    number = 1008125;
                    name   = "a bottle, with a message in it";
                }
                else if (item is SpecialFishingNet)
                {
                    number = 1008125;
                    name   = "a special fishing net"; // TODO: this is just a guess--what should it really be named?
                }
                else if (item is BaseHighseasFish)
                {
                    if (FishInfo.IsRareFish(item.GetType()))
                    {
                        from.SendLocalizedMessage(1043297, "a rare fish");
                    }
                    else if (item.LabelNumber < 1)
                    {
                        from.SendLocalizedMessage(1043297, "a fish");
                    }
                    else
                    {
                        from.SendLocalizedMessage(1043297, String.Format("#{0}", item.LabelNumber));
                    }

                    return;
                }
                else if (item.LabelNumber > 0)
                {
                    from.SendLocalizedMessage(1043297, String.Format("#{0}", item.LabelNumber));
                    return;
                }
                else
                {
                    number = 1043297;

                    if ((item.ItemData.Flags & TileFlag.ArticleA) != 0)
                    {
                        name = "a " + item.ItemData.Name;
                    }
                    else if ((item.ItemData.Flags & TileFlag.ArticleAn) != 0)
                    {
                        name = "an " + item.ItemData.Name;
                    }
                    else
                    {
                        name = item.ItemData.Name;
                    }
                }

                from.SendLocalizedMessage(number, name);
            }
        }
Ejemplo n.º 3
0
        public override bool Give(Mobile m, Item item, bool placeAtFeet)
        {
            if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet)
            {
                BaseCreature serp;

                if (0.25 > Utility.RandomDouble())
                {
                    serp = new DeepSeaSerpent();
                }
                else
                {
                    serp = new SeaSerpent();
                }

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

                Map map = m.Map;

                for (int i = 0; map != null && i < 20; ++i)
                {
                    int tx = m.X - 10 + Utility.Random(21);
                    int ty = m.Y - 10 + Utility.Random(21);

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

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

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

                serp.Home      = serp.Location;
                serp.RangeHome = 10;

                serp.PackItem(item);

                m.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish!

                return(true);                   // we don't want to give the item to the player, it's on the serpent
            }

            if (item is BigFish || item is LockableContainer)
            {
                placeAtFeet = true;
            }

            #region High Seas
            if (item is RareFish)
            {
                RareFish fish = (RareFish)item;

                if (FishInfo.IsRareFish(fish.GetType()))
                {
                    fish.Fisher     = m;
                    fish.DateCaught = DateTime.Now;
                    fish.Stackable  = false;

                    fish.Weight = Math.Max(1, 200 - (int)Math.Sqrt(Utility.RandomMinMax(0, 40000)));
                }
            }
            #endregion

            return(base.Give(m, item, placeAtFeet));
        }