Ejemplo n.º 1
0
        private void Restock_Callback()
        {
            if (TotalItems < ItemsMax)
            {
                for (int i = TotalItems; i < ItemsMax; i++)
                {
                    Item item = null;

                    switch (Utility.RandomMinMax(1, 11))
                    {
                    default:
                    case 1: item = new Grapes(); break;

                    case 2: item = new Ham(); break;

                    case 3: item = new CheeseWedge(); break;

                    case 4: item = new Muffins(); break;

                    case 5: item = new FishSteak(); break;

                    case 6: item = new Ribs(); break;

                    case 7: item = new CookedBird(); break;

                    case 8: item = new Sausage(); break;

                    case 9: item = new Apple(); break;

                    case 10: item = new Peach(); break;

                    case 11: item = new Bandage(); break;
                    }

                    if (item != null)
                    {
                        DropItem(item);
                    }
                }
            }
        }
Ejemplo n.º 2
0
            public static void JunkBeg(Mobile m, object targeted, double chance)             //Nothing Good. Here have some crap
            {
                Mobile    t          = (Mobile)targeted;
                bool      orcs       = IsOrc(t);
                Container theirPack  = t.Backpack;
                Item      reward     = null;
                string    rewardName = "";

                if (chance >= .76 && m.Skills.Begging.Base >= 75)
                {
                    int rand = Utility.Random(10);

                    if (rand == 0)
                    {
                        reward     = new WoodenBowlOfPeas();
                        rewardName = "a bowl of peas";
                    }
                    else if (rand == 1)
                    {
                        reward     = new CheeseWedge();
                        rewardName = "a cheese wedge";
                    }
                    else if (rand == 2)
                    {
                        reward     = new Dates();
                        rewardName = "some dates";
                    }
                    else if (rand == 3)
                    {
                        reward     = new BeggerCoins(6);
                        rewardName = "6 dull silver coins.";
                    }
                    else if (rand == 4)
                    {
                        reward     = new BeverageBottle(BeverageType.Ale);
                        rewardName = "a bottle of ale";
                    }
                    else if (rand == 5)
                    {
                        reward     = new CheesePizza();
                        rewardName = "a cheese pizza";
                    }
                    else if (rand == 6)
                    {
                        reward     = new Shirt();
                        rewardName = "a shirt";
                    }
                }
                Console.WriteLine("RewardName (3) {0}", reward);
                if (chance >= .25 && reward == null)
                {
                    reward     = new FrenchBread();
                    rewardName = "french bread";
                }

                if (reward == null && orcs == false)                 //Gold from Non Orcs and if you got nothing else from above.
                {
                    int toConsume = theirPack.GetAmount(typeof(Gold)) / 10;
                    int max       = 10 + (m.Fame / 2500);

                    if (max > 14)
                    {
                        max = 14;
                    }
                    else if (max < 10)
                    {
                        max = 10;
                    }

                    if (toConsume > max)
                    {
                        toConsume = max;
                    }

                    if (toConsume > 0)
                    {
                        int consumed = theirPack.ConsumeUpTo(typeof(Gold), toConsume);

                        if (consumed > 0)
                        {
                            t.PublicOverheadMessage(MessageType.Regular, t.SpeechHue, 500405);
                            // I feel sorry for thee...

                            Gold gold = new Gold(consumed);

                            reward     = new Gold(consumed);
                            rewardName = "Gold";
                            m.PlaySound(gold.GetDropSound());
                            if (orcs == false)
                            {
                                if (m.Karma > -3000)
                                {
                                    int toLose = m.Karma + 3000;

                                    if (toLose > 40)
                                    {
                                        toLose = 40;
                                    }

                                    Titles.AwardKarma(m, -toLose, true);
                                }
                            }
                        }
                        else
                        {
                            if (orcs == false)                             //Orcs Dont speak English
                            {
                                t.PublicOverheadMessage(MessageType.Regular, t.SpeechHue, 500407);
                            }
                            // I have not enough money to give thee any!
                        }
                    }
                    else
                    {
                        if (orcs == false)                         //Orcs Dont Speak English
                        {
                            t.PublicOverheadMessage(MessageType.Regular, t.SpeechHue, 500407);
                        }
                        // I have not enough money to give thee any!
                    }
                }
                Reward(m, t, reward, rewardName);
            }