Example #1
0
        public override void OnDoubleClick(Mobile m)
        {
            PlayerMobile pm = m as PlayerMobile;

            if (null == pm)
            {
                return;
            }

            // add check for getting silver sapling seed only once per day...
            if (pm.SSNextSeed > DateTime.Now)
            {
                pm.SendLocalizedMessage(1113042);    // You must wait a full day before receiving another Seed of the Silver Sapling
            }
            else
            {
                pm.SendLocalizedMessage(1113043);    // The Silver Sapling pulses with light, and a shining seed appears in your hands.
                pm.SSNextSeed = DateTime.Now + TimeSpan.FromDays(1.0);

                Item      item = new SilverSaplingSeed();
                Container pack = pm.Backpack;
                if (pack == null)
                {
                    pm.AddToBackpack(item);
                }
                else
                {
                    pack.DropItem(item);
                }
            }
        }
        public virtual void Reward(PlayerMobile player, CollectionItem reward, int hue)
        {
            Item item = QuestHelper.Construct(reward.Type) as Item;

            if (item != null && player.AddToBackpack(item))
            {
                if (hue > 0)
                {
                    item.Hue = hue;
                }

                player.AddCollectionPoints(this.CollectionID, (int)reward.Points * -1);
                player.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                player.PlaySound(0x5A7);

                if (reward.QuestItem)
                {
                    CollectionsObtainObjective.CheckReward(player, item);
                }
            }
            else if (item != null)
            {
                player.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                item.Delete();
            }

            reward.OnGiveReward(player, this, hue);

            player.CloseGump(typeof(ComunityCollectionGump));
            player.SendGump(new ComunityCollectionGump(player, this, this.Location));
        }
Example #3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Paints.Deleted || !m_Paints.IsChildOf(from.Backpack))
                {
                    return;
                }

                PlayerMobile player = from as PlayerMobile;

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

                    if (qs is CollectorQuest)
                    {
                        CaptureImagesObjective obj = qs.FindObjective(typeof(CaptureImagesObjective)) as CaptureImagesObjective;

                        if (obj != null && !obj.Completed)
                        {
                            if (targeted is Mobile)
                            {
                                CaptureResponse response = obj.CaptureImage((targeted.GetType().Name == "GreaterMongbat" ? new Mongbat().GetType() : targeted.GetType()), out ImageType image);

                                switch (response)
                                {
                                case CaptureResponse.Valid:
                                {
                                    player.SendLocalizedMessage(1055125);                                                     // The enchanted paints swirl for a moment then an image begins to take shape. *Click*
                                    player.AddToBackpack(new PaintedImage(image));

                                    break;
                                }

                                case CaptureResponse.AlreadyDone:
                                {
                                    player.SendAsciiMessage(0x2C, "You have already captured the image of this creature");

                                    break;
                                }

                                case CaptureResponse.Invalid:
                                {
                                    player.SendLocalizedMessage(1055124);                                                     // You have no interest in capturing the image of this creature.

                                    break;
                                }
                                }
                            }
                            else
                            {
                                player.SendAsciiMessage(0x35, "You have no interest in that.");
                            }

                            return;
                        }
                    }
                }

                from.SendLocalizedMessage(1010085);                 // You cannot use this.
            }
Example #4
0
        public static void GiveArtifactTo(PlayerMobile pm)
        {
            Item item = (Item)Activator.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]);

            bool message = true;

            if (!pm.AddToBackpack(item))
            {
                Container bank = pm.BankBox;

                if (!(bank != null && bank.TryDropItem(pm, item, false)))
                {
                    pm.SendLocalizedMessage(1072523, "", 64);                       // You find an artifact, but your backpack and bank are too full to hold it.

                    message = false;

                    item.MoveToWorld(pm.Location, pm.Map);
                }
            }

            if (message)
            {
                pm.SendLocalizedMessage(1062317, "", 64);                   // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
            }
            EffectPool.ArtifactDrop(pm);

            pm.DoomCredits = 0;
        }
Example #5
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm    = (PlayerMobile)from;
            var          reags = new BagOfReagents(50);

            reags.DropItem(new TotalManaPotion()
            {
                Amount = 25
            });
            reags.DropItem(new GreaterHealPotion()
            {
                Amount = 25
            });
            reags.DropItem(new InvisibilityPotion()
            {
                Amount = 25
            });
            reags.DropItem(new GreaterCurePotion()
            {
                Amount = 10
            });
            reags.DropItem(new GreaterRestorePotion()
            {
                Amount = 25
            });
            pm.AddToBackpack(reags);
            pm.SendMessage("A bag of PvP supplies has been added to your backpack.");
        }
Example #6
0
        public override void HandleButtonResponse(NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo)
        {
            PlayerMobile pm      = sender.Mobile as PlayerMobile;
            var          turnIns = PointsSystem.TreasuresOfTokuno.GetTurnIns(pm);

            if (pm == null || !pm.InRange(m_Collector.Location, 7) || !(turnIns >= TreasuresOfTokuno.ItemsPerReward))
            {
                return;
            }

            bool pigments = (buttonInfo is PigmentsTileButtonInfo);

            Item item = null;

            if (pigments)
            {
                PigmentsTileButtonInfo p = buttonInfo as PigmentsTileButtonInfo;

                item = new PigmentsOfTokuno(p.Pigment);
            }
            else
            {
                TypeTileButtonInfo t = buttonInfo as TypeTileButtonInfo;

                if (t.Type == typeof(PigmentsOfTokuno))  //Special case of course.
                {
                    pm.CloseGump(typeof(ToTTurnInGump)); //Sanity
                    pm.CloseGump(typeof(ToTRedeemGump));

                    pm.SendGump(new ToTRedeemGump(m_Collector, true));

                    return;
                }

                try
                {
                    item = (Item)Activator.CreateInstance(t.Type);
                }
                catch
                {
                }
            }

            if (item == null)
            {
                return; //Sanity
            }
            if (pm.AddToBackpack(item))
            {
                PointsSystem.TreasuresOfTokuno.RemoveTurnIns(pm, TreasuresOfTokuno.ItemsPerReward);
                m_Collector.SayTo(pm, 1070984, (item.Name == null || item.Name.Length <= 0) ? string.Format("#{0}", item.LabelNumber) : item.Name); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack.
            }
            else
            {
                item.Delete();
                m_Collector.SayTo(pm, 500722);  // You don't have enough room in your backpack!
                m_Collector.SayTo(pm, 1070982); // When you wish to choose your reward, you have but to approach me again.
            }
        }
Example #7
0
        public override void OnRead()
        {
            PlayerMobile pm = System.From;

            pm.AddToBackpack(new AncientJewelryBox());

            System.AddObjective(new SeekUncleJohnObjective());
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is TheFairElainQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(BringRingToAndoraObjective));

                    if (qs.IsObjectiveInProgress(typeof(BringRingToAndoraObjective)))
                    {
                        if (dropped is AcarasRing)
                        {
                            if (dropped.Amount != 1)
                            {
                                this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", player.NetState);
                                return(false);
                            }

                            dropped.Delete();
                            player.AddToBackpack(new Gold(500));
                            player.AddToBackpack(new AndorasBook());

                            obj.Complete();
                            qs.AddConversation(new AndorasEndConversation());

                            return(true);
                        }
                    }
                    else if (dropped is Whip)
                    {
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, player.NetState);
                        return(false);
                    }
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Bring me the insolent mage's ring.", player.NetState);
                }
            }

            return(false);
        }
Example #9
0
        public override void OnRead()
        {
            PlayerMobile pm = System.From;

            pm.AddToBackpack(new WormJarEmpty());

            System.AddObjective(new GetBaitObjective());
        }
Example #10
0
        public virtual void EndQuest(PlayerMobile pm)
        {
            TeiravonMobile tm = (TeiravonMobile)pm;

            if (Titles.AwardExp(tm, QuestExp))
            {
                pm.SendMessage("You have gained {0} experience.", QuestExp);
            }
            pm.AddToBackpack(new Gold(GoldAmt));
            if (this.Backpack != null)
            {
                if (this.Backpack.Items.Count > 0)
                {
                    pm.AddToBackpack((Item)this.Backpack.Items[Utility.Random(this.Backpack.Items.Count)]);
                }
            }
        }
Example #11
0
        public static void HandleKill(Mobile victim, Mobile killer)
        {
            PlayerMobile pm = killer as PlayerMobile;
            BaseCreature bc = victim as BaseCreature;

            if (!Enabled || pm == null || bc == null || !CheckLocation(bc) || !CheckLocation(pm) || !killer.InRange(victim, 18))
            {
                return;
            }

            if (bc.Controlled || bc.Owners.Count > 0 || bc.Fame <= 0)
            {
                return;
            }

            //25000 for 1/100 chance, 10 hyrus
            //1500, 1/1000 chance, 20 lizard men for that chance.

            pm.ToTTotalMonsterFame += (int)(bc.Fame * (1 + Math.Sqrt(pm.Luck) / 100));

            //This is the Exponentional regression with only 2 datapoints.
            //A log. func would also work, but it didn't make as much sense.
            //This function isn't OSI exact beign that I don't know OSI's func they used ;p
            int x = pm.ToTTotalMonsterFame;

            //const double A = 8.63316841 * Math.Pow( 10, -4 );
            const double A = 0.000863316841;
            //const double B = 4.25531915 * Math.Pow( 10, -6 );
            const double B = 0.00000425531915;

            double chance = A * Math.Pow(10, B * x);

            if (chance > Utility.RandomDouble())
            {
                Item i = null;

                try
                {
                    i = Activator.CreateInstance(m_LesserArtifacts[Utility.Random(m_LesserArtifacts.Length)]) as Item;
                }
                catch
                { }

                if (i != null)
                {
                    if (pm.AddToBackpack(i))
                    {
                        pm.SendLocalizedMessage(1062317);                           // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
                        pm.ToTTotalMonsterFame = 0;
                    }
                    else
                    {
                        //Place in bank possibly?
                        i.Delete();
                    }
                }
            }
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile       m      = from;
            PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                QuestSystem qs = mobile.Quest;

                if (qs is HaldursBaitQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(GetBaitObjective));

                    if (dropped is WormJarFull)
                    {
                        if (dropped.Amount != 1)
                        {
                            this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "AH! Now this is Babe Winkleman material here!", mobile.NetState);
                            return(false);
                        }
                    }

                    dropped.Delete();

                    mobile.AddToBackpack(new Gold(Utility.RandomMinMax(2375, 2595)));

                    mobile.AddToBackpack(new SkillSlotDeedQuestReward());
                    mobile.AddToBackpack(new WeightIncreaseDeed());
                    mobile.AddToBackpack(new QuestGoodieBag());

                    obj.Complete();
                    qs.AddConversation(new EndConversation());

                    if (1 > Utility.RandomDouble())                      // 1 = 100% = chance to drop
                    {
                        switch (Utility.Random(3))
                        {
                        case 0: mobile.AddToBackpack(new AncientFishingPole15()); break;

                        case 1: mobile.AddToBackpack(new AncientFishingPole30()); break;

                        case 2: mobile.AddToBackpack(new AncientFishingPole60()); break;
                        }
                    }

                    return(true);
                }
                else if (dropped is WormJarFull)
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, mobile.NetState);
                    return(false);
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I don't think the fish will be biting on that!", mobile.NetState);
                }
            }

            return(false);
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is TheFairElainQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(BringBookToVacarObjective));

                    if (qs.IsObjectiveInProgress(typeof(BringBookToVacarObjective)))
                    {
                        if (dropped is AndorasBook)
                        {
                            if (dropped.Amount != 1)
                            {
                                this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", player.NetState);
                                return(false);
                            }

                            dropped.Delete();
                            player.AddToBackpack(new Gold(5));
                            player.AddToBackpack(new VacarsLoveLetter());

                            qs.AddConversation(new VacarJamesEndConversation());

                            return(true);
                        }
                    }
                    else if (dropped is AndorasBook)
                    {
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, player.NetState);
                        return(false);
                    }
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "What is this crap? It's all crap!", player.NetState);
                }
            }

            return(false);
        }
Example #14
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is KissOfTheSerpentMistressQuest)
                {
                    if (dropped is CalcifinasJournal)
                    {
                        qs.AddConversation(new CalcifinasJournalConversation());
                        QuestObjective obj = qs.FindObjective(typeof(ReturnJournalObjective));

                        if (obj != null && !obj.Completed)
                        {
                            dropped.Delete();

                            obj.Complete();
                        }
                    }
                    else if (dropped is SerpentStriker)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnBowObjective));

                        if (obj != null && !obj.Completed)
                        {
                            dropped.Delete();

                            obj.Complete();
                            player.AddToBackpack(new RazorwindBow());

                            player.AddToBackpack(new Gold(Utility.RandomMinMax(5575, 5895)));

                            player.AddToBackpack(new SkillSlotDeedQuestReward());
                            player.AddToBackpack(new WeightIncreaseDeed());
                            player.AddToBackpack(new QuestGoodieBag());
                        }
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
Example #15
0
        public virtual void RemoveSeed(PlayerMobile from)
        {
            if (HasPlant && m_Plant.StateOfGrowth == StateOfGrowth.Seed)
            {
                from.AddToBackpack(m_Plant.GetSeed());

                m_Plant.Delete();
            }
        }
Example #16
0
        public override void OnComplete()
        {
            PlayerMobile from = System.From;

            Point3D loc = WitchApprenticeQuest.RandomZeefzorpulLocation();

            MapItem mapItem = new MapItem();

            mapItem.SetDisplay(loc.X - 200, loc.Y - 200, loc.X + 200, loc.Y + 200, 200, 200);
            mapItem.AddWorldPin(loc.X, loc.Y);
            from.AddToBackpack(mapItem);

            from.AddToBackpack(new MagicFlute());

            from.SendLocalizedMessage(1055061); // You have received a map and a magic flute.

            System.AddConversation(new ImpDeathConversation(loc));
        }
        public override void OnRead()
        {
            PlayerMobile pm = System.From;

            Moongate gate = new Moongate(new Point3D(1629, 1880, 5), Map.Malas);                 // Skaddria Naddheim Bank

            gate.Name = "Skaddria Naddheim Bank";
            gate.MoveToWorld(pm.Location, pm.Map);
            Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(gate.Delete));

            // woohoo!
            pm.PlaySound(0x5B8);               // satyrpipe_use_well
            pm.PlaySound(pm.Female ? 783 : 1054);
            pm.Say("Yahoo!");

            pm.AddToBackpack(new Gold(3500));
            pm.AddToBackpack(new SkillSlotDeedQuestReward());
            pm.AddToBackpack(new WeightIncreaseDeed());

            pm.Exp     += 1000;
            pm.KillExp += 1000;
            pm.SendMessage("You've gained 1000 exp.");

            if (pm.Exp >= pm.LevelAt && pm.Level != pm.LevelCap)
            {
                Actions.DoLevel(pm, new Setup());
            }

            pm.TotalQuestsDone += 1;

            BaseJewel jewel = new RingOfMinorRevigoration();

            if (Core.AOS)
            {
                BaseRunicTool.ApplyAttributesTo(jewel, 2, 5, 10);
            }

            jewel.Attributes.Luck = 200;
            jewel.LootType        = LootType.Blessed;

            pm.AddToBackpack(jewel);

            System.Complete();
        }
Example #18
0
        public override void Transformer(PlayerMobile from)
        {
            if (raceSecrete == RaceSecrete.Aucun || Transformed == true)
            {
                return;
            }

            Race.SupprimerSkin(from);

            if (raceSecrete == RaceSecrete.Tieffelin)
            {
                if (from.FindItemOnLayer(Layer.Cloak) != null)
                {
                    from.AddToBackpack(from.FindItemOnLayer(Layer.Cloak));
                }

                from.AddItem(new AilesTieffelin());
                from.AddItem(new CorpsTieffelin());

                if (from.FindItemOnLayer(Layer.Helm) != null)
                {
                    from.AddToBackpack(from.FindItemOnLayer(Layer.Helm));
                }

                from.AddItem(new CornesTieffelin());
            }
            else
            {
                from.AddItem(new CorpsAasimar());
            }
            from.Hue = hueSecrete;
            int tmphue = from.HairHue;

            from.HairHue       = hairhue;
            hairhue            = tmphue;
            tmphue             = from.FacialHairHue;
            from.FacialHairHue = beardhue;
            beardhue           = tmphue;
            from.Identities.Transformer();
            Transformed = true;
        }
Example #19
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is LetterDeliveryQuest)
                {
                    if (dropped is LesserHealPotion)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(PotionObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                            PlaySound(1054);
                            player.AddToBackpack(new LetterToCecilia());
                            dropped.Delete();
                        }
                    }
                    else if (dropped is LetterToOzzy)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(DeliverLetterToOzzyObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                            player.AddToBackpack(new Gold(1000));
                            player.AddToBackpack(new FireOpal());
                            player.AddToBackpack(new SkillSlotDeedQuestReward());
                            player.AddToBackpack(new WeightIncreaseDeed());
                            dropped.Delete();
                        }
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
Example #20
0
        private static void EventSink_EquipLastWeaponMacroUsed(EquipLastWeaponMacroEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (!pm.CanBeginAction(typeof(EquipLastWeapon)))
            {
                pm.SendLocalizedMessage(500119);                   // You must wait to perform another action.
                return;
            }

            pm.BeginAction(typeof(EquipLastWeapon));

            Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(Expire_Callback), pm);

            if (pm != null && pm.Backpack != null)
            {
                BaseWeapon weapon = pm.LastEquipedWeapon;
                Item       hand1  = pm.FindItemOnLayer(Layer.OneHanded);
                Item       hand2  = pm.FindItemOnLayer(Layer.TwoHanded);

                if (weapon != null)
                {
                    if (!weapon.IsChildOf(pm.Backpack))
                    {
                        pm.SendLocalizedMessage(1063109);                           // Your last weapon must be in your backpack to be able to switch it quickly.
                        return;
                    }

                    if (weapon.Layer == Layer.TwoHanded && hand2 is BaseShield)
                    {
                        pm.SendLocalizedMessage(1063114);                           // You cannot pick up your last weapon!
                        return;
                    }

                    Item olditem = hand2 is BaseWeapon ? hand2 : hand1;

                    if (olditem != null && !pm.AddToBackpack(olditem))
                    {
                        pm.SendLocalizedMessage(1063110);                           // Your backpack cannot hold the weapon in your hand.
                    }
                    else if (pm.EquipItem(weapon))
                    {
                        pm.SendLocalizedMessage(1063112);                           // You pick up your last weapon.
                        pm.LastEquipedWeapon = olditem as BaseWeapon;
                    }
                    else
                    {
                        pm.SendLocalizedMessage(1063113);                           // You put your weapon into your backpack, but cannot pick up your last weapon!
                    }
                }
            }
        }
Example #21
0
        public virtual void BonusAction(PlayerMobile player, Mobile attacker)
        {
            if (player != null && player.Backpack != null)
            {
                Diamond diamond = new Diamond();
                diamond.ItemID = 0xF29;
                player.AddToBackpack(diamond);
            }

            if (attacker != null)
            {
                attacker.Poison = Poison.Lethal;
            }
        }
Example #22
0
        public bool TryGiveOut(Mobile m)
        {
            PlayerMobile pm = m as PlayerMobile;

            if (pm != null && !pm.Deleted && pm.Backpack != null)
            {
                if (pm.Backpack.ConsumeTotal(m_priceType, m_priceAmount))
                {
                    Item newItem = null;
                    if (m_itemParameter == -1)
                    {
                        newItem = Activator.CreateInstance(m_type) as Item;
                    }
                    else
                    {
                        ConstructorInfo[] ctors = m_type.GetConstructors();
                        //Find 1-int-constructor (for amount/skillball bonus/etc.)
                        for (int i = 0; i < ctors.Length && newItem == null; ++i)
                        {
                            ConstructorInfo ctor      = ctors[i];
                            ParameterInfo[] paramList = ctor.GetParameters();
                            if (paramList.Length == 1 && paramList[0].ParameterType.Name == "Int32")
                            {
                                object[] o = new object[1];
                                o[0]    = m_itemParameter;
                                newItem = ctor.Invoke(o) as Item;
                            }
                        }
                    }
                    if (newItem != null)
                    {
                        if (!pm.AddToBackpack(newItem))
                        {
                            newItem.MoveToWorld(pm.Location);
                        }
                        pm.SendMessage("The item has been placed in your backpack.");
                        return(true);
                    }
                    else
                    {
                        GeneralLogging.WriteLine("PrizeSystem", "Acc:{0} purchased {1} and was charged {2} but did not receive the item.", pm.Account.ToString(), m_name, m_priceString);
                    }
                }
                else
                {
                    pm.SendMessage("You need {0} to purchase this item.", this.PriceString);
                }
            }
            return(false);
        }
Example #23
0
        public override void OnDoubleClick(Mobile from)
        {
            BankBox box = from.BankBox;

            if (box != null && IsChildOf(box))
            {
                PlayerMobile pm = from as PlayerMobile;

                base.OnDoubleClick(from);

                BankCheck check;

                if (this.Amount == 1)
                {
                    check = new BankCheck(1000000);

                    this.Delete();

                    if (box.TryDropItem(pm, check, false))
                    {
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                    else
                    {
                        check.Delete();
                        pm.AddToBackpack(new BankCheck(1000000));
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                }
                else if (this.Amount >= 2)
                {
                    check = new BankCheck(1000000);

                    if (box.TryDropItem(pm, check, false))
                    {
                        this.Amount -= 1;
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                    else
                    {
                        check.Delete();
                        pm.SendMessage("There is not enough room in your bank box for the check.");
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1047026);                   // That must be in your bank box to use it.
            }
        }
Example #24
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            if (e.Speech.ToLower() == "i seek the lotus")
            {
                PristineCrystalLotusQuest quest = QuestHelper.GetQuest <PristineCrystalLotusQuest>(pm);

                if (quest != null)
                {
                    pm.SendLocalizedMessage(1151300); // Complete the puzzle to obtain a Pristine Crystal Lotus.
                }
                else
                {
                    pm.SendLocalizedMessage(1151301); // You marvel at the flashing tiles.
                }

                e.Handled = true;
            }
            else if (e.Speech.ToLower() == "give me the lotus")
            {
                PristineCrystalLotusQuest quest = QuestHelper.GetQuest <PristineCrystalLotusQuest>(pm);

                if (quest != null)
                {
                    if (quest.PuzzlesComplete < 5)
                    {
                        pm.SendLocalizedMessage(1151303); // You have not completed the puzzle.
                    }
                    else if (!quest.ReceivedLotus)
                    {
                        PristineCrystalLotus lotus = new PristineCrystalLotus();
                        pm.AddToBackpack(lotus);
                        pm.SendLocalizedMessage(1151302); // A Pristine Crystal Lotus has been placed in your backpack.

                        QuestHelper.CheckRewardItem(pm, lotus);

                        quest.ReceivedLotus = true;
                    }
                }

                e.Handled = true;
            }
        }
Example #25
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            PlayerMobile from = state.Mobile as PlayerMobile;

            if (info.ButtonID > 0)
            {
                from.AddToBackpack(new PowerScroll((SkillName)info.ButtonID - 1, 120));
                from.CloseGump(typeof(SelectionGump));
                m_Ball.Delete();
            }
            else
            {
                from.CloseGump(typeof(SelectionGump));
            }
        }
Example #26
0
        public static void HandleSteal(BaseCreature from, PlayerMobile thief)
        {
            if (from.HasBeenStolen)
            {
                thief.SendLocalizedMessage(1094948); //That creature has already been stolen from.  There is nothing left to steal.
                return;
            }

            if (from.Controlled || from.Summoned)
            {
                thief.SendLocalizedMessage(502708); //You can't steal from this.
                return;
            }

            if (!CheckLocation(thief, from))
            {
                return;
            }

            double stealing = thief.Skills.Stealing.Value;

            if (stealing < 100)
            {
                return;
            }

            int chance = GetStealingChance(thief, from, stealing);

            if ((Utility.Random(100) + 1) <= chance)
            {
                thief.SendLocalizedMessage(1094947);//You successfully steal a special item from the creature!

                Item item;

                if (from is ExodusZealot)
                {
                    item = Activator.CreateInstance(ExodusChest.RituelItem[Utility.Random(ExodusChest.RituelItem.Length)]) as Item;
                }
                else
                {
                    item = Activator.CreateInstance(SpecialItemList[Utility.Random(SpecialItemList.Length - 2)]) as Item;
                }

                thief.AddToBackpack(item);
            }

            from.HasBeenStolen = true;
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is TheFairElainQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(BringBookToVacarObjective));

                    if (qs.IsObjectiveInProgress(typeof(BringBookToVacarObjective)))
                    {
                        if (dropped is VacarsLoveLetter)
                        {
                            if (dropped.Amount != 1)
                            {
                                this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", player.NetState);
                                return(false);
                            }

                            dropped.Delete();
                            player.AddToBackpack(new Gold(500));

                            player.AddToBackpack(new SkillSlotDeedQuestReward());
                            player.AddToBackpack(new WeightIncreaseDeed());
                            player.AddToBackpack(new QuestGoodieBag());

                            switch (Utility.Random(2))
                            {
                            case 0: player.AddToBackpack(new JaggedKatana()); break;

                            case 1: player.AddToBackpack(new Mauler()); break;
                            }

                            qs.AddConversation(new ErikSullivanEndConversation());

                            return(true);
                        }
                    }
                    else if (dropped is AndorasBook)
                    {
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, player.NetState);
                        return(false);
                    }
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "This isn't what I asked for, runt.", player.NetState);
                }
            }

            return(false);
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

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

                if (qs is FamilyJewelsQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(ObtainBlueAppleObjective));

                    if (qs.IsObjectiveInProgress(typeof(ObtainBlueAppleObjective)))
                    {
                        if (dropped is BlueAppleQuest)
                        {
                            if (dropped.Amount != 1)
                            {
                                this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", player.NetState);
                                return(false);
                            }

                            dropped.Delete();
                            player.AddToBackpack(new ArrianasClips());

                            obj.Complete();
                            qs.AddConversation(new AuntieJune2Conversation());

                            return(true);
                        }
                    }
                    else if (dropped is BlueAppleQuest)
                    {
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, player.NetState);
                        return(false);
                    }
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Find me a blue apple that can be lifted.", player.NetState);
                }
            }

            return(false);
        }
        public static void ClaimAllDonationItems_OnCommand(CommandEventArgs e)
        {
            PlayerMobile pm       = (PlayerMobile)e.Mobile;
            BankBox      box      = pm.FindBankNoCreate();
            ArrayList    itemList = GetDonationGiftList(pm.Account.Username);

            for (int i = 0; i < itemList.Count; i++)
            {
                DonationGift giftInfo = (DonationGift)itemList[i];
                Item         gift     = RedeemGift(giftInfo.Id, pm.Account.Username) as Item;
                if (!box.TryDropItem(pm, gift, false))
                {
                    pm.AddToBackpack(gift);
                }
            }

            pm.SendMessage("{0} items has been placed in your bank box. Thank you for your donation!", itemList.Count);
        }
Example #30
0
        public static void GiveReward(PlayerMobile winner)
        {
            int chance = Utility.Random(10000);

            if (chance <= 25)
            {
                Item item = (Item)Activator.CreateInstance(PvpArtifacts[Utility.Random(PvpArtifacts.Length)]);

                if (winner.AddToBackpack(item))
                {
                    winner.SendMessage("You have been rewarded for slaying your foe.");
                }
                else
                {
                    winner.SendMessage("You have been rewarded for slaying your foe, but your backpack is full the item has feel to your feet.");
                }
            }
        }