示例#1
0
        public void Fill(Mobile from, PotionKeg keg)
        {
            Charges = Validate(keg);

            if (Charges > 0)
            {
                keg.Delete();
                from.SendLocalizedMessage(1076199);                   // Your cannon is recharged.
            }
            else
            {
                from.SendLocalizedMessage(1076198);                   // You do not have a full keg of explosion potions needed to recharge the cannon.
            }
        }
示例#2
0
        public void Fill( Mobile from, PotionKeg keg )
        {
            Charges = Validate( keg );

            if ( Charges > 0 )
            {
                keg.Delete();
                from.SendLocalizedMessage( 1076199 ); // Your cannon is recharged.
            }
            else
                from.SendLocalizedMessage( 1076198 ); // You do not have a full keg of explosion potions needed to recharge the cannon.
        }
示例#3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to use.");
                return;
            }
            else
            {
                Container pack       = from.Backpack;
                int       alchemists = 0;

                PotionKeg keg = new PotionKeg();
                keg.Delete();

                int barrel = 0;

                foreach (Item i in from.Backpack.Items)
                {
                    if (barrel == 0 && i is PotionKeg)
                    {
                        PotionKeg p = (PotionKeg)i;
                        if (p.Held < 1)
                        {
                            barrel = 1; keg = p;
                        }
                    }
                }

                foreach (Mobile m in this.GetMobilesInRange(10))
                {
                    if (m is AlchemistGuildmaster || m is Alchemist)
                    {
                        ++alchemists;
                    }
                }

                if (from.Skills[SkillName.Alchemy].Value < 50)
                {
                    from.SendMessage("You should be at least an apprentice alchemist to try this!");
                }
                else if (alchemists == 0)
                {
                    from.SendMessage("You need to be near a local alchemist for their help!");
                }
                else if (barrel == 0)
                {
                    from.SendMessage("You need an empty potion keg to dump this in.");
                }
                else
                {
                    if (pack.ConsumeTotal(typeof(Gold), 500))
                    {
                        from.SendMessage("You give the alchemist 500 gold for their help.");
                        Effects.PlaySound(from.Location, from.Map, 0x026);

                        if (JarPotion == "Nightsight Potions")
                        {
                            keg.Type = PotionEffect.Nightsight;
                        }
                        else if (JarPotion == "Lesser Cure Potions")
                        {
                            keg.Type = PotionEffect.CureLesser;
                        }
                        else if (JarPotion == "Cure Potions")
                        {
                            keg.Type = PotionEffect.Cure;
                        }
                        else if (JarPotion == "Greater Cure Potions")
                        {
                            keg.Type = PotionEffect.CureGreater;
                        }
                        else if (JarPotion == "Agility Potions")
                        {
                            keg.Type = PotionEffect.Agility;
                        }
                        else if (JarPotion == "Greater Agility Potions")
                        {
                            keg.Type = PotionEffect.AgilityGreater;
                        }
                        else if (JarPotion == "Strength Potions")
                        {
                            keg.Type = PotionEffect.Strength;
                        }
                        else if (JarPotion == "Greater Strength Potions")
                        {
                            keg.Type = PotionEffect.StrengthGreater;
                        }
                        else if (JarPotion == "Lesser Poison Potions")
                        {
                            keg.Type = PotionEffect.PoisonLesser;
                        }
                        else if (JarPotion == "Poison Potions")
                        {
                            keg.Type = PotionEffect.Poison;
                        }
                        else if (JarPotion == "Greater Poison Potions")
                        {
                            keg.Type = PotionEffect.PoisonGreater;
                        }
                        else if (JarPotion == "Deadly Poison Potions")
                        {
                            keg.Type = PotionEffect.PoisonDeadly;
                        }
                        else if (JarPotion == "Refresh Potions")
                        {
                            keg.Type = PotionEffect.Refresh;
                        }
                        else if (JarPotion == "Total Refresh Potions")
                        {
                            keg.Type = PotionEffect.RefreshTotal;
                        }
                        else if (JarPotion == "Lesser Heal Potions")
                        {
                            keg.Type = PotionEffect.HealLesser;
                        }
                        else if (JarPotion == "Heal Potions")
                        {
                            keg.Type = PotionEffect.Heal;
                        }
                        else if (JarPotion == "Greater Heal Potions")
                        {
                            keg.Type = PotionEffect.HealGreater;
                        }
                        else if (JarPotion == "Lesser Explosion Potions")
                        {
                            keg.Type = PotionEffect.ExplosionLesser;
                        }
                        else if (JarPotion == "Explosion Potions")
                        {
                            keg.Type = PotionEffect.Explosion;
                        }
                        else if (JarPotion == "Greater Explosion Potions")
                        {
                            keg.Type = PotionEffect.ExplosionGreater;
                        }
                        else if (JarPotion == "Lesser Invisibility Potions")
                        {
                            keg.Type = PotionEffect.InvisibilityLesser;
                        }
                        else if (JarPotion == "Invisibility Potions")
                        {
                            keg.Type = PotionEffect.Invisibility;
                        }
                        else if (JarPotion == "Greater Invisibility Potions")
                        {
                            keg.Type = PotionEffect.InvisibilityGreater;
                        }
                        else if (JarPotion == "Lesser Rejuvenate Potions")
                        {
                            keg.Type = PotionEffect.RejuvenateLesser;
                        }
                        else if (JarPotion == "Rejuvenate Potions")
                        {
                            keg.Type = PotionEffect.Rejuvenate;
                        }
                        else if (JarPotion == "Greater Rejuvenate Potions")
                        {
                            keg.Type = PotionEffect.RejuvenateGreater;
                        }
                        else if (JarPotion == "Lesser Mana Potions")
                        {
                            keg.Type = PotionEffect.ManaLesser;
                        }
                        else if (JarPotion == "Mana Potions")
                        {
                            keg.Type = PotionEffect.Mana;
                        }
                        else if (JarPotion == "Greater Mana Potions")
                        {
                            keg.Type = PotionEffect.ManaGreater;
                        }
                        else if (JarPotion == "Lethal Poison Potions")
                        {
                            keg.Type = PotionEffect.PoisonLethal;
                        }
                        else
                        {
                            keg.Type = PotionEffect.Invulnerability;
                        }

                        int holdBonus = (int)(from.Skills[SkillName.Alchemy].Value / 2);
                        int fill      = Utility.RandomMinMax(5, 50) + holdBonus;
                        if (fill > 100)
                        {
                            fill = 100;
                        }

                        keg.Held = fill;
                        Item b = (Item)keg;
                        Server.Items.PotionKeg.SetColorKeg(b, b);

                        EmptyCanopicJar jar = new EmptyCanopicJar();
                        jar.ItemID     = this.ItemID;
                        jar.Name       = this.Name;
                        jar.RelicOwner = "belonged to " + JarOwner;
                        from.AddToBackpack(jar);
                        this.Delete();
                    }
                    else
                    {
                        from.SendMessage("You will need at least 500 gold in your pack to pay the alchemist.");
                    }
                }
            }
        }
        public void CombinePotionKegs(Mobile from, PotionKeg firstPotionKeg, PotionKeg secondPotionKeg)
        {
            bool combineFail = false;

            if (from == null)
            {
                combineFail = true;
            }
            if (from.Deleted || !from.Alive)
            {
                combineFail = true;
            }

            if (Deleted)
            {
                combineFail = true;
            }
            if (!IsChildOf(from.Backpack))
            {
                combineFail = true;
            }

            if (firstPotionKeg.Deleted)
            {
                combineFail = true;
            }
            if (!firstPotionKeg.IsChildOf(from.Backpack))
            {
                combineFail = true;
            }
            if (firstPotionKeg.Held > 0)
            {
                combineFail = true;
            }

            if (secondPotionKeg.Deleted)
            {
                combineFail = true;
            }
            if (!secondPotionKeg.IsChildOf(from.Backpack))
            {
                combineFail = true;
            }
            if (secondPotionKeg.Held > 0)
            {
                combineFail = true;
            }

            if (combineFail)
            {
                from.SendMessage("At least one of the potion kegs intended to be combined is no longer accessable or is no longer empty.");
                return;
            }

            if (firstPotionKeg.IsPotionBarrel)
            {
                secondPotionKeg.IsPotionBarrel = true;
            }

            secondPotionKeg.MaxHeld += firstPotionKeg.MaxHeld;
            firstPotionKeg.Delete();

            from.PlaySound(0x23D);
            from.SendMessage("You combine the capacity of the two kegs.");

            Delete();
        }