Exemple #1
0
        private double GoodFishingBonus(Mobile from, Point2D loc)
        {
            if (from != null)
            {
                Multis.BaseBoat boat = Multis.BaseBoat.FindBoatAt(from);
                if (boat != null)
                {
                    if (boat.Fishing != null && boat.Fishing.Running && boat.Fishing.GoodFishingHere(loc))
                    {
                        switch (boat.Fishing.Level)
                        {
                        case 1:
                            return(2.0);

                        case 2:
                            return(3.0);

                        case 3:
                            return(4.0);

                        case 4:
                            return(5.0);

                        case 5:
                            return(6.0);
                        }
                    }
                }
            }

            return(1.0);
        }
        /* from stratics - 2002, tinker trap essay
         * (OLD-STYLE TRAPS)
         * Creating the trap safely
         * Trapping a moveable (player made, highlights yellow) chest that is located in either a building or boat that you own is not a crime of any sort
         *	(keeping the key in your pack while creating the box helps ensure this). This is a defensive measure for players to protect their possessions.
         *	Taking the chest outside of the building makes no difference on criminal behavior. In fact, any chest created inside a building or boat that
         *	you own has no 'ownership' at all, and can be used without fear of criminal consequence.
         * Note: the chest must be on the floor when you trap it in order to avoid responsibility for the trap.
         * Note: currently, "the boat that you own" means that you are carrying a key to the boat in your backpack, in the upper level.
         *	Do not bury the key several packs down.
         * Trapping a non-moveable (dungeon, town, monster camp etc.) chest or a player made chest that is not in a building or boat that you own
         *	will set the trapper as the controller of the chest. If the trap damages an Innocent the trapper will be flagged as a Criminal and Aggressor
         *	(to the victim). If the Innocent dies, he/she can report the trapper as a Murderer.
         * Adam's Note: stratics says a houes that you own, but the UOSecondAge website says at least a friend.
         * "The tinker that makes a trap cannot be given a murder count (when an innocent is killed by it) ONLY IF he traps the box while it is on
         *	the floor of a house which he is at least friended to. If he traps while it is on the ground outside of his house, or if it is in
         *	another container a murder count can be given to him."
         *
         * (NEW-STYLE TRAPS)
         *
         * From UO.
         * Tinker Traps
         *  Tinker traps will be modified. Their purpose will be to protect containers and their creation will no longer give the maker a murder count.
         * A trapped chest cannot be opened until the trap is disarmed and the lock removed, except:
         * The owner of the chest can access the chest automatically without firing the trap. The owner is defined as the last person to lock the chest.
         * Using the key on the chest will bypass the trap.
         * The lock on a trapped chest cannot be picked until the trap is disarmed.
         * A failed disarm attempt will result in setting off the trap.
         * A trap that is set off will reset itself automatically indefinitely.
         * Damage from a trap will not cause the maker of the trap to be a candidate for a murder count.
         * Disarming the chest will not automatically unlock it.
         *
         * ** More info supporting the notion that
         * (1)the chest cannot be picked successfully, and so it remains locked,
         * (2)that the owner can open the chest without unlocking it.
         *
         * A tinker can successfully trap a container. The next person who illegally tries to open the container sets off the trap and takes the damage.
         * The container may be safely opened by the owner (the last person to lock the chest), or by using the proper key.
         * The lock on a trapped chest cannot be picked until the trap has been disarmed. Be careful with giving away trapped containers,
         * it might bring murder counts for the tinker if the trap kills innocent players. The strength of your trap is directly related to your
         * tinkering skill.
         * http://www.gatecentral.com/ultima/wissen/sk_tinkering_l12.php
         */
        public Mobile CalcTrapper()
        {
            // on the floor of your house or on the deck of your boat are the only safe places to trap this container.
            Multis.BaseBoat  boat  = Multis.BaseBoat.FindBoatAt(From);
            Multis.BaseHouse house = Multis.BaseHouse.FindHouseAt(From);

            if (boat != null)
            {                   // they are on a boat
                                // if they have the boat key, they are considered the owner.
                if (boat.HasKey(From) && Container.Parent == null /*!Container.IsChildOf(From.Backpack)*/)
                {
                    return(null);                               // safe!
                }
            }
            else if (house != null)
            {                   // they are in their house
                if (house.IsFriend(From) && Container.Parent == null /*!Container.IsChildOf(From.Backpack)*/)
                {
                    return(null);                               // safe!
                }
            }
            else
            {
                // they failed all tests, so they are Guilty!
                return(From);
            }

            // they were in a house or on a boat but failed the tests
            return(From);
        }
Exemple #3
0
        private bool GoodFishingAdvice(Mobile from, string text)
        {
            if (from != null)
            {
                Multis.BaseBoat boat = Multis.BaseBoat.FindBoatAt(from);
                if (boat != null)
                {
                    boat.TillerMan.Say(false, text);
                }
            }

            return(false);
        }
Exemple #4
0
        private int GoodFishingLevel(Mobile from, Point2D loc)
        {
            if (from != null)
            {
                Multis.BaseBoat boat = Multis.BaseBoat.FindBoatAt(from);
                if (boat != null)
                {
                    if (boat.Fishing != null && boat.Fishing.Running && boat.Fishing.GoodFishingHere(loc))
                    {
                        return(boat.Fishing.Level);
                    }
                }
            }

            return(0);
        }
Exemple #5
0
        private bool GoodFishingNear(Mobile from, Point2D loc)
        {
            if (from != null)
            {
                Multis.BaseBoat boat = Multis.BaseBoat.FindBoatAt(from);
                if (boat != null)
                {
                    if (boat.Fishing != null && boat.Fishing.Running && boat.Fishing.GoodFishingNear(loc))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #6
0
        public override bool SpecialHarvest(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc)
        {
            if (from is PlayerMobile player)
            {
                QuestSystem qs = player.Quest;

                if (qs is CollectorQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(FishPearlsObjective));

                    if (obj != null && !obj.Completed)
                    {
                        if (Utility.RandomDouble() < 0.5)
                        {
                            player.SendLocalizedMessage(1055086, "", 0x59); // You pull a shellfish out of the water, and find a rainbow pearl inside of it.

                            obj.CurProgress++;
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055087, "", 0x2C); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                        }

                        return(true);
                    }
                }

                if (from.Region.IsPartOf("Underworld"))
                {
                    for (var index = 0; index < player.Quests.Count; index++)
                    {
                        BaseQuest quest = player.Quests[index];

                        if (quest is SomethingFishy && Utility.RandomDouble() < 0.1)
                        {
                            Item red = new RedHerring();
                            from.AddToBackpack(red);
                            player.SendLocalizedMessage(1095047, "", 0x23); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            return(true);
                        }

                        if (quest is ScrapingtheBottom && Utility.RandomDouble() < 0.1)
                        {
                            Item mug = new MudPuppy();
                            from.AddToBackpack(mug);
                            player.SendLocalizedMessage(1095064, "", 0x23); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            return(true);
                        }
                    }
                }

                #region High Seas Charydbis
                if (tool is FishingPole pole && CharydbisSpawner.SpawnInstance != null && CharydbisSpawner.SpawnInstance.IsSummoned)
                {
                    Item             oracle = from.Backpack.FindItemByType(typeof(OracleOfTheSea));
                    CharydbisSpawner sp     = CharydbisSpawner.SpawnInstance;

                    if (oracle != null && sp != null)
                    {
                        if (from.Map != sp.Map)
                        {
                            from.SendLocalizedMessage(1150861); //Charybdis have never been seen in these waters, try somewhere else.
                        }
                        else if (pole.BaitType == typeof(Charydbis) && from.Skills[SkillName.Fishing].Value >= 100)
                        {
                            if (sp.Charydbis == null && !sp.HasSpawned && sp.CurrentLocation.Contains(loc))
                            {
                                Multis.BaseBoat boat = Multis.BaseBoat.FindBoatAt(from, from.Map);
                                sp.SpawnCharydbis(from, loc, sp.Map, boat);
                                sp.HasSpawned = true;
                                pole.OnFishedHarvest(from, true);
                                return(true);
                            }

                            if (sp.LastLocation.Contains(loc))
                            {
                                from.SendLocalizedMessage(1150862); //The charybdis has moved on from this location, consult Oracle Of The Seas again.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1150858); //You see a few bubbles, but no charybdis.
                        }
                    }
                }
                #endregion
            }

            return(false);
        }