Exemplo n.º 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_TurnIn = reader.ReadMobile() as FishMonger;
            m_Boat   = reader.ReadItem() as BaseBoat;
            m_Crate  = reader.ReadItem() as ShippingCrate;

            if (m_Crate != null)
            {
                m_Crate.AddQuest(this);
            }

            switch (reader.ReadInt())
            {
            case 0:
                m_Title = reader.ReadString();
                break;

            case 1:
                m_Title = reader.ReadInt();
                break;
            }

            AddReward(new BaseReward(1116510)); //A rare reward from the Order of the Dragonfish.
        }
Exemplo n.º 2
0
        public static FishMonger GetRandomMonger(PlayerMobile player, FishMonger monger)
        {
            bool NOGO = true;

            FishMonger mob = null;

            List <FishMonger> mongers = new List <FishMonger>(m_Mongers);

            //First, remove quester
            if (mongers.Contains(monger))
            {
                mongers.Remove(monger);
            }

            //Next, remove mongers from other facets in same region as quest giver
            for (var index = 0; index < m_Mongers.Count; index++)
            {
                FishMonger m = m_Mongers[index];

                if (m.Region != null && monger.Region != null && m.Region.Name == monger.Region.Name)
                {
                    mongers.Remove(m);
                }
            }

            //Now, remove mongers from other quests
            if (player.Quests != null)
            {
                for (int i = 0; i < player.Quests.Count; i++)
                {
                    if (player.Quests[i] is ProfessionalFisherQuest)
                    {
                        ProfessionalFisherQuest q = (ProfessionalFisherQuest)player.Quests[i];

                        if (mongers.Contains(q.TurnIn))
                        {
                            mongers.Remove(q.TurnIn);
                        }
                    }
                }
            }

            if (mongers.Count < 1)
            {
                return(null);
            }

            while (NOGO)
            {
                mob = mongers[Utility.Random(mongers.Count)];

                if (mob.Region != null && mob.Region.Name != null)
                {
                    NOGO = false;
                }
            }

            return(mob);
        }
Exemplo n.º 3
0
        public ProfessionalFisherQuest(Mobile from, FishMonger monger, FishMonger quester, BaseBoat boat)
        {
            PlayerFishingEntry entry = PlayerFishingEntry.GetEntry(from, true);

            int lines;

            if (boat.IsClassicBoat)
            {
                lines = 1;
            }
            else
            {
                lines = entry.CalculateLines();
            }

            m_TurnIn = monger;
            m_Boat   = boat;

            int  index  = 0;
            int  amount = 10;
            Type type   = null;

            List <int>             hasChosen = new List <int>();
            Dictionary <Type, int> types     = new Dictionary <Type, int>();

            for (int i = 0; i < lines; i++)
            {
                entry.GetRandomFish(ref index, ref amount, hasChosen);
                hasChosen.Add(index);
                type = FishQuestHelper.GetTypeFromIndex(index);
                if (amount < 5)
                {
                    amount = 5;
                }
                if (amount > 20)
                {
                    amount = 20;
                }

                types[type] = amount;
            }

            AddObjective(new FishQuestObjective(types));
            AddReward(new BaseReward(1116510)); //A rare reward from the Order of the Dragonfish.

            hasChosen.Clear();

            m_Title = GetTitle(quester);
        }