private void CreatePotion(){
		newPotion = new BasePotion ();
		newPotion.ItemName = "Potion";
		newPotion.ItemDescription = "This is a potion.";
		newPotion.ItemID = Random.Range (1, 101);
		ChoosePotionType ();
	}
Example #2
0
 private void CreatePotion()
 {
     newPotion = new BasePotion();
     newPotion.ItemName = potionNames[Random.Range(0, 3)] + " Potion";
     newPotion.ItemDescription = potionDescriptions[Random.Range(0, 1)];
     newPotion.ItemId = Random.Range(200, 299);
     ChoosePotionType();
 }
Example #3
0
	private void CreatePotion() {
		newPotion = new BasePotion ();
		newPotion.ItemName = itemNames [Random.Range(0, itemNames.Length)] + " Potion";
		newPotion.ItemDsecription = "This is a Potion";
		newPotion.ItemID = Random.Range(1, 101);
		ChoosePotionType();

	}
 public void createPotion()
 {
     newPotion = new BasePotion();
     newPotion.ItemName = "Potion";
     newPotion.ItemDescription = "A new awsome potion!";
     newPotion.ItemID = Random.Range(1, 101);
     choosePotionType();
 }
Example #5
0
 public BasePotion CreatePotion()
 {
     newPotion = new BasePotion();
     newPotion.ItemName = "Potion";
     newPotion.ItemDescription = "This is a potion.";
     newPotion.ItemID = Random.Range(1,101);
     ChoosePotionType();
     return newPotion;
 }
Example #6
0
    private void CreatePotion()
    {
        newPotion = new BasePotion ();
        newPotion.itemName = "Potion";
        newPotion.itemDescription = "This is a potion.";
        newPotion.itemID = Random.Range (1, 101);
        ChoosePotionType ();

        newPotion.stamina = Random.Range (1, 11);
        newPotion.endurance = Random.Range (1, 11);
        newPotion.strength = Random.Range (1, 11);
        newPotion.intellect = Random.Range (1, 11);
    }
Example #7
0
        public override void Drink(Mobile from)
        {
            if (from.Poisoned)
            {
                DoCure(from);

                BasePotion.PlayDrinkEffect(from);

                from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                from.PlaySound(0x1E0);

                this.Consume();
            }
            else
            {
                from.SendLocalizedMessage(1042000); // You are not poisoned.
            }
        }
Example #8
0
        public override void Drink(Mobile from)
        {
            if (from.Stam < from.StamMax)
            {
                from.Stam += Scale(from, (int)(Refresh * from.StamMax));

                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                {
                    this.Consume();
                }
            }
            else
            {
                from.SendMessage("You decide against drinking this potion, as you are already at full stamina.");
            }
        }
Example #9
0
        public override void Drink(Mobile from)
        {
            if (from.BeginAction(typeof(LightCycle)))
            {
                new LightCycle.NightSightTimer(from).Start();
                from.LightLevel = LightCycle.DungeonLevel / 2;

                from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
                from.PlaySound(0x1E3);

                BasePotion.PlayDrinkEffect(from);
                this.Consume();
            }
            else
            {
                from.SendMessage("You already have nightsight.");
            }
        }
Example #10
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                bool releaseLock = true;

                if (targeted is Food) //Only skill check
                {
                    releaseLock = false;
                    new InternalTimer(from, (Food)targeted).Start();
                }
                else if (targeted is Mobile)
                {
                    from.SendAsciiMessage("You feel that such an action would be inappropriate.");
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;
                    from.SendAsciiMessage("You already know what kind of potion that is.");
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        from.SendAsciiMessage("There is nothing in the keg to taste!");
                    }
                    else
                    {
                        from.SendAsciiMessage("You are already familiar with this keg's contents.");
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else
                {
                    from.SendAsciiMessage("That's not something you can taste.");
                }


                if (releaseLock && from is PlayerMobile)
                {
                    ((PlayerMobile)from).EndPlayerAction();
                }
            }
Example #11
0
        public void Pour(Mobile from, Item item)
        {
            if (!IsAccessibleTo(from))
            {
                LabelTo(from, "You cannot pour potions on that.");
                return;
            }

            if (item is BasePotion)
            {
                BasePotion potion = (BasePotion)item;

                string message;
                if (ApplyPotion(potion.PotionEffect, false, out message))
                {
                    potion.Delete();
                    from.PlaySound(0x240);
                    from.AddToBackpack(new Bottle());
                }
                LabelTo(from, message);
            }
            else if (item is PotionKeg)
            {
                PotionKeg keg = (PotionKeg)item;

                if (keg.Held <= 0)
                {
                    LabelTo(from, "You cannot use that on a beehive!");
                    return;
                }

                string message;
                if (ApplyPotion(keg.Type, false, out message))
                {
                    keg.Held--;
                    from.PlaySound(0x240);
                }
                LabelTo(from, message);
            }
            else
            {
                LabelTo(from, "You cannot use that on a beehive!");
            }
        }
Example #12
0
        public static void Nightsight_Command(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from.BeginAction(typeof(LightCycle)))
            {
                new LightCycle.NightSightTimer(from).Start();
                from.LightLevel = LightCycle.DungeonLevel / 2;

                from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
                from.PlaySound(0x1E3);

                BasePotion.PlayDrinkEffect(from);
            }
            else
            {
                from.SendAsciiMessage("You already have nightsight.");
            }
        }
Example #13
0
 public BaseItem CreateAItem(int ItemSelection)
 {
     if (ItemSelection == 1) {
         anEquipment = newEquipment.CreateEquipment ();
         return anEquipment;
     } else if (ItemSelection == 2) {
         aWeapon = newWeapon.CreateWeapon ();
         return aWeapon;
     } else if (ItemSelection == 3) {
         aPotion = newPotion.CreatePotion ();
         return aPotion;
     } else if (ItemSelection == 4) {
         aScroll = newScroll.CreateScroll ();
         return aScroll;
     } else {
         anEquipment = newEquipment.CreateEquipment ();
         return anEquipment;
     }
 }
Example #14
0
        public override void OnDoubleClick(Mobile m)
        {
            if (!Movable)
            {
                return;
            }

            if (IsChildOf(m.Backpack))
            {
                DateTime dt = DateTime.UtcNow;

                if (!ViceVsVirtueSystem.IsVvV(m))
                {
                    m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
                }
                else if (!BasePotion.HasFreeHand(m))
                {
                    m.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
                }
                else if (IsInCooldown(m, ref dt))
                {
                    TimeSpan left = dt - DateTime.UtcNow;

                    if (left.TotalMinutes > 2)
                    {
                        m.SendLocalizedMessage(1114110, ((int)left.TotalMinutes).ToString()); // You must wait ~1_minutes~ minutes before using another one of these.
                    }
                    else
                    {
                        m.SendLocalizedMessage(1114109, ((int)left.TotalSeconds).ToString()); // You must wait ~1_seconds~ seconds before using another one of these.
                    }
                }
                else if (CheckUse(m))
                {
                    UseEffects(m);
                    Use(m);
                }
            }
            else
            {
                m.SendLocalizedMessage(1042004); // That must be in your pack for you to use it
            }
        }
Example #15
0
    //TODO Create array of strings to be used for weapon info
    //TODO Read a JSON or XML File of weapons
    //private string[] potionNames = new String[x]; //Test code for creating the array

    public void CreatePotion()
    {
        newPotion = new BasePotion();

        //Name
        newPotion.ItemName = "Test Potion Name";
        //newPotion.ItemName = potionNames[x]

        //Description
        newPotion.ItemDescription = "This is a potion description";

        //ID
        newPotion.ItemID = Random.Range(201, 301);

        //Potion Type
        ChoosePotionType();

        //Spell Effect
        newPotion.SpellEffectID = Random.Range(1, 20);        //This will need to be set based on the type of potion at a later date TODO
    }
Example #16
0
    public void CreatePotion()
    {
        newPotion = new BasePotion ();

        //assign Base Item
        newPotion.ItemName = "Potion";
        newPotion.ItemDescription = "This is a damn fine potion, dude.";
        newPotion.ItemID = Random.Range (1, 101);

        //assign Base stat
        newPotion.Size=1;
        newPotion.Durability=1;
        newPotion.Itemlevel=1;
        newPotion.Itemlevelreq=1;

        newPotion.SpellEffectID=Random.Range (1, 101);
        newPotion.PotionValue=Random.Range(1, 10);

        //WeaponType
        ChoosePotionType ();
    }
Example #17
0
    public void CreatePotion()
    {
        newPotion = new BasePotion();

        //assign Base Item
        newPotion.ItemName        = "Potion";
        newPotion.ItemDescription = "This is a damn fine potion, dude.";
        newPotion.ItemID          = Random.Range(1, 101);

        //assign Base stat
        newPotion.Size         = 1;
        newPotion.Durability   = 1;
        newPotion.Itemlevel    = 1;
        newPotion.Itemlevelreq = 1;

        newPotion.SpellEffectID = Random.Range(1, 101);
        newPotion.PotionValue   = Random.Range(1, 10);

        //WeaponType
        ChoosePotionType();
    }
Example #18
0
 public void calculatePlayerRegeneration(BasePotion playerUsedPotion)
 {
     if (playerUsedPotion.PotionName == "Health Potion")
     {
         GameInformation.currentHealth += playerUsedPotion.PotionPower;
         if (GameInformation.currentHealth > GameInformation.Health)
         {
             GameInformation.currentHealth = GameInformation.Health;
         }
         GameInformation.currentHP -= 1;
     }
     if (playerUsedPotion.PotionName == "Mana Potion")
     {
         GameInformation.currentMana += playerUsedPotion.PotionPower;
         if (GameInformation.currentMana > GameInformation.Mana)
         {
             GameInformation.currentMana = GameInformation.Mana;
         }
         GameInformation.currentMP -= 1;
     }
     TBCStateMachine.playerCompletedTurn = true;
 }
Example #19
0
        public static void Drink_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            Type type = ScriptCompiler.FindTypeByName(e.GetString(0).Trim().ToLower(), true);

            if (type != null && typeof(BasePotion).IsAssignableFrom(type))
            {
                BasePotion potion = from.Backpack.FindItemByType(type, true) as BasePotion;

                if (potion != null)
                {
                    DoubleClickCommand.CommandUseReq(from, potion);
                }
                else
                {
                    from.SendMessage("You do not have any of those potions.");
                }
            }
            else
            {
                from.SendMessage("That is not a type of potion.");
            }
        }
Example #20
0
    // Use this for initialization
    void Start()
    {
        round.text  = " ";
        maxStamina  = 40;
        currStamina = 40;
        strength    = 3;
        initiative  = 7;
        equip       = new BaseArmour();
        equip2      = new BaseArmour();
        equip3      = new BaseArmour();
        weap        = new BaseWeapon();
        pot1        = new BasePotion();
        pot2        = new BasePotion();
        pot3        = new BasePotion();
        int ctr = 0;

        prefabList.Add(Prefab1);
        prefabList.Add(Prefab2);
        SpawnEnemy();
        str.text     = "Strength: " + strength.ToString();
        potion1.text = "Potion1: " + pot1.ItemName;
        potion2.text = "Potion2: " + pot2.ItemName;
        potion3.text = "Potion3: " + pot3.ItemName;
    }
Example #21
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!Movable)
            {
                return;
            }

            if (from.InRange(this.GetWorldLocation(), 1))
            {
                if (BasePotion.HasFreeHand(from))
                {
                    from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
                    from.SendMessage("Target the creature to shrink.");
                }
                else
                {
                    from.SendMessage("You must have a free hand to use this potion.");
                }
            }
            else
            {
                from.SendLocalizedMessage(502138); // That is too far away for you to use
            }
        }
Example #22
0
            protected override void OnTarget(Mobile from, object targeted)
            {
////////////////////////////////////////////////////////////// Mobiles
                if (targeted is BaseCreature)
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, creature, 0.0, 100.0))
                    {
////////////////////////////////////////////////////////////// Zaythalor Forest
                        if (creature is BlackAntZaythalorForest)
                        {
                            creature.Say("Bro, I ain't worth nutin! You hear me {0}", from.Name);
                        }
                        else if (creature is FaerieBeetle)
                        {
                            from.Hits += (Utility.Random(10, 15));
                            from.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head);
                            from.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head);
                            from.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist);
                            from.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist);
                            from.PlaySound(0x202);

                            from.SendMessage("It's magically delicious.");
                        }
                        else if (creature is FaerieBeetleCollector)
                        {
                            from.Hits += (Utility.Random(2, 5));
                            from.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                            from.PlaySound(0x1F2);

                            from.SendMessage("It's magically delicious, at a fraction of the price.");
                        }
                        else if (creature is ForestBat)
                        {
                            creature.SendMessage("Nah Nah Nah Nah Nah Nah Nah Nah! Batman!");
                        }
                        else if (creature is GazerLarva)
                        {
                            if (from.Skills.Magery.Base >= 50.0)
                            {
                                from.Skills.Magery.Base += 0.2;
                                creature.Kill();
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is Gizzard)
                        {
                            from.AddToBackpack(new BlackPearl(5));
                            creature.Combatant = from;

                            if (from.Skills.Magery.Base >= 50.0)
                            {
                                from.Skills.Magery.Base += 0.2;
                                creature.Kill();
                            }
                        }
                        else if (creature is GreenSlime)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.Kill();
                            }
                            else
                            {
                                from.SendMessage("Slimer!");
                                from.ApplyPoison(from, Poison.Lesser);
                            }
                        }
                        else if (creature is GreySquirrel)
                        {
                            from.AddToBackpack(new Apple(3));
                            creature.Combatant = from;

                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is LargeFrog)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 80;
                                from.HueMod  = 663;
                                from.SendMessage("You shall forever remain stuck as a large frog until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*ribbit!*");
                            }
                        }
                        else if (creature is LesserAntLion)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 787;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a lesser antlion until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is MadPumpkinSpirit)
                        {
                            if (from.Skills.Cooking.Base >= 50.0)
                            {
                                from.Skills.Cooking.Base += 0.3;
                                creature.Kill();
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*Not Appropriate!*");
                            }
                        }
                        else if (creature is RhinoBeetle)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 247;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a rhino beetle until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.PlaySound(0x21D);
                                creature.Say("*fresh meat!*");
                            }
                        }
                        else if (creature is WildTurkey)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 1026;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a wild turkey until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is Ogumo)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                creature.Kill();
                                from.AddToBackpack(new SpiderPotion());
                                from.SendMessage("You vanquish thy foe using your dirty mouth. A potion has been added to your pack. Use it wisely.");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Alytharr Region

                        else if (creature is SandCrab)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 357;
                                from.HueMod  = 1864;
                                from.SendMessage("You shall forever remain stuck as a sand crab until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

                        else if (creature is WyvernYoungling)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 62;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a wyvern until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Autumnwood

                        else if (creature is Harpy)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 30;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a harpy until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

                        else if (creature is SkitteringHopper)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 302;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a skittering hopper until your next death");
                                from.Flying = true;
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Glimmerwood

                        else if (creature is HealerAnt)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.Hits += (Utility.Random(25, 50));
                                from.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head);
                                from.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head);
                                from.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist);
                                from.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist);
                                from.PlaySound(0x202);
                            }
                        }
                        else if (creature is Parrot)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;

                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }

////////////////////////////////////////////////////////////// Harashi Nabi Desert

                        else if (creature is OphidianMatriarch)
                        {
                            if (from.Skills.TasteID.Base >= 100.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 87;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as an ophidian matriarch until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Samson Swamplands

                        else if (creature is AnnoyingLlama1)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 792 : 1064);
                                from.Say("*farts*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.Skills.AnimalTaming.Base += 1;
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                            }
                        }
                        else if (creature is AnnoyingLlama2)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 782 : 1053);
                                from.Say("*burp!*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.Skills.AnimalTaming.Base += 1;
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                            }
                        }
                        else if (creature is AnnoyingLlama3)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 812 : 1086);
                                from.Say("*oops!*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                                from.Skills.AnimalTaming.Base += 1;
                            }
                        }

////////////////////////////////////////////////////////////// Misc Mobiles
                        else if (creature is Bird)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is Boar)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;
                        }
                        else if (creature is Cat)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is Chicken)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 0xD0;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a chicken until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*bawk! bawk!*");
                            }
                        }
                        else if (creature is PoisonArrowFrog)
                        {
                            if (from.Skills.Poisoning.Base >= 80.0)
                            {
                                from.ApplyPoison(from, Poison.Lesser);
                                from.SendMessage("You've become too corrosive even for this toxic frog to handle.");
                            }
                            else
                            {
                                from.ApplyPoison(from, Poison.Lethal);
                                from.Skills.Poisoning.Base += 1;
                                creature.Kill();
                            }
                        }
                        else if (creature is Pookah)
                        {
                            if (from.Skills.Meditation.Base >= 50.0)
                            {
                                from.Location = new Point3D(364, 733, -20);                            // Glimmerwood Entrance
                                from.PlaySound(0x1FC);
                                from.SendMessage("You've been teleported to the entrance.");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is BaseGuardian)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;
                            creature.Say("Not gonna put up with that nonsense!");
                        }
                        else if (creature is BaseVendor)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                            creature.Say("Faulk off {0}", from.Name);
                        }
                    }
                }
                else if (targeted is PlayerMobile)
                {
                    PlayerMobile playermobile = (PlayerMobile)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, playermobile, 0, 100.0))
                    {
                        if (playermobile.Female == false)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                        }
                        else if (playermobile.Female == true)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                        }
                    }
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            food.SendLocalizedMessageTo(from, 1038284);                               // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            food.SendLocalizedMessageTo(from, 1010600);                               // You detect nothing unusual about this substance.
                        }
                    }
////////////////////////////////////////////////////////////// Fruits
                    else if (food is Apple)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This apple appears rich in nutrients and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This apple appears rich in nutrients and has a fill factor of 1.");
                        }
                    }
                    else if (food is Bananas)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These bananas make for a great breakfast and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These bananas make for a great breakfast and have a fill factor of 1.");
                        }
                    }
                    else if (food is Cantaloupe)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This cantaloupe is as big as yo mommas biscuits and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This cantaloupe is as big as yo mommas biscuits and has a fill factor of 1.");
                        }
                    }
                    else if (food is Coconut)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This coconut may have been originally carried by a swallow of sorts and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This coconut may have been originally carried by a swallow of sorts and has a fill factor of 1.");
                        }
                    }
                    else if (food is Dates)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These dates are a delicacy among Ljosalfar high class officials and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These dates are a delicacy among Ljosalfar high class officials and have a fill factor of 1.");
                        }
                    }
                    else if (food is FruitBasket)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This fruit basket is one of a kind and has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This fruit basket is one of a kind and has a fill factor of 5.");
                        }
                    }
                    else if (food is FruitBowl)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This fruit bowl, the fruit baskets retarded cousin has a fill factor of 4. You're Welcome.");
                        }
                        else
                        {
                            from.SendMessage("This fruit bowl, the fruit baskets retarded cousin has a fill factor of 4. You're Welcome.");
                        }
                    }
                    else if (food is Grapes)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These grapes are as violet as they come and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These grapes are as violet as they come and have a fill factor of 1.");
                        }
                    }
                    else if (food is HoneydewMelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This melon is sometimes cherished by certain arachnids and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This melon is sometimes cherished by certain arachnids and has a fill factor of 1.");
                        }
                    }
                    else if (food is Lemon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This lemon is not without its renowned sour touch and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This lemon is not without its renowned sour touch and has a fill factor of 1.");
                        }
                    }
                    else if (food is Lime)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This lime, normally considered the green bastard reject of the lemon and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This lime, normally considered the green bastard reject of the lemon and has a fill factor of 1.");
                        }
                    }
                    else if (food is Peach)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This peach has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This peach has a fill factor of 1.");
                        }
                    }
                    else if (food is PeachCobbler)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This peach cobbler has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This peach cobbler has a fill factor of 5.");
                        }
                    }
                    else if (food is Pear)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This pear has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This pear has a fill factor of 1.");
                        }
                    }
                    else if (food is SmallWatermelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This small watermelon has a fill factor of 3.");
                        }
                        else
                        {
                            from.SendMessage("This small watermelon has a fill factor of 3.");
                        }
                    }
                    else if (food is SplitCoconut)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This split coconut has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This split coconut has a fill factor of 1.");
                        }
                    }
                    else if (food is Squash)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This squash has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This squash has a fill factor of 1.");
                        }
                    }
                    else if (food is Watermelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This watermelon has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This watermelon has a fill factor of 5.");
                        }
                    }
////////////////////////////////////////////////////////////// Vegetables
                    else if (food is Cabbage)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This cabbage has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This cabbage has a fill factor of 1.");
                        }
                    }
                    else if (food is Carrot)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This carrot has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This carrot has a fill factor of 1.");
                        }
                    }
                    else if (food is EarOfCorn)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This ear of corn has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This ear of corn has a fill factor of 1.");
                        }
                    }
                    else if (food is GreenGourd)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This green gourd has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This green gourd has a fill factor of 1.");
                        }
                    }
                    else if (food is Lettuce)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This head of lettuce has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This head of lettuce has a fill factor of 1.");
                        }
                    }
                    else if (food is Onion)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This onion is full of layers, like an ogre and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This onion is full of layers, like an ogre and has a fill factor of 1.");
                        }
                    }
                    else if (food is Pumpkin)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This pumpkin has a fill factor of 8.");
                        }
                        else
                        {
                            from.SendMessage("This pumpkin has a fill factor of 8.");
                        }
                    }
                    else if (food is Quiche)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This quiche has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This quiche has a fill factor of 5.");
                        }
                    }
                    else if (food is SmallPumpkin)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This small pumpkin has a fill factor of 6.");
                        }
                        else
                        {
                            from.SendMessage("This small pumpkin has a fill factor of 6.");
                        }
                    }
                    else if (food is Turnip)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This turnip has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This turnip has a fill factor of 1.");
                        }
                    }
                    else if (food is YellowGourd)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This yellow gourd has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This yellow gourd has a fill factor of 1.");
                        }
                    }
                    else
                    {
                        // Skill check failed
                        food.SendLocalizedMessageTo(from, 502823);                           // You cannot discern anything about this substance.
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813);                       // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else if (targeted is DecoHorseDung)
                {
                    DecoHorseDung horsedung = (DecoHorseDung)targeted;

                    from.RawInt -= 1;
                    from.Fame   -= 5000;
                    from.Karma  -= 5000;

                    if (0.05 > Utility.RandomDouble())
                    {
                        from.RawInt -= 1;
                        from.Fame   -= 10000;
                        from.Karma  -= 10000;
                        from.Kill();
                    }
                    else if (from.RawInt <= 1)
                    {
                        from.Delete();
                        World.Broadcast(0x35, true, string.Format("{0} was permanently killed off due to being a colossal scathead!", from.Name));
                    }
                }
                else if (targeted is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, weapon, 0.0, 100.0))
                    {
                        if (weapon is BaseAxe)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseBashing)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseKnife)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BasePoleArm)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 15));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseSpear)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseStaff)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseSword)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendLocalizedMessage(502820);                       // That's not something you can taste.
                }
            }
Example #23
0
 void WaitForKeyDown()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         enemy.currStamina = enemy.currStamina - strength;
         if (enemy.currStamina > 0)
         {
             enemyAttack();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         if (string.Compare(pot1.ItemName, "Empty") != 0)
         {
             currStamina += pot1.Stamina;
             if (currStamina > maxStamina)
             {
                 currStamina = maxStamina;
             }
             strength    += pot1.Strength;
             initiative  += pot1.Initiative;
             pot1         = new BasePotion();
             potion1.text = "Potion1: " + pot1.ItemName;
             str.text     = "Strength: " + strength.ToString();
             enemyAttack();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         if (string.Compare(pot2.ItemName, "Empty") != 0)
         {
             currStamina += pot2.Stamina;
             if (currStamina > maxStamina)
             {
                 currStamina = maxStamina;
             }
             strength    += pot2.Strength;
             initiative  += pot2.Initiative;
             pot2         = new BasePotion();
             potion2.text = "Potion2: " + pot2.ItemName;
             str.text     = "Strength: " + strength.ToString();
             enemyAttack();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         if (string.Compare(pot3.ItemName, "Empty") != 0)
         {
             currStamina += pot3.Stamina;
             if (currStamina > maxStamina)
             {
                 currStamina = maxStamina;
             }
             strength    += pot3.Strength;
             initiative  += pot3.Initiative;
             pot3         = new BasePotion();
             potion3.text = "Potion3: " + pot3.ItemName;
             str.text     = "Strength: " + strength.ToString();
             enemyAttack();
         }
     }
 }
Example #24
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile && from != targeted)
                {
                    from.SendMessage("You can only guess to as their current level of hunger.");
                    return;
                }

                else if (targeted is Mobile && from == targeted)
                {
                    from.SendSound(0x055);

                    from.CloseGump(typeof(HungerGump));
                    from.SendGump(new HungerGump(from));
                }

                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.TasteIDCooldown * 1000);

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100, 1.0))
                    {
                        if (food.Poison != null)
                        {
                            if (food.Poison == Poison.Lesser)
                            {
                                from.SendMessage("It appears to be coated in a lesser poison.");
                            }

                            else if (food.Poison == Poison.Regular)
                            {
                                from.SendMessage("It appears to be coated in a regular poison.");
                            }

                            else if (food.Poison == Poison.Greater)
                            {
                                from.SendMessage("It appears to be coated in a greater poison.");
                            }

                            else if (food.Poison == Poison.Deadly)
                            {
                                from.SendMessage("It appears to be coated in a deadly poison.");
                            }

                            else if (food.Poison == Poison.Lethal)
                            {
                                from.SendMessage("It appears to be coated in a lethal poison.");
                            }
                        }

                        else
                        {
                            from.SendMessage("It appears to be devoid of any form of poison.");
                        }
                    }

                    else
                    {
                        from.SendMessage("You are uncertain as to the safety of this food item.");
                    }

                    from.SendSound(0x055);

                    from.CloseGump(typeof(FoodGump));
                    from.SendGump(new FoodGump(from, food));
                }

                else if (targeted is CustomAlchemyPotion)
                {
                    CustomAlchemyPotion customAlchemyPotion = targeted as CustomAlchemyPotion;

                    if (customAlchemyPotion.Identified)
                    {
                        from.SendMessage("That potion's composition has already been determined.");
                        return;
                    }

                    string name = customAlchemyPotion.GetPotionName();

                    switch (customAlchemyPotion.EffectPotency)
                    {
                    case CustomAlchemy.EffectPotencyType.Target:
                        break;

                    case CustomAlchemy.EffectPotencyType.SmallAoE:
                        if (from.Skills.TasteID.Value < 50)
                        {
                            from.SendMessage("You must have at least 50 Taste Identification skill to analyze that potion's composition.");
                            return;
                        }
                        break;

                    case CustomAlchemy.EffectPotencyType.MediumAoE:
                        if (from.Skills.TasteID.Value < 75)
                        {
                            from.SendMessage("You must have at least 75 Taste Identification skill to analyze that potion's composition.");
                            return;
                        }
                        break;

                    case CustomAlchemy.EffectPotencyType.LargeAoE:
                        if (from.Skills.TasteID.Value < 100)
                        {
                            from.SendMessage("You must have at least 100 Taste Identification skill to analyze that potion's composition.");
                            return;
                        }
                        break;
                    }

                    from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.TasteIDCooldown * 1000);

                    if (from.CheckTargetSkill(SkillName.TasteID, 0, 100, 1.0))
                    {
                        customAlchemyPotion.Identified = true;
                        from.SendMessage("You analyze the potion and determine its composition: " + name + ".");

                        from.SendSound(0x5AF);
                    }

                    else
                    {
                        from.SendMessage("You are not certain of the potion's composition.");
                        from.SendSound(0x5AD);
                    }
                }

                else if (targeted is Food)
                {
                }

                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813); // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }

                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228); // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229); // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }

                else
                {
                    from.SendMessage("That is not something you can inspect.");
                    return;
                }
            }
Example #25
0
 public abstract void UsePotion(BasePotion potion);
Example #26
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    from.SendAsciiMessage("You feel that such an action would be inappropriate.");
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            food.SendAsciiMessageTo(from, "It appears to have poison smeared on it.");
                        }
                        else
                        {
                            // No poison on the food
                            food.SendAsciiMessageTo(from, "You detect nothing unusual about this substance.");
                        }
                    }
                    else
                    {
                        // Skill check failed
                        food.SendAsciiMessageTo(from, "You cannot discern anything about this substance.");
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    if (potion.CheckTasters(from))
                    {
                        potion.SendAsciiMessageTo(from, "You already know what kind of potion that is.");
                    }
                    else if (from.CheckTargetSkill(SkillName.TasteID, potion, 0, 100))
                    {
                        potion.AddTasters(from);
                        potion.OnSingleClick(from);
                    }
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendAsciiMessageTo(from, "There is nothing in the keg to taste!");
                    }
                    if (keg.CheckTasters(from))
                    {
                        keg.SendAsciiMessageTo(from, "You are already familiar with this keg's contents.");
                    }
                    else if (from.CheckTargetSkill(SkillName.TasteID, keg, 0, 100))
                    {
                        keg.AddTasters(from);
                        keg.OnSingleClick(from);
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendAsciiMessage("That's not something you can taste.");
                }
            }
Example #27
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!(targeted is TeiravonMobile))
                {
                    from.SendMessage("You must target another player.");
                }
                else if (!(( TeiravonMobile )targeted).Alive || !from.Alive)
                {
                    from.SendMessage("You must target a living player.");
                }
                else if (( TeiravonMobile )targeted == ( TeiravonMobile )from)
                {
                    from.SendMessage("You must target another player.");
                }
                else if (from.Mounted)
                {
                    from.SendMessage("You must be on foot to initially grab a player.");
                }
                else if ((( TeiravonMobile )targeted).Mounted)
                {
                    from.SendMessage("Your target must be on foot to be grabbed.");
                }
                //else if ( ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.OneHanded ) != null || ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.TwoHanded ) != null )
                //	from.SendMessage( "You must first disarm your target." );
                else if (Grabbers.Contains(from))                               // Sanity check
                {
                    from.SendMessage("You can only grab one person at a time.");
                }
                else if (Grabbers.Contains((( TeiravonMobile )targeted)))
                {
                    from.SendMessage("You can't get a hold on {0} right now.", (( TeiravonMobile )targeted).Female ? "her" : "him");
                }
                else
                {
                    TeiravonMobile grabbed = ( TeiravonMobile )targeted;

                    foreach (GrabTimer timer in Grabbers.Values)
                    {
                        if (timer.Grabbed == grabbed)
                        {
                            from.SendMessage("{0} is already being held.", grabbed.Name);
                            return;
                        }
                    }

                    int grabvalue   = 0;
                    int defendvalue = 0;

                    GetValues(( TeiravonMobile )from, grabbed, out grabvalue, out defendvalue);

                    // We grabbed them.
                    if (grabvalue > defendvalue || (grabvalue == defendvalue && Utility.RandomBool()))
                    {
                        GrabTimer timer = new GrabTimer(( TeiravonMobile )from, grabbed);

                        Grabbers.Add(( TeiravonMobile )from, timer);
                        timer.Start();

                        from.Emote("*successfully grabs {0}!*", grabbed.Name);
                        BaseWeapon.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        grabbed.ClearHands();
                        BaseWeapon.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        grabbed.BeginAction(typeof(BaseMount));
                        grabbed.Freeze(TimeSpan.FromMinutes(10.0));

                        BaseMount.Dismount(grabbed);
                    }
                    else
                    {
                        from.Emote("*fails to grab {0}!*", grabbed.Name);
                    }
                }
            }
Example #28
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.TasteID, from.Skills[SkillName.TasteID].Value))

                {
                    return;
                }

                if (targeted is Mobile)
                {
                    from.SendLocalizedMessage(502816);                       // You feel that such an action would be inappropriate.
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            food.SendLocalizedMessageTo(from, 1038284);                               // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            food.SendLocalizedMessageTo(from, 1010600);                               // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        food.SendLocalizedMessageTo(from, 502823);                           // You cannot discern anything about this substance.
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813);                       // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendLocalizedMessage(502820);                       // That's not something you can taste.
                }
            }
Example #29
0
    public static void loadPotions()
    {
        string path = "URI=file:" + Application.dataPath + "/Database/Database.s3db";
        IDbConnection connection;

        connection = (IDbConnection)new SqliteConnection(path);
        connection.Open();
        IDbCommand command = connection.CreateCommand();
        string sqlQuery = "SELECT * FROM Items_Potions;";
        command.CommandText = sqlQuery;
        IDataReader reader = command.ExecuteReader();
        while (reader.Read())
        {
            BasePotion one = new BasePotion();
            one.ItemID = reader.GetInt32 (0);
            one.PotionType = (BasePotion.PotionTypes)reader.GetInt32 (1);
            one.PotionValue = reader.GetInt32 (2);
            one.PotionDuration = reader.GetInt32 (3);
            potionsData[one.ItemID] = one;
        }
        reader.Close();
        command.Dispose();
        connection.Close();
    }
Example #30
0
    void Loot()
    {
        int temp = Random.Range(0, 3);

        if (temp == 0)
        {
            BaseArmour tempArmour = ArmourGenerator.generate(ctr);
            switch (tempArmour.Armour)
            {
            case (BaseArmour.ArmourTypes.HELMET):
                equip = tempArmour;
                break;

            case (BaseArmour.ArmourTypes.CHEST):
                equip2 = tempArmour;
                break;

            case (BaseArmour.ArmourTypes.BOOTS):
                equip3 = tempArmour;
                break;
            }
            Debug.Log("Armour drop");
        }
        else if (temp == 1)
        {
            weap = WeaponGenerator.generate(ctr);
            Debug.Log("Weapon drop");
        }
        else if (temp == 2)
        {
            BasePotion tempPot = PotionGenerator.generate(ctr);
            if (string.Compare(pot1.ItemName, "Empty") == 0)
            {
                pot1 = tempPot;
            }
            else if (string.Compare(pot2.ItemName, "Empty") == 0)
            {
                pot2 = tempPot;
            }
            else if (string.Compare(pot3.ItemName, "Empty") == 0)
            {
                pot3 = tempPot;
            }
            Debug.Log("Potion drop");
        }
        int diffrence = maxStamina - currStamina;

        maxStamina  = 40 + equip.Stamina + equip2.Stamina + equip3.Stamina + weap.Stamina;
        currStamina = 40 + equip.Stamina + equip2.Stamina + equip3.Stamina + weap.Stamina - diffrence;
        if (currStamina > maxStamina)
        {
            currStamina = maxStamina;
        }
        strength     = 3 + equip.Strength + equip2.Strength + equip3.Strength + weap.Strength;
        initiative   = 7 + equip.Initiative + equip2.Initiative + equip3.Initiative + weap.Initiative;
        weapon.text  = "Weapon: " + weap.ItemName;
        arm1.text    = "Helmet: " + equip.ItemName;
        arm2.text    = "Chestplate: " + equip2.ItemName;
        arm3.text    = "Boots: " + equip3.ItemName;
        potion1.text = "Potion1: " + pot1.ItemName;
        potion2.text = "Potion2: " + pot2.ItemName;
        potion3.text = "Potion3: " + pot3.ItemName;
    }
Example #31
0
        public void Pour(Mobile from, Item item)
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                return;
            }

            if (m_PlantStatus == PlantStatus.DecorativePlant)
            {
                LabelTo(from, 1053049); // This is a decorative plant, it does not need watering!
                return;
            }

            if (!RequiresUpkeep)
            {
                LabelTo(from, 1150619); // You don't need to water it.
                return;
            }

            if (!IsUsableBy(from))
            {
                LabelTo(from, 1061856); // You must have the item in your backpack or locked down in order to use it.
                return;
            }

            if (item is BaseBeverage)
            {
                BaseBeverage beverage = (BaseBeverage)item;

                if (beverage.IsEmpty || !beverage.Pourable || beverage.Content != BeverageType.Water)
                {
                    LabelTo(from, 1053069); // You can't use that on a plant!
                    return;
                }

                if (!beverage.ValidateUse(from, true))
                {
                    return;
                }

                beverage.Quantity--;
                m_PlantSystem.Water++;

                from.PlaySound(0x4E);
                LabelTo(from, 1061858); // You soften the dirt with water.

                m_PlantSystem.NextGrowth = DateTime.UtcNow + PlantSystem.CheckDelay;
            }
            else if (item is BasePotion)
            {
                BasePotion potion = (BasePotion)item;

                int message;
                if (ApplyPotion(potion.PotionEffect, false, out message))
                {
                    potion.Consume();
                    from.PlaySound(0x240);
                    from.AddToBackpack(new Bottle());

                    m_PlantSystem.NextGrowth = DateTime.UtcNow + PlantSystem.CheckDelay;
                }
                LabelTo(from, message);
            }
            else if (item is PotionKeg)
            {
                PotionKeg keg = (PotionKeg)item;

                if (keg.Held <= 0)
                {
                    LabelTo(from, 1053069); // You can't use that on a plant!
                    return;
                }

                int message;
                if (ApplyPotion(keg.Type, false, out message))
                {
                    keg.Held--;
                    from.PlaySound(0x240);

                    m_PlantSystem.NextGrowth = DateTime.UtcNow + PlantSystem.CheckDelay;
                }
                LabelTo(from, message);
            }
            else
            {
                LabelTo(from, 1053069); // You can't use that on a plant!
            }
        }
Example #32
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    from.SendMessage("Une telle action serait inappropriée...");                       // You feel that such an action would be inappropriate.
                    return;
                }
                if (targeted is CookableCheese)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            from.SendMessage("Des effluves de poison parviennent à votre nez"); // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            from.SendMessage("Vous ne décelez rien d'anormal dans ce que vous goûtez"); // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        from.SendMessage("Vous ne discernez pas correctement les aromes"); // You cannot discern anything about this substance.
                    }
                    return;
                }

                if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            from.SendMessage("Des effluves de poison parviennent à votre nez");                               // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            from.SendMessage("Vous ne décelez rien d'anormal dans ce que vous goûtez");  // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        from.SendMessage("Vous ne discernez pas correctement les aromes");                           // You cannot discern anything about this substance.
                    }
                    return;
                }
                if (targeted is BaseBeverage)
                {
                    BaseBeverage beverage = (BaseBeverage)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, beverage, 0, 100))
                    {
                        if (beverage.Poison != null)
                        {
                            from.SendMessage("Des effluves de poison parviennent à votre nez"); // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            from.SendMessage("Vous ne décelez rien d'anormal dans ce que vous goûtez"); // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        from.SendMessage("Vous ne discernez pas correctement les aromes"); // You cannot discern anything about this substance.
                    }
                    return;
                }
                if (targeted is GenderPotion)
                {
                    GenderPotion potion = (GenderPotion)targeted;

                    if (from.Skills[SkillName.TasteID].Value >= 75)
                    {
                        if (potion.Female)
                        {
                            from.SendMessage("Cette fiole sent les fleurs");
                        }
                        else
                        {
                            from.SendMessage("Cette fiole sent la sueur");
                        }
                    }
                    else
                    {
                        from.SendMessage("Votre nez n'est pas encore suffisamment développé pour en dénoter la subtile effluve");
                    }
                    return;
                }
                if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813);                       // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                    return;
                }
                if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                    return;
                }
                // The target is not food or potion or potion keg.
                from.SendLocalizedMessage(502820);                           // That's not something you can taste.
            }
Example #33
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    from.SendAsciiMessage("You feel that such an action would be inappropriate.");
                    //from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate.
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            from.Send(new AsciiMessage(food.Serial, food.ItemID, MessageType.Regular, 0, 3, "", "It appears to have poison smeared on it."));
                            //food.SendLocalizedMessageTo( from, 1038284 ); // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            from.Send(new AsciiMessage(food.Serial, food.ItemID, MessageType.Regular, 0, 3, "", "You detect nothing unusual about this substance."));
                            //food.SendLocalizedMessageTo( from, 1010600 ); // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        from.Send(new AsciiMessage(food.Serial, food.ItemID, MessageType.Regular, 0, 3, "", "You cannot discern anything about this substance."));
                        //food.SendLocalizedMessageTo( from, 502823 ); // You cannot discern anything about this substance.
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    from.Send(new AsciiMessage(potion.Serial, potion.ItemID, MessageType.Regular, 0, 3, "", "You already know what kind of potion that is."));
                    ((Item)targeted).OnSingleClick(from);
                    //potion.SendLocalizedMessageTo( from, 502813 ); // You already know what kind of potion that is.
                    //potion.SendLocalizedMessageTo( from, potion.LabelNumber );
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendAsciiMessage("That's not something you can taste.");                       // That's not something you can taste.
                }
            }
Example #34
0
 public override void UsePotion(BasePotion potion)
 {
 }
Example #35
0
        public StatsGump(Mobile from, int origin) : base(25, 25)
        {
            m_Origin = origin;

            int    LRCCap            = 100;
            int    LMCCap            = 40;
            double BandageSpeedCap   = 5.0;
            int    SwingSpeedCap     = 100;
            int    HCICap            = 45;
            int    DCICap            = 45;
            int    FCCap             = 4; // FC 4 For Paladin, otherwise FC 2 for Mage
            int    FCRCap            = 4;
            int    DamageIncreaseCap = 100;
            int    SDICap            = 1000000;

            if (SDICap > Server.Misc.DifficultyLevel.SpellDamageIncreaseVsMonsters() && Server.Misc.DifficultyLevel.SpellDamageIncreaseVsMonsters() > 0)
            {
                SDICap = Server.Misc.DifficultyLevel.SpellDamageIncreaseVsMonsters();
            }
            int ReflectDamageCap = 100;
            int SSICap           = 100;

            int      LRC            = AosAttributes.GetValue(from, AosAttribute.LowerRegCost) > LRCCap ? LRCCap : AosAttributes.GetValue(from, AosAttribute.LowerRegCost);
            int      LMC            = AosAttributes.GetValue(from, AosAttribute.LowerManaCost) > LMCCap ? LMCCap : AosAttributes.GetValue(from, AosAttribute.LowerManaCost);
            double   BandageSpeed   = (5.0 + (0.5 * ((double)(120 - from.Dex) / 10))) < BandageSpeedCap ? BandageSpeedCap : (5.0 + (0.5 * ((double)(120 - from.Dex) / 10)));
            TimeSpan SwingSpeed     = (from.Weapon as BaseWeapon).GetDelay(from) > TimeSpan.FromSeconds(SwingSpeedCap) ? TimeSpan.FromSeconds(SwingSpeedCap) : (from.Weapon as BaseWeapon).GetDelay(from);
            int      HCI            = AosAttributes.GetValue(from, AosAttribute.AttackChance) > HCICap ? HCICap : AosAttributes.GetValue(from, AosAttribute.AttackChance);
            int      DCI            = AosAttributes.GetValue(from, AosAttribute.DefendChance) > DCICap ? DCICap : AosAttributes.GetValue(from, AosAttribute.DefendChance);
            int      FC             = AosAttributes.GetValue(from, AosAttribute.CastSpeed) > FCCap ? FCCap : AosAttributes.GetValue(from, AosAttribute.CastSpeed);
            int      FCR            = AosAttributes.GetValue(from, AosAttribute.CastRecovery) > FCRCap ? FCRCap : AosAttributes.GetValue(from, AosAttribute.CastRecovery);
            int      DamageIncrease = AosAttributes.GetValue(from, AosAttribute.WeaponDamage) > DamageIncreaseCap ? DamageIncreaseCap : AosAttributes.GetValue(from, AosAttribute.WeaponDamage);
            int      SDI            = AosAttributes.GetValue(from, AosAttribute.SpellDamage) > SDICap ? SDICap : AosAttributes.GetValue(from, AosAttribute.SpellDamage);
            int      ReflectDamage  = AosAttributes.GetValue(from, AosAttribute.ReflectPhysical) > ReflectDamageCap ? ReflectDamageCap : AosAttributes.GetValue(from, AosAttribute.ReflectPhysical);
            int      SSI            = AosAttributes.GetValue(from, AosAttribute.WeaponSpeed) > SSICap ? SSICap : AosAttributes.GetValue(from, AosAttribute.WeaponSpeed);
            int      HealCost       = GetPlayerInfo.GetResurrectCost(from);
            int      CharacterLevel = GetPlayerInfo.GetPlayerLevel(from);
            int      EP             = BasePotion.EnhancePotions(from);

            AddPage(0);
            AddImage(300, 300, 155);
            AddImage(0, 300, 155);
            AddImage(0, 0, 155);
            AddImage(300, 0, 155);
            AddImage(600, 0, 155);
            AddImage(600, 300, 155);
            AddImage(794, 0, 155);
            AddImage(794, 300, 155);

            AddImage(2, 2, 129);
            AddImage(302, 2, 129);
            AddImage(2, 298, 129);
            AddImage(598, 2, 129);
            AddImage(598, 298, 129);
            AddImage(301, 298, 129);
            AddImage(792, 2, 129);
            AddImage(792, 298, 129);

            AddImage(5, 8, 145);
            AddImage(7, 354, 142);
            AddImage(324, 563, 140);
            AddImage(433, 29, 140);
            AddImage(175, 29, 140);
            AddImage(165, 7, 156);
            AddImage(191, 7, 156);
            AddImage(219, 5, 156);
            AddImage(698, 7, 156);
            AddImage(519, 563, 140);
            AddImage(748, 381, 144);
            AddImage(893, 7, 146);
            AddImage(630, 29, 140);
            AddImage(893, 6, 156);

            string title = "CHARACTER SHEET";

            if (m_Origin > 0)
            {
                title = "PLAYERS HANDBOOK";
            }

            AddHtml(166, 60, 203, 29, @"<BODY><BASEFONT Color=White><BIG>" + title + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(472, 60, 432, 29, @"<BODY><BASEFONT Color=#FCFF00><BIG>" + from.Name + " the " + GetPlayerInfo.GetSkillTitle(from) + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddItem(151, 113, 3823);
            AddHtml(190, 116, 57, 19, @"<BODY><BASEFONT Color=White><BIG>Bank</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 116, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + Banker.GetBalance(from) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(96, 156, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Strength</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 196, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Dexterity</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 236, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Intelligence</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 276, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Fame</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 316, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Karma</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 356, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Tithing Points</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 396, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Hunger</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 436, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Thirst</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(96, 476, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Enhance Potions</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(236, 156, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.RawStr, from.Str - from.RawStr) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 196, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.RawDex, from.Dex - from.RawDex) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 236, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.RawInt, from.Int - from.RawInt) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 276, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.Fame) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 316, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.Karma) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 356, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.TithingPoints) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 396, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.Hunger) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 436, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.Thirst) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(236, 476, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", EP) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(406, 116, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Level</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 156, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Hits</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 196, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Stamina</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 236, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Mana</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 276, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Hits Regen</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 316, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Stamina Regen</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 356, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Mana Regen</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 396, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Low Reagent</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 436, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Low Mana</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 476, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Resurrect Cost</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(406, 516, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Murders</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(546, 116, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", CharacterLevel) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 156, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.Hits - AosAttributes.GetValue(from, AosAttribute.BonusHits), AosAttributes.GetValue(from, AosAttribute.BonusHits)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 196, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.Stam - AosAttributes.GetValue(from, AosAttribute.BonusStam), AosAttributes.GetValue(from, AosAttribute.BonusStam)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 236, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} + {1}", from.Mana - AosAttributes.GetValue(from, AosAttribute.BonusMana), AosAttributes.GetValue(from, AosAttribute.BonusMana)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 276, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", AosAttributes.GetValue(from, AosAttribute.RegenHits)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 316, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", AosAttributes.GetValue(from, AosAttribute.RegenStam)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 356, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", AosAttributes.GetValue(from, AosAttribute.RegenMana)) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 396, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", LRC) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 436, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", LMC) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 476, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0} Gold", HealCost) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(546, 516, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", from.Kills) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(723, 116, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Hit Chance</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 156, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Defend Chance</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 196, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Swing Speed</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 236, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Swing Speed +</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 276, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Bandage Speed</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 316, 169, 24, @"<BODY><BASEFONT Color=White><BIG>Damage Increase</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 356, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Reflect Damage</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 396, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Fast Cast</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 436, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Cast Recovery</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(723, 476, 126, 24, @"<BODY><BASEFONT Color=White><BIG>Spell Damage +</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            AddHtml(863, 116, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", HCI) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 156, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", DCI) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 196, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}s", new DateTime(SwingSpeed.Ticks).ToString("s.ff")) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 236, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", SSI) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 276, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0:0.0}s", new DateTime(TimeSpan.FromSeconds(BandageSpeed).Ticks).ToString("s.ff")) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 316, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", DamageIncrease) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 356, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", ReflectDamage) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 396, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", FC) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 436, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}", FCR) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(863, 476, 126, 24, @"<BODY><BASEFONT Color=#FCFF00><BIG><DIV ALIGN=RIGHT>" + String.Format(" {0}%", SDI) + "</DIV></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            if (m_Origin != 1)
            {
                AddButton(1015, 233, 236, 236, 1, GumpButtonType.Reply, 0);
                AddHtml(1007, 307, 71, 24, @"<BODY><BASEFONT Color=White><BIG><CENTER>Refresh</CENTER></BIG></BASEFONT></BODY></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
            else
            {
                AddImage(1000, 240, 11424);
            }
        }
Example #36
0
            public override void OnDoubleClick(Mobile from)
            {
                if (!IsChildOf(from.Backpack))
                {
                    return;
                }

                if (!from.Alive)
                {
                    return;
                }

                HealingStoneContext context = null;

                if (m_MalusTable.ContainsKey(from))
                {
                    context = m_MalusTable[from];
                }

                if (context != null && context.UnderCooldown)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 1095172);                       // You must wait a few seconds before using another Healing Stone.
                }
                else if (from.Hits == from.HitsMax)
                {
                    from.SendLocalizedMessage(1049547, "", 0x59);                       // You are already at full health.
                }
                else if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
                {
                    from.SendLocalizedMessage(1080116);                       // You must have a free hand to use a Healing Stone.
                }
                else if (MortalStrike.IsWounded(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000);                       // You cannot heal yourself in your current state.
                }
                else if (from.Poisoned)
                {
                    // TODO (SA): Healing Stone should now heal poison
                }
                else
                {
                    int amountToHeal = Utility.RandomMinMax(1, 6) + (int)((GetBaseSkill(from) + GetBoostSkill(from)) / 8.0);

                    if (context != null)
                    {
                        amountToHeal = (int)(amountToHeal * context.Scale);
                    }

                    amountToHeal = Math.Min(amountToHeal, HealingPoints);

                    // TODO (SA): Arcane Empowerment debe otorgar un bonus.

                    from.Heal(amountToHeal);
                    from.PlaySound(0x202);

                    HealingPoints -= amountToHeal;

                    if (context != null)
                    {
                        context.Reset();
                    }
                    else
                    {
                        Timer t = Timer.DelayCall(TimeSpan.FromSeconds(Malus), new TimerCallback(
                                                      delegate
                        {
                            m_MalusTable.Remove(from);
                        }));
                        m_MalusTable.Add(from, new HealingStoneContext(from, t));
                    }
                }
            }
Example #37
0
        public void Pour(Mobile from, Item item)
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                return;
            }

            if (m_PlantStatus == PlantStatus.DecorativePlant)
            {
                LabelTo(from, 1053049);                   // This is a decorative plant, it does not need watering!
                return;
            }

            if (!IsUsableBy(from))
            {
                LabelTo(from, 1061856);                   // You must have the item in your backpack or locked down in order to use it.
                return;
            }

            if (item is BaseBeverage)
            {
                BaseBeverage beverage = (BaseBeverage)item;

                if (beverage.IsEmpty || !beverage.Pourable || beverage.Content != BeverageType.Water)
                {
                    LabelTo(from, 1053069);                       // You can't use that on a plant!
                    return;
                }

                if (!beverage.ValidateUse(from, true))
                {
                    return;
                }

                /*beverage.Quantity--;
                 * m_PlantSystem.Water++;
                 *
                 * from.PlaySound( 0x4E );
                 * LabelTo( from, 1061858 ); // You soften the dirt with water.
                 *
                 * //OS-Edit: Endless Decanter of Water
                 * if ( beverage is EndlessDecanterOfWater )
                 * {
                 *      EndlessDecanterOfWater edw = beverage as EndlessDecanterOfWater;
                 *      EndlessDecanterOfWater.Refill( from, edw );
                 * }
                 * //END EDIT*/
            }
            else if (item is BasePotion)
            {
                BasePotion potion = (BasePotion)item;

                int message;
                if (ApplyPotion(potion.PotionEffect, false, out message))
                {
                    potion.Consume();
                    from.PlaySound(0x240);
                    from.AddToBackpack(new Bottle());
                }
                LabelTo(from, message);
            }
            else if (item is PotionKeg)
            {
                PotionKeg keg = (PotionKeg)item;

                if (keg.Held <= 0)
                {
                    LabelTo(from, 1053069);                       // You can't use that on a plant!
                    return;
                }

                int message;
                if (ApplyPotion(keg.Type, false, out message))
                {
                    keg.Held--;
                    from.PlaySound(0x240);
                }
                LabelTo(from, message);
            }
            else
            {
                LabelTo(from, 1053069);                   // You can't use that on a plant!
            }
        }
Example #38
0
 private void CreatePotion()
 {
     newPotion = new BasePotion();
     newPotion.ItemName = itemNames[Random.Range(0,4)] + " potion";
     newPotion.ItemDescription = itemDescription[Random.Range(0,itemDescription.Length)];
     newPotion.ItemID = Random.Range(1,101);
     newPotion.Strength = Random.Range(1,10);
     newPotion.Stamina = Random.Range(1,10);
     newPotion.Dexterity = Random.Range(1,10);
     newPotion.Occult = Random.Range(1,10);
     newPotion.Intellect = Random.Range(1,10);
     newPotion.Wisdom = Random.Range(1,10);
     newPotion.Luck = Random.Range(1,10);
     ChoosePotionType();
     newPotion.SpellEffectID = Random.Range(1,101);
 }
Example #39
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info == null || state == null || state.Mobile == null || Rewards == null)
            {
                return;
            }

            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            case 12:
                // page up
                int nitems = 0;
                if (Rewards != null)
                {
                    nitems = Rewards.Count;
                }

                int page = viewpage + 1;
                if (page > nitems / maxItemsPerPage)
                {
                    page = nitems / maxItemsPerPage;
                }
                state.Mobile.SendGump(new ReferralRewardsGump(state.Mobile, page));
                break;

            case 13:
                // page down
                page = viewpage - 1;
                if (page < 0)
                {
                    page = 0;
                }
                state.Mobile.SendGump(new ReferralRewardsGump(state.Mobile, page));
                break;

            default:
            {
                if (info.ButtonID >= 1000 && info.ButtonID < 2000)
                {
                    int selection = info.ButtonID - 1000;
                    if (selection < Rewards.Count)
                    {
                        ReferralRewardItems r = Rewards[selection] as ReferralRewardItems;

                        XmlReferralRewards re = (XmlReferralRewards)XmlAttach.FindAttachment(from, typeof(XmlReferralRewards));

                        if (((re.LastRewardChosen + TimeSpan.FromDays(1.0)) > DateTime.Now) && from.AccessLevel < AccessLevel.GameMaster)
                        {
                            from.SendMessage(39, "You can only purchase one referral reward per day.");
                            return;
                        }

                        if (re != null && re.PointsAvailable >= r.Cost)
                        {
                            re.PointsAvailable = re.PointsAvailable - r.Cost;
                            re.PointsSpent     = re.PointsSpent + r.Cost;
                            re.RewardsChosen++;
                            re.LastRewardChosen = DateTime.Now;

                            // create an instance of the reward type
                            object o = null;

                            try
                            {
                                o = Activator.CreateInstance(r.RewardType, r.RewardArgs);
                            }
                            catch
                            {
                            }

                            bool received = true;

                            if (o is Item)
                            {
                                if (o is BasePotion)
                                {
                                    BasePotion bp = o as BasePotion;
                                    bp.Amount = 500;
                                }
                                // and give them the item
                                PlayerMobile pm  = from as PlayerMobile;
                                BankBox      box = null;

                                if (pm != null)
                                {
                                    box = pm.FindBankNoCreate();
                                }

                                if (box != null)
                                {
                                    box.AddItem((Item)o);
                                    from.SendMessage("{0} has been placed in your bank box.", ((Item)o).Name);
                                }
                                else if (pm.Backpack != null && !pm.Backpack.Deleted)
                                {
                                    pm.Backpack.AddItem((Item)o);
                                    from.SendMessage("{0} has been placed in your backpack.", ((Item)o).Name);
                                }
                                else
                                {
                                    received = false;
                                    from.SendMessage("An error has occured, please page staff about this issue immediately!");
                                }
                            }
                            else if (o is Mobile)
                            {
                                // if it is controllable then set the buyer as master.  Note this does not check for control slot limits.
                                if (o is BaseCreature)
                                {
                                    BaseCreature b = o as BaseCreature;
                                    b.Controlled    = true;
                                    b.ControlMaster = from;
                                }

                                ((Mobile)o).MoveToWorld(from.Location, from.Map);
                            }
                            else if (o is XmlAttachment)
                            {
                                XmlAttachment a = o as XmlAttachment;


                                XmlAttach.AttachTo(from, a);
                            }
                            else
                            {
                                from.SendMessage(33, "Unable to create {0}. Please page a staff member.", r.RewardType.Name);
                                received = false;
                            }

                            from.SendMessage("You have purchased {0} for {1} Referral Points.", r.Name, r.Cost);

                            LogPurchase(r, from, state, received);
                            // creates a log of the purchased items to Donations.log in the main server folder. This is for Owners to verify donation claims, tracking what sells best, etc.
                        }
                        else
                        {
                            from.SendMessage("Insufficient Referral Points for {0}.", r.Name);
                        }
                        from.SendGump(new ReferralRewardsGump(from, viewpage));
                    }
                }
                else if (info.ButtonID >= 2000)
                {
                    int selection = info.ButtonID - 2000;
                    if (selection < Rewards.Count)
                    {
                        ReferralRewardItems r = Rewards[selection] as ReferralRewardItems;

                        from.SendGump(new ReferralRewardsGump(from, viewpage));

                        if (r != null)
                        {
                            from.CloseGump(typeof(ReferralRewardDescriptionGump));
                            from.SendGump(new ReferralRewardDescriptionGump(r));
                        }
                    }
                }
                break;
            }
            }
        }
Example #40
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    from.SendLocalizedMessage(502816);                       // You feel that such an action would be inappropriate.
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            food.SendLocalizedMessageTo(from, 1038284);                               // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            food.SendLocalizedMessageTo(from, 1010600);                               // You detect nothing unusual about this substance.
                        }
                    }
                    else
                    {
                        // Skill check failed
                        food.SendLocalizedMessageTo(from, 502823);                           // You cannot discern anything about this substance.
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813);                       // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else if (targeted is Seed)
                {
                    Seed seed = (Seed)targeted;
                    if (from.CheckTargetSkill(SkillName.TasteID, seed, 80, 100))
                    {
                        seed.ShowType = true;
                        from.SendMessage("You identified the seed type as {0}", seed.PlantType);
                    }
                    else
                    {
                        from.SendMessage("You can't determine what seed type this is");
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendLocalizedMessage(502820);                     // That's not something you can taste.
                }
            }