Esempio n. 1
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            this.Direction = GetDirectionTo(from);

            PlayerMobile player = from as PlayerMobile;

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

                if (qs != null && qs.RedSolen == this.RedSolen)
                {
                    QuestObjective obj = qs.FindObjective(typeof(GatherFungiObjective));

                    if (obj != null && !obj.Completed)
                    {
                        if (dropped is ZoogiFungus)
                        {
                            ZoogiFungus fungi = (ZoogiFungus)dropped;

                            if (fungi.Amount >= 50)
                            {
                                obj.Complete();

                                fungi.Amount -= 50;

                                if (fungi.Amount == 0)
                                {
                                    fungi.Delete();
                                    return(true);
                                }
                                else
                                {
                                    return(false);
                                }
                            }
                            else
                            {
                                SayTo(player, 1054072); // Our arrangement was for 50 of the zoogi fungus. Please return to me when you have that amount.
                                return(false);
                            }
                        }
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
        public void OnGivenFungi(PlayerMobile player, ZoogiFungus fungi)
        {
            this.Direction = GetDirectionTo(player);

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

            if (qs != null && qs.RedSolen == this.RedSolen)
            {
                QuestObjective obj = qs.FindObjective(typeof(ProcessFungiObjective));

                if (obj != null && !obj.Completed)
                {
                    int amount = fungi.Amount / 2;

                    if (amount > 100)
                    {
                        amount = 100;
                    }

                    if (amount > 0)
                    {
                        if (amount * 2 >= fungi.Amount)
                        {
                            fungi.Delete();
                        }
                        else
                        {
                            fungi.Amount -= amount * 2;
                        }

                        PowderOfTranslocation powder = new PowderOfTranslocation(amount);
                        player.AddToBackpack(powder);

                        player.SendLocalizedMessage(1054100);                           // You receive some powder of translocation.

                        obj.Complete();
                    }
                }
            }
        }