Exemple #1
0
        public virtual void Activate(AddonComponent c, Mobile from)
        {
            c.ItemID += 1;

            if (c.ItemID >= 0x124D)
            {
                // blood
                int amount = Utility.RandomMinMax(3, 7);

                for (int i = 0; i < amount; i++)
                {
                    int x = c.X + Utility.RandomMinMax(-1, 1);
                    int y = c.Y + Utility.RandomMinMax(-1, 1);
                    int z = c.Z;

                    if (!c.Map.CanFit(x, y, z, 1, false, false, true))
                    {
                        z = c.Map.GetAverageZ(x, y);

                        if (!c.Map.CanFit(x, y, z, 1, false, false, true))
                        {
                            continue;
                        }
                    }

                    Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                    blood.MoveToWorld(new Point3D(x, y, z), c.Map);
                }

                if (from.Female)
                {
                    from.PlaySound(Utility.RandomMinMax(0x150, 0x153));
                }
                else
                {
                    from.PlaySound(Utility.RandomMinMax(0x15A, 0x15D));
                }

                from.LocalOverheadMessage(MessageType.Regular, 0, 501777); // Hmm... you suspect that if you used this again, it might hurt.
                SpellHelper.Damage(TimeSpan.Zero, from, Utility.Dice(2, 10, 5));

                Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(Deactivate), c);
            }
        }