public virtual void OnTarget(Mobile from, object obj)
        {
            Horse pet = obj as Horse;

            if (pet == null)
            {
                from.SendMessage("This isn't a horse, idiot!");
            }
            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendMessage("You can only saddle a horse that you currently own.");
            }
            else
            {
                pet.Delete();

                PackHorse packhorse = new PackHorse();
                packhorse.Controlled    = true;
                packhorse.ControlMaster = from;
                packhorse.Location      = from.Location;
                packhorse.Map           = from.Map;
                World.AddMobile(packhorse);

                this.Delete();

                from.SendMessage("You place the saddle onto your horse.");
            }
        }
示例#2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Horse horse)
                {
                    if (horse.ControlMaster == null)
                    {
                        horse.Say(true, "The wild beast refuses the bridle!");
                        return;
                    }

                    if (horse.ControlMaster != from)
                    {
                        horse.SayTo(from, true, "This isn't your animal!");
                        return;
                    }

                    var oldHorseLocation     = horse.Location;
                    var oldHorseControlOrder = horse.ControlOrder;

                    m_Bridal.Delete();
                    horse.Internalize();
                    horse.Delete();

                    var packHorse = new PackHorse();
                    packHorse.SetControlMaster(from);
                    packHorse.ControlTarget = from;
                    packHorse.ControlOrder  = oldHorseControlOrder;
                    packHorse.MoveToWorld(oldHorseLocation, from.Map);
                }
                else if (targeted is BaseCreature creature)
                {
                    creature.Say(true, "The beast refuses!");
                }
            }
示例#3
0
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseCreature)
     {
         BaseCreature bc = (BaseCreature)targ;
         if (from.InRange(bc, 1))
         {
             if (bc.ControlMaster != from)
             {
                 from.SendMessage("You can only put a pack on your own animal!");
             }
             else
             {
                 if (targ is WildHorse)
                 {
                     PackHorse ph = new PackHorse();
                     ConvertAnimal(bc, ph);
                     sb.Consume();
                 }
                 else if (targ is Llama)
                 {
                     PackLlama pl = new PackLlama();
                     ConvertAnimal(bc, pl);
                     sb.Consume();
                 }
                 else
                 {
                     from.SendMessage("You can't put a pack on that.");
                 }
             }
         }
         else
         {
             from.SendMessage("That's too far away");
         }
     }
     else
     {
         from.SendMessage("You can't put a pack on that.");
     }
 }
示例#4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                base.OnTarget(from, targeted);
                if (from == null)
                {
                    return;
                }
                if (!from.Alive)
                {
                    return;
                }

                if (targeted is NubiaCreature)
                {
                    NubiaCreature mount = targeted as NubiaCreature;

                    if (mount.IsFriend(from) || mount.ControlMaster == from)
                    {
                        int body = mount.BodyValue;
                        if (body == 0xC8 ||
                            body == 0x3E9F ||
                            body == 0xE2 ||
                            body == 0x3EA0 ||
                            body == 0xE4 ||
                            body == 0x3EA1 ||
                            body == 0xCC ||
                            body == 0x3EA2)  //HORSE
                        {
                            from.Emote("*Scelle les sacs sur le cheval*");
                            Point3D p      = mount.Location;
                            Map     m      = mount.Map;
                            Mobile  master = mount.ControlMaster;
                            bool    tamed  = mount.Controlled;
                            mount.Delete();
                            PackHorse horse = new PackHorse();
                            horse.MoveToWorld(p, m);
                            horse.ControlMaster = master;
                            horse.Controlled    = tamed;
                            horse.ControlOrder  = OrderType.Stay;
                            if (mPack != null)
                            {
                                mPack.Delete();
                            }
                        }
                        else if (mount is Llama || mount is RidableLlama)
                        {
                            from.Emote("*Scelle les sacs sur le Lama*");
                            Point3D p      = mount.Location;
                            Map     m      = mount.Map;
                            Mobile  master = mount.ControlMaster;
                            bool    tamed  = mount.Controlled;
                            mount.Delete();
                            PackLlama lama = new PackLlama();
                            lama.MoveToWorld(p, m);
                            lama.ControlMaster = master;
                            lama.Controlled    = tamed;
                            lama.ControlOrder  = OrderType.Stay;
                            if (mPack != null)
                            {
                                mPack.Delete();
                            }
                        }
                        else
                        {
                            from.SendMessage("Utilisez cela sur un cheval ou un lama");
                        }
                    }
                    else
                    {
                        from.SendMessage("La monture ne se laisse pas approcher");
                        mount.Emote("*s'agite nerveusement*");
                    }
                }
                else
                {
                    from.SendMessage("Vous devez visez une monture vous appartenant");
                }
            }