Hey guys! Back again with a question about Xmlspawner and Waypoints.

I have a custom vendor running around the map with Xmlspawner's waypoint system.
I'd like to find a way to make the vendor wait for a minute or two when a player
tries to buy from them, and then continue on their current waypoint path.

I'm not sure where to begin. Is there a way to do this with Xmlspawner?
Could a method be designed at the Script level to set CantWalk to true for
a few minutes when talked to?

I think the cantwalk option might be an easy way, but I don't know what to
override to make that check.

Thanks in advance for any advice!
 
Yes, this can be done, but it's not easy and will likely only work the first time the mob is spawned on that Xmlspawner. (You'd have to reset the Xmlspawner and respawn it every time to get it to cycle correctly).
While a mob is moving to a waypoint, it is still attached to the original spawner. You would have to add WAITUNTIL keyword on each line entry where you want the mob to stop walking.
Here's the catch:
Mob1 spawns and begins moving towards WayPoint1. PlayerA catches Mob1 before it reaches the Waypoint and engages it (by talking to it or fighting it, etc, forcing it to stop). In the meantime, your Xmlspawner has moved on to the next line entry.
Perhaps what you could do is not allow players to interact with the vendor while he's moving. When he arrives at his destination, he will turn around and return to the Xmlspawner he originated from, unless you target another waypoint that would create an actual circle (Xmlspawner to Waypoint1, Waypoint1 to Waypoint2, Waypoint2 to Waypoint1).
 
It is possible, because I do it with a TON of my spawns.

I'll give you 1 hint: it's not-not resource intensive.
 
I'll give you 1 hint: it's not-not resource intensive.
I'm not sure what you mean. Could you elaborate?


I do have the mobile following a loop between a city and a dungeon. There are multiple waypoints to get around the terrain, mostly twists and turns in the mountains.
 
just a thought, but what happens if you "stack" two waypoints on top of each other and link them?
not sure if the mobile would keep moving or just stay there for a while but it's worth a try
 
The mob will stay there, but keep moving around that area.

that's what i figured. although i checked the coordinates for each waypoint in the stack and because i stacked them one was a Z higher than the other and the mobile couldn't get to it so it kept circling. but then i made them both the same z, they pass over 2 or 3 as though they were one.

so i guess the other option is to create an item and mobile class ( or just one mobile if you only want one ). set the item to check for that mobile/class when it steps on it and paralyze it.
I've never messed with it but it looks like you should be able to set the length of time it paralyzes

Code:
public void Paralyze(TimeSpan duration)
        {
            if (!_Paralyzed)
            {
                Paralyzed = true;

                _ParaTimer = new ParalyzedTimer(this, duration);
                _ParaTimer.Start();
            }
        }

Anyway paralyze will make it stop moving and prevent it from looking around
 
quick test script but it works

don't use as is or will freeze players

Code:
using System;
using Server.Mobiles;

namespace Server.Items
{
    public class FreezeTile : Item
    {

        [Constructable]
        public FreezeTile() : base( 1313 )
        {}

        public FreezeTile(Serial serial) : base(serial)
        {
        }
       
         public override bool OnMoveOver(Mobile m)
        {
            m.Paralyze( TimeSpan.FromSeconds( 5.0 ) );

            return true;
        }
       
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
           
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
           
        }
    }
}
 
Back