Example #1
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target == from)
                {
                    from.SendMessage("You cannot use this on yourself!");
                }

                else if (target is PlayerMobile)
                {
                    from.SendMessage("That person gives you a dirty look.");
                }

                else if (target is Item)
                {
                    from.SendMessage("You cannot use this on that.");
                }

                else if (target is BaseCreature)
                {
                    BaseCreature c = (BaseCreature)target;
                    if (c.BodyValue == 400 || c.BodyValue == 401 && c.Controlled == false)
                    {
                        from.SendMessage("That person gives you a dirty look.");
                    }
                    else if (c.Poison == null)
                    {
                        from.SendMessage("That creature is not poisoned.");
                    }
                    else if (c.Controlled == false)
                    {
                        from.SendMessage("That is not tamed.");
                    }
                    else
                    {
                        if (c.Poison == Poison.Lesser)
                        {
                            c.Poison = null;
                            from.SendMessage("You have cured this creature.");
                        }
                        else if (c.Poison == Poison.Regular)
                        {
                            if (Utility.Random(100) < 90)
                            {
                                switch (Utility.Random(1))
                                {
                                case 0:
                                    c.Poison = null;
                                    from.SendMessage("You have cured this creature.");
                                    break;
                                }
                            }
                            else
                            {
                                from.SendMessage("You fail to cure the creature.");
                            }
                        }
                        else if (c.Poison == Poison.Greater)
                        {
                            if (Utility.Random(100) < 75)
                            {
                                switch (Utility.Random(1))
                                {
                                case 0:
                                    c.Poison = null;
                                    from.SendMessage("You have cured this creature.");
                                    break;
                                }
                            }
                            else
                            {
                                from.SendMessage("You fail to cure the creature.");
                            }
                        }
                        else if (c.Poison == Poison.Deadly)
                        {
                            if (Utility.Random(100) < 50)
                            {
                                switch (Utility.Random(1))
                                {
                                case 0:
                                    c.Poison = null;
                                    from.SendMessage("You have cured this creature.");
                                    break;
                                }
                            }
                            else
                            {
                                from.SendMessage("You fail to cure the creature.");
                            }
                        }
                        else if (c.Poison == Poison.Lethal)
                        {
                            if (Utility.Random(100) < 25)
                            {
                                switch (Utility.Random(1))
                                {
                                case 0:
                                    c.Poison = null;
                                    from.SendMessage("You have cured this creature.");
                                    break;
                                }
                            }
                            else
                            {
                                from.SendMessage("You fail to cure the creature.");
                            }
                        }

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

                        m_Powder.Delete();
                    }
                }
            }