Пример #1
0
        public override void OnDoubleClick(Mobile from)
        {
            bool soaked;

            CheckWater(from, 3, out soaked);

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to fill.");
                return;
            }
            else if (soaked)
            {
                from.SendMessage("You fill the waterskin with fresh water.");
                from.PlaySound(0x240);
                this.Consume();
                Item flask = new Waterskin();
                flask.ItemID = 0x98F;
                flask.Name   = "waterskin";
                from.AddToBackpack(flask);
            }
            else if (from.Thirst < 20)
            {
                from.Thirst += 5;
                // Send message to character about their current thirst value
                int iThirst = from.Thirst;
                if (iThirst < 5)
                {
                    from.SendMessage("You drink the dirty water but are still extremely thirsty");
                }
                else if (iThirst < 10)
                {
                    from.SendMessage("You drink the dirty water and feel less thirsty");
                }
                else if (iThirst < 15)
                {
                    from.SendMessage("You drink the dirty water and feel much less thirsty");
                }
                else
                {
                    from.SendMessage("You drink the dirty water and are no longer thirsty");
                }

                this.Consume();

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                from.PlaySound(Utility.RandomList(0x30, 0x2D6));

                Item flask = new Waterskin();
                flask.ItemID = 0xA21;
                flask.Name   = "empty waterskin";
                from.AddToBackpack(flask);

                int iHeal = (int)from.Skills[SkillName.TasteID].Value;
                int iHurt = from.StamMax - from.Stam;

                if (iHurt > 0)                   // WIZARD DID THIS FOR TASTE ID
                {
                    if (iHeal > iHurt)
                    {
                        iHeal = iHurt;
                    }

                    from.Stam = from.Stam + iHeal;

                    if (from.Poisoned)
                    {
                        if ((int)from.Skills[SkillName.TasteID].Value >= Utility.RandomMinMax(1, 100))
                        {
                            from.CurePoison(from);
                            from.SendLocalizedMessage(1010059);                               // You have been cured of all poisons.
                        }
                    }
                }
                // CHECK FOR ANY DUNGEON FOOD ILLNESSES //////////////////////////////////////
                if (from.CheckSkill(SkillName.TasteID, 0, 100))
                {
                }
                else if (Utility.RandomMinMax(1, 100) > 70)
                {
                    int nPoison = Utility.RandomMinMax(0, 10);
                    from.Say("Poison!");
                    if (nPoison > 9)
                    {
                        from.ApplyPoison(from, Poison.Deadly);
                    }
                    else if (nPoison > 7)
                    {
                        from.ApplyPoison(from, Poison.Greater);
                    }
                    else if (nPoison > 4)
                    {
                        from.ApplyPoison(from, Poison.Regular);
                    }
                    else
                    {
                        from.ApplyPoison(from, Poison.Lesser);
                    }
                    from.SendMessage("Poison!");
                }
            }
            else
            {
                from.SendMessage("You are simply too quenched to drink any more!");
                from.Thirst = 20;
            }
        }
Пример #2
0
        public override void OnDoubleClick(Mobile from)
        {
            bool soaked;

            Server.Items.DrinkingFunctions.CheckWater(from, 3, out soaked);

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to use.");
                return;
            }
            else if (soaked)
            {
                from.SendMessage("You fill the container with fresh water.");
                from.PlaySound(0x240);
                this.Consume();
                Item flask = new Waterskin();
                flask.ItemID = this.ItemID;
                flask.Name   = "waterskin";
                if (this.ItemID == 0x48E4)
                {
                    flask.Name = "canteen";
                }
                flask.Weight = 2.0;
                from.AddToBackpack(flask);
            }
            else if (from.Thirst < 20)
            {
                from.Thirst += 5;
                // Send message to character about their current thirst value
                int iThirst = from.Thirst;
                if (iThirst < 5)
                {
                    from.SendMessage("You drink the dirty water but are still extremely thirsty");
                }
                else if (iThirst < 10)
                {
                    from.SendMessage("You drink the dirty water and feel less thirsty");
                }
                else if (iThirst < 15)
                {
                    from.SendMessage("You drink the dirty water and feel much less thirsty");
                }
                else
                {
                    from.SendMessage("You drink the dirty water and are no longer thirsty");
                }

                this.Consume();

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                from.PlaySound(Utility.RandomList(0x30, 0x2D6));

                Item flask = new Waterskin();
                flask.Weight = 1.0;
                flask.ItemID = 0xA21;
                flask.Name   = "empty waterskin";
                if (this.ItemID == 0x48E4)
                {
                    flask.ItemID = 0x48E4; flask.Name = "empty canteen";
                }
                from.AddToBackpack(flask);

                Server.Items.DrinkingFunctions.DrinkBenefits(from);

                // CHECK FOR ANY DUNGEON FOOD ILLNESSES //////////////////////////////////////
                if (from.CheckSkill(SkillName.TasteID, 0, 100))
                {
                }
                else if (Utility.RandomMinMax(1, 100) > 70)
                {
                    int nPoison = Utility.RandomMinMax(0, 10);
                    from.Say("Poison!");
                    if (nPoison > 9)
                    {
                        from.ApplyPoison(from, Poison.Deadly);
                    }
                    else if (nPoison > 7)
                    {
                        from.ApplyPoison(from, Poison.Greater);
                    }
                    else if (nPoison > 4)
                    {
                        from.ApplyPoison(from, Poison.Regular);
                    }
                    else
                    {
                        from.ApplyPoison(from, Poison.Lesser);
                    }
                    from.SendMessage("Poison!");
                }
            }
            else
            {
                from.SendMessage("You are simply too quenched to drink any more!");
                from.Thirst = 20;
            }
        }