Full Version : Dismount
xmlspawner >>XMLSpawner Mods and Tips >>Dismount


<< Prev | Next >>

Gembone- 08-13-2006
ok that helped me get it to work thanks.
also there seems to be a slight delay in the dismount.
is there a way to make it instantaneous.
imediatly as the enter the spawners range it dismounts them and givethe msg.
even while walking on a mount they can get a good 5-6 tiles before it dismounts them.

also this might not be possible but is there also a way to get it to stable the mount or stable all followers that are with the player.

ArteGordon- 08-13-2006
QUOTE (Gembone @ August 13, 2006 03:39 pm)
ok that helped me get it to work thanks.
also there seems to be a slight delay in the dismount.
is there a way to make it instantaneous.
imediatly as the enter the spawners range it dismounts them and givethe msg.
even while walking on a mount they can get a good 5-6 tiles before it dismounts them.

also this might not be possible but is there also a way to get it to stable the mount or stable all followers that are with the player.

there can be up to a 1 second delay. You cannot eliminate that.

There is no way for it to stable the mount without a scripting mod.

If you added something like this to your playermobile.cs, then you could do it

CODE

       // ARTEGORDONMOD
       // dismount and stable the mount
       public bool DismountAndStable
       {
           get { return false; }
           set
           {
               if (value == true)
               {
                   BaseCreature bc = Mount as BaseCreature;

                   if (Mount != null)
                   {
                       // dismount
                       Mount.Rider = null;
                   }
                   if (bc != null)
                   {
                       // stable it
                       bc.ControlTarget = null;
                       bc.ControlOrder = OrderType.Stay;
                       bc.Internalize();
                       bc.SetControlMaster(null);
                       bc.SummonMaster = null;
                       Stabled.Add(bc);
                       Say("Your mount has been stabled.");
                   }
               }
           }
       }


and then use a spawn entry like this

SETONTRIGMOB/dismountandstable/true

Gembone- 08-13-2006
ok about where would this need to be in the playermobile.
I can live with the delay( not that I have a choice) but with this added to it to stable there mount. the delay wouldn't matter as much. could this call be made for all followers and not just the mount?

ArteGordon- 08-13-2006
you can put it anywhere in the playermobile class. Just dont put it inside of a method (you will get many compiler errors).

You could modify it look nearby for followers and stable them, like this

CODE

       public bool DismountAndStableFollowers
       {
           get { return false; }
           set
           {
               if (value == true)
               {
                   if (Mount != null)
                   {
                       // dismount
                       Mount.Rider = null;
                   }

                   ArrayList stablelist = new ArrayList();
                   // check for followers within 10 tiles
                   foreach (Mobile m in this.GetMobilesInRange(10))
                   {
                       BaseCreature bc = m as BaseCreature;
                       if (bc != null && bc.ControlMaster == this && bc.Controlled)
                           stablelist.Add(bc);                      
                   }

                   foreach (BaseCreature bc in stablelist)
                   {
                       // stable it
                       bc.ControlTarget = null;
                       bc.ControlOrder = OrderType.Stay;
                       bc.Internalize();
                       bc.SetControlMaster(null);
                       bc.SummonMaster = null;
                       Stabled.Add(bc);                      
                   }

                   if(stablelist.Count > 0)
                       Say("Your followers have been stabled.");
               }
           }
       }


I havent tested this, but it should work. You would use a similar spawn entry

SETONTRIGMOB/DismountAndStableFollowers/true

Gembone- 08-13-2006
ok put that in the player mobile and this is what I get.
CODE
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 2 warnings)
- Warning: Scripts\Customs\ExplodeCommand\Explode.cs: CS0183: (line 38, column
28) The given expression is always of the provided ('Server.Mobile') type
- Warning: Scripts\Customs\ExplodeCommand\Explode.cs: CS0183: (line 44, column
28) The given expression is always of the provided ('Server.Mobile') type
- Error: Scripts\Mobiles\PlayerMobile.cs: CS0117: (line 952, column 70) 'Server
.Mobiles.BaseCreature' does not contain a definition for 'Controlled'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


ArteGordon- 08-13-2006
you must be using RunUO 1.0. Change it to 'Controled'.

In 2.0 they used the correct spelling of 'Controlled'

Gembone- 08-13-2006
ok that has it working great. one concern though for the stable issue is what happens if they dont have enough gold to pay for the stable or if the stable is full


Edit: ok money or not it stables pet. testing other now
also noticed that with SETONTRIGMOB/DismountAndStableFollowers/true and they are not mounted it doesn't check for followers. is there a second command I can enter that would check for followers without being mounted?

ArteGordon- 08-13-2006
that is because you have the PlayerTrigProp set to "mounted=true". It will only trigger if they are mounted.
You could try changing the test to also check for Followers like

"mounted=true | Followers > 0"

Gembone- 08-13-2006
ok well I am now at an impass. there is a major exploit that can be easily used with having this stable there mount and followers. it doesn't check for limit at stable. they can keep pilling them in no matter what. unless a check can be implemented to see if the stable will hold more pets and if the stable is full move the followers outside the bounds of the spawner.

also with the added | followers > 0 it works without being mounted

ArteGordon- 08-13-2006
just modify the stabling to include this test

QUOTE

                    foreach (BaseCreature bc in stablelist)
                    {
                        if (Stabled.Count >= AnimalTrainer.GetMaxStabled(this))
                            break;


                        // stable it
                        bc.ControlTarget = null;
                        bc.ControlOrder = OrderType.Stay;
                        bc.Internalize();
                        bc.SetControlMaster(null);
                        bc.SummonMaster = null;
                        Stabled.Add(bc);

                    }

Gembone- 08-13-2006
hmm letting me put as many as I want in stable.

ArteGordon- 08-13-2006
if you have 120 skill in taming, animal lore, and vet, you can have up to 15. Have you gone over that?

Gembone- 08-14-2006
haha I stopped at 14. didn't realise the max stabled went that high. will check again and let you know.

Edit: Ok that part works great now. I know you are probly getting tired of this subject but I have one more question. is there also a command that will keep all followers outside of the spawners range. for those that too many in the stable they still just follow the player into the spawners range. although id does keep spamming the no mounts allowed and your pet has been stabled while they are in the spawners range.

ArteGordon- 08-14-2006
you could have a spawner that triggered on controlled creatures, and then moved them to some location.

Set up a spawner with the AllowNPCTrigger flag set to true. Then set the PlayerTrigProp to "controlled=true" and then have a spawn entry like

SETONTRIGMOB/OFFSET,10,10

which will move the triggering creature +10 x and +10 y from their current location.
There are other ways that you could move them as well.

Gembone- 08-15-2006
ok got everything worlking great. thanks so much for all the help.