Example #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
                {
                    return;
                }

                IPoint3D p = targeted as IPoint3D;
                Point3D  d = new Point3D(p);

                if (p == null || from.Map == null)
                {
                    return;
                }

                SpellHelper.GetSurfaceTop(ref p);

                int nThrown = 1;

                if (from.GetDistanceToSqrt(d) > 8)
                {
                    nThrown = 0;
                    from.SendMessage("That is too far away.");
                }
                else if (!from.CanSee(d))
                {
                    nThrown = 0;
                    from.SendLocalizedMessage(500237);                       // Target can not be seen.
                }
                else if ((from.Paralyzed || from.Blessed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
                {
                    nThrown = 0;
                    from.SendMessage("You cannot do that yet.");
                }
                else
                {
                    string jar = m_Potion.Name;
                    if (jar.Contains("flask of "))
                    {
                        jar = jar.Replace("flask of ", "");
                    }
                    int glow = 0; if (m_Potion.Weight == 2.0)
                    {
                        glow = 1;
                    }
                    MonsterSplatter.AddSplatter(p.X, p.Y, p.Z, from.Map, d, from, jar, m_Potion.Hue, glow);
                }

                if (nThrown > 0)
                {
                    from.RevealingAction();
                    m_Potion.Name   = "crystalline flask";
                    m_Potion.Hue    = 0;
                    m_Potion.Weight = 1.0;
                }
            }
Example #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item iJar = targeted as Item;

                    if (from.GetDistanceToSqrt(new Point3D(iJar.X, iJar.Y, iJar.Z)) > 2)
                    {
                        from.SendMessage("That is too far away.");
                    }
                    else if ((from.Paralyzed || from.Blessed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
                    {
                        from.SendMessage("You cannot do that yet.");
                    }
                    else if (iJar is MonsterSplatter)
                    {
                        MonsterSplatter mJar = (MonsterSplatter)iJar;
                        if (mJar.owner is PlayerMobile)
                        {
                            from.SendMessage("That is too diluted to scoop up.");
                        }
                        else
                        {
                            from.RevealingAction();
                            from.PlaySound(0x23F);
                            m_Jar.Name   = "flask of " + iJar.Name;
                            m_Jar.Hue    = iJar.Hue;
                            m_Jar.Weight = iJar.Weight;
                        }
                    }
                    else if (iJar is HolyWater)
                    {
                        from.RevealingAction();
                        from.PlaySound(0x23F);
                        m_Jar.Name   = "flask of holy water";
                        m_Jar.Hue    = 0x539;
                        m_Jar.Weight = 2.0;
                    }
                    else
                    {
                        from.SendMessage("This flask is meant for other substances.");
                    }
                }
                else
                {
                    from.SendMessage("This flask is meant for other substances.");
                }
            }
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
                {
                    return;
                }

                IPoint3D p = targeted as IPoint3D;
                Point3D  d = new Point3D(p);

                if (p == null || from.Map == null)
                {
                    return;
                }

                SpellHelper.GetSurfaceTop(ref p);

                int nThrown = 1;

                if (from.GetDistanceToSqrt(d) > 8)
                {
                    nThrown = 0;
                    from.SendMessage("That is too far away.");
                }
                else if (!from.CanSee(d))
                {
                    nThrown = 0;
                    from.SendLocalizedMessage(500237);                       // Target can not be seen.
                }
                else if ((from.Paralyzed || from.Blessed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
                {
                    nThrown = 0;
                    from.SendMessage("You cannot do that yet.");
                }
                else
                {
                    MonsterSplatter.AddSplatter(p.X, p.Y, p.Z, from.Map, d, from, m_Potion.Name, 0x4F8, 0);
                }

                if (nThrown > 0)
                {
                    from.RevealingAction();
                    m_Potion.Consume();
                    from.AddToBackpack(new Bottle());
                    Misc.Titles.AwardKarma(from, -40, true);
                }
            }
        public static bool TooMuchSplatter(Mobile from)
        {
            int splatter = 0;

            foreach (Item i in from.GetItemsInRange(10))
            {
                if (i is MonsterSplatter)
                {
                    MonsterSplatter splat = (MonsterSplatter)i;
                    if (splat.owner != from)
                    {
                        splatter++;
                    }
                }
            }

            if (splatter > 16)
            {
                return(true);
            }

            return(false);
        }
        public static void AddSplatter(int iX, int iY, int iZ, Map iMap, Point3D iLoc, Mobile source, string description, int color, int glow)
        {
            Effects.PlaySound(iLoc, iMap, 0x026);

            double weight = 1.0;    if (glow > 0)
            {
                weight = 2.0;
            }

            MonsterSplatter Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;

            Spill.MoveToWorld(new Point3D((iX - 2), (iY - 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX - 1), (iY - 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX - 1), iY, iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX - 1), (iY + 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D(iX, (iY + 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 1), (iY + 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 1), iY, iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 1), (iY - 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D(iX, (iY - 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 1), (iY - 2), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 2), (iY - 2), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX - 2), (iY + 1), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX - 2), (iY + 2), iZ), iMap);
            Spill = new MonsterSplatter(source); Spill.Name = description; Spill.Hue = color; Spill.Weight = weight;
            Spill.MoveToWorld(new Point3D((iX + 1), (iY + 2), iZ), iMap);

            if (glow > 0)
            {
                StrangeGlow Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 2), (iY - 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 1), (iY - 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 1), iY, iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 1), (iY + 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D(iX, (iY + 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 1), (iY + 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 1), iY, iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 1), (iY - 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D(iX, (iY - 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 1), (iY - 2), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 2), (iY - 2), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 2), (iY + 1), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX - 2), (iY + 2), iZ), iMap);
                Glow = new StrangeGlow(); Glow.Name = description;
                Glow.MoveToWorld(new Point3D((iX + 1), (iY + 2), iZ), iMap);
            }
        }