예제 #1
0
        public override void OnResign(bool resignChain)
        {
            if (Owner != null)
            {
                PlayerFishingEntry entry = PlayerFishingEntry.GetEntry(Owner);

                if (entry != null)
                {
                    FishQuestObjective obj = GetObjective();

                    if (obj != null)
                    {
                        foreach (KeyValuePair <Type, int[]> kvp in obj.Line)
                        {
                            entry.OnQuestResign(kvp.Key);
                        }
                    }
                }
            }

            if (m_Crate != null)
            {
                m_Crate.Quest = null;
                m_Crate.Delete();
            }

            base.OnResign(resignChain);
        }
예제 #2
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);
        }
예제 #3
0
        public override void GiveRewards()
        {
            if (Owner != null)
            {
                PlayerFishingEntry entry = PlayerFishingEntry.GetEntry(Owner);

                if (entry != null)
                {
                    double             pointsAwarded = 0;
                    FishQuestObjective obj           = GetObjective();

                    if (obj != null)
                    {
                        pointsAwarded += entry.GetPointsAwarded(obj);
                        entry.OnQuestComplete(obj);
                    }

                    FishQuestHelper.GiveRewards(Owner, entry, pointsAwarded);
                }
            }

            DeleteQuestItems();
            base.GiveRewards();
        }