Example #1
0
        protected virtual void GenerateTreasure()
        {
            DropItem(new Gold(1500, 3000));

            Item item = null;

            for (int i = 0; i < Loot.GemTypes.Length; i++)
            {
                item = Activator.CreateInstance(Loot.GemTypes[i]) as Item;

                if (item != null)
                {
                    item.Amount = Utility.Random(1, 6);

                    DropItem(item);
                }
            }

            if (0.25 > Utility.RandomDouble())
            {
                item = new SmokeBomb(Utility.Random(3, 6));
                DropItem(item);
            }

            if (0.25 > Utility.RandomDouble())
            {
                switch (Utility.Random(2))
                {
                case 0:
                    item = new ParasiticPotion(Utility.Random(1, 3)); break;

                case 1:
                    item = new InvisibilityPotion(Utility.Random(1, 3)); break;
                }

                DropItem(item);
            }

            if (0.2 > Utility.RandomDouble())
            {
                item        = Loot.RandomEssence();
                item.Amount = Utility.Random(3, 6);
                DropItem(item);
            }

            if (0.1 > Utility.RandomDouble())
            {
                switch (Utility.Random(4))
                {
                case 0: DropItem(new Taint()); break;

                case 1: DropItem(new Corruption()); break;

                case 2: DropItem(new Blight()); break;

                case 3: DropItem(new LuminescentFungi()); break;
                }
            }
        }
Example #2
0
        private void OnDartHit(object state)
        {
            object[] states = (object[])state;
            Mobile   from   = (Mobile)states[0];
            Mobile   target = (Mobile)states[1];

            if (!from.CanBeHarmful(target))
            {
                return;
            }

            from.DoHarmful(target);

            AOS.Damage(target, from, Utility.RandomMinMax(4, 6), 100, 0, 0, 0, 0);

            if (m_Poison != null && m_PoisonCharges > 0)
            {
                Poison p        = m_Poison;
                int    maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
                if (p.Level > maxLevel)
                {
                    p = Poison.GetPoison(maxLevel);
                }

                if (target.ApplyPoison(from, p) != ApplyPoisonResult.Immune)
                {
                    if (p.Name == "Parasitic")
                    {
                        ParasiticPotion.AddInfo(target, from);
                    }
                    else if (p.Name == "Darkglow")
                    {
                        DarkglowPotion.AddInfo(target, from);
                    }
                }
            }

            ConsumeUse();
        }
Example #3
0
        public BasePotion FillBottle()
        {
            BasePotion pot;

            switch (m_Type)
            {
            default:
            case PotionEffect.Nightsight: pot = new NightSightPotion(); break;

            case PotionEffect.CureLesser: pot = new LesserCurePotion(); break;

            case PotionEffect.Cure: pot = new CurePotion(); break;

            case PotionEffect.CureGreater: pot = new GreaterCurePotion(); break;

            case PotionEffect.Agility: pot = new AgilityPotion(); break;

            case PotionEffect.AgilityGreater: pot = new GreaterAgilityPotion(); break;

            case PotionEffect.Strength: pot = new StrengthPotion(); break;

            case PotionEffect.StrengthGreater: pot = new GreaterStrengthPotion(); break;

            case PotionEffect.PoisonLesser: pot = new LesserPoisonPotion(); break;

            case PotionEffect.Poison: pot = new PoisonPotion(); break;

            case PotionEffect.PoisonGreater: pot = new GreaterPoisonPotion(); break;

            case PotionEffect.PoisonDeadly: pot = new DeadlyPoisonPotion(); break;

            case PotionEffect.Refresh: pot = new RefreshPotion(); break;

            case PotionEffect.RefreshGreater: pot = new GreaterRefreshPotion(); break;

            case PotionEffect.HealLesser: pot = new LesserHealPotion(); break;

            case PotionEffect.Heal: pot = new HealPotion(); break;

            case PotionEffect.HealGreater: pot = new GreaterHealPotion(); break;

            case PotionEffect.ExplosionLesser: pot = new LesserExplosionPotion(); break;

            case PotionEffect.Explosion: pot = new ExplosionPotion(); break;

            case PotionEffect.ExplosionGreater: pot = new GreaterExplosionPotion(); break;

            case PotionEffect.Conflagration: pot = new ConflagrationPotion(); break;

            case PotionEffect.ConflagrationGreater: pot = new GreaterConflagrationPotion(); break;

            case PotionEffect.MaskOfDeath: pot = new MaskOfDeathPotion(); break;

            case PotionEffect.MaskOfDeathGreater: pot = new GreaterMaskOfDeathPotion(); break;

            case PotionEffect.ConfusionBlast: pot = new ConfusionBlastPotion(); break;

            case PotionEffect.ConfusionBlastGreater: pot = new GreaterConfusionBlastPotion(); break;

            case PotionEffect.Invisibility: pot = new InvisibilityPotion(); break;

            case PotionEffect.ParasiticPoison: pot = new ParasiticPotion(); break;

            case PotionEffect.DarkglowPoison: pot = new DarkglowPotion(); break;
            }

            return(pot);
        }
Example #4
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                attacker.SendLocalizedMessage(1061141);                   // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            if (!CheckMana(attacker, true))
            {
                return;
            }

            --weapon.PoisonCharges;

            // Infectious strike special move now uses poisoning skill to help determine potency
            int maxLevel = attacker.Skills[SkillName.Poisoning].Fixed / 200;

            if (maxLevel < 0)
            {
                maxLevel = 0;
            }
            if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }

            Poison oldPoison = p;

            if ((attacker.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble())
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    attacker.SendLocalizedMessage(1060080);                       // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081);                       // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune)
            {
                attacker.SendLocalizedMessage(1008096, true, defender.Name);                   // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, attacker.Name);                  //  : poisoned you!

                Titles.AwardKarma(attacker, -10, true);

                if (oldPoison.Name == "Parasitic")
                {
                    ParasiticPotion.AddInfo(defender, attacker);
                }
                else if (oldPoison.Name == "Darkglow")
                {
                    DarkglowPotion.AddInfo(defender, attacker);
                }
            }
        }