Exemple #1
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseCreature)
            {
                BaseCreature t = ( BaseCreature )target;

                if (t.IsBonded == true)
                {
                    from.SendMessage("That pet is already bonded!");
                }
                else if (t.ControlMaster != from)
                {
                    from.SendMessage("That is not your pet!");
                }
                else

                {
                    t.IsBonded = !t.IsBonded;
                    from.SendMessage("You bond with the pet!");

                    m_Deed.Delete();                     // Delete the deed
                }
            }
            else
            {
                from.SendMessage("That is not a valid traget.");
            }
        }
 protected override void OnTarget(Mobile from, object target)
 {
     if (target == from)
     {
         from.SendMessage("You cant do that.");
     }
     else if (target is BaseCreature)
     {
         BaseCreature c = (BaseCreature)target;
         if (c.Controlled == false)
         {
             from.SendMessage("That Creature is not tamed.");
         }
         else if (c.ControlMaster != from)
         {
             from.SendMessage("This is not your pet.");
         }
         else if (c.Controlled == true && c.ControlMaster == from)
         {
             c.IsBonded = true;
             from.SendMessage("Your pet has bonded with you.");
             from.PlaySound(503);
             m_Powder.Delete();
         }
     }
     else
     {
         from.SendMessage("You cant do that.");
     }
 }
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseCreature)
            {
                BaseCreature t = ( BaseCreature )target;

                if (t.IsBonded == true)
                {
                    from.SendMessage(38, "That pet is already bonded!");
                }
                else if (t.ControlMaster != from)
                {
                    from.SendMessage(38, "That is not your pet!");
                }
                else

                {
                    t.IsBonded = !t.IsBonded;
                    from.SendMessage(68, "You bond with the pet!");
                    Effects.SendLocationParticles(EffectItem.Create(t.Location, t.Map, EffectItem.DefaultDuration), 0x376A, 1, 29, 0x47D, 2, 9962, 0);
                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(t.X, t.Y, t.Z - 7), t.Map, EffectItem.DefaultDuration), 0x37C4, 1, 29, 0x47D, 2, 9502, 0);

                    Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 1, 29, 0x47D, 2, 9962, 0);
                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z - 7), from.Map, EffectItem.DefaultDuration), 0x37C4, 1, 29, 0x47D, 2, 9502, 0);
                    from.Animate(20, 5, 1, true, false, 0);
                    from.PlaySound(0x201);
                    from.PlaySound(0x212);

                    m_Deed.Delete(); // Delete the deed
                }
            }
            else
            {
                from.SendMessage(38, "That is not a valid traget.");
            }
        }