Hello guys!I was looking into xmlspawner guides around the forum,i see how to make a champion based on XML,but its possible to spawn a travel gate or teleport when last wave is finished?
Im talking about only waves,no final boss or champion so i want to spawn gate to another room when las wave hasbeen finished,thank you!
 
I have a spawner that looks for an item in your pack, and spawns a ring, on a table. Double click the ring and it teleports you. I know that is not a gate, but I never could figure out how to spawn a gate. I know you can do the sequential spawn, so you can control how many of what comes in each wave. I know you can spawn an item, or trigger an object. Not sure about spawning a gate.

I am guessing here, but maybe have the spawner go through the sequence and the final spawn is another spawner, that creates a gate (but I never figured out how to spawn a gate). Sounds intriguing...

~Edit~ Ok, I think I got it. place an xml spawner and put this - Moongate/target/(3501,2573,14)/targetmap/trammel
Of course change map & coordinates as needed. This goes to Haven. If you use the sequential spawn setting you can have the gate spawn after the last critter dies. Oh, this is going to be fun... now I can make a quest chain that spawns critters, and a gate, then at new location spawn critters, then a gate... so many options... (I have been on lockdown almost a month at the house - I needed a new toy ha ha)
 
Last edited:
If for example the last wave was sub 6

adds the gate and waituntil is the amount of time before the gate is removed (1 min in this example)
both sub 7
C#:
Moongate/Target/(6223,3744,0)/TargetMap/Felucca
WAITUNTIL,1

another waituntil makes it wait 10 min before restarting the spawn
sub8
C#:
WAITUNTIL,10
 
Thank you guys,im next to get it working cause never worked with xmlspawner,this is my config on spawn,all running as i want,but gate never expires,im forgeting something?Thanks!Are the 2x WAITUNTIL,10 needed?
GOT IT
 

Attachments

  • Sin título.png
    Sin título.png
    321.2 KB · Views: 71
Last edited:
I just found another option. This is from Arte, from a 2006 forum, but it still works. It is a simple attachment, that creates a gate on the death of the critter. You would have to make a last spawn critter, to make sure everything else is gone, I suppose. This spawns an orc, when it dies a gate to Haven opens, and gate closes in one minute. Also, it is a one way gate. There is not a corresponding gate in Haven.


orc/ATTACH/<xmldeathaction/action/@moongate/target/(3501,2573,14)/targetmap/trammel/ATTACH/temporaryquestobject,,1
 
I used this code in a boss that when you kill it you get a gate :
{
//change the line below to the cords and map you want
Moongate gate = new Moongate( new Point3D( 6209, 2892, 0 ), Map.Felucca );

if( gate != null && !gate.Deleted && corpse != null && !corpse.Deleted )
{
gate.MoveToWorld( corpse.Location, corpse.Map );

//set how long you want the gate to stay open by changing the 30.0 in the line below
Timer.DelayCall( TimeSpan.FromSeconds( 45.0 ), new TimerCallback( gate.Delete ) );

// corpse.DropItem( new EssenceofSarm() );

}
 
I used this code in a boss that when you kill it you get a gate :
{
//change the line below to the cords and map you want
Moongate gate = new Moongate( new Point3D( 6209, 2892, 0 ), Map.Felucca );

if( gate != null && !gate.Deleted && corpse != null && !corpse.Deleted )
{
gate.MoveToWorld( corpse.Location, corpse.Map );

//set how long you want the gate to stay open by changing the 30.0 in the line below
Timer.DelayCall( TimeSpan.FromSeconds( 45.0 ), new TimerCallback( gate.Delete ) );

// corpse.DropItem( new EssenceofSarm() );

}
That is a scripted solution though and does not work in this situation, as you cannot add that code to an Xmlspawner. ;)

Whether or not this ever got running, a secondary Xmlspawner for a (moon)gate works too and you can hook the trigger it into the sequence of the first Xmlspawner easily. Then [you] have more control over "time" and when things are triggered. :)
 
That is a scripted solution though and does not work in this situation, as you cannot add that code to an Xmlspawner. ;)

Whether or not this ever got running, a secondary Xmlspawner for a (moon)gate works too and you can hook the trigger it into the sequence of the first Xmlspawner easily. Then [you] have more control over "time" and when things are triggered. :)
Nice and easy to do,thank you so much!
 
I just found another option. This is from Arte, from a 2006 forum, but it still works. It is a simple attachment, that creates a gate on the death of the critter. You would have to make a last spawn critter, to make sure everything else is gone, I suppose. This spawns an orc, when it dies a gate to Haven opens, and gate closes in one minute. Also, it is a one way gate. There is not a corresponding gate in Haven.


orc/ATTACH/<xmldeathaction/action/@moongate/target/(3501,2573,14)/targetmap/trammel/ATTACH/temporaryquestobject,,1
Is this typed out correctly or am I missing something hun? When I copy and paste it..it says action: property not found and does not work
 
I have an old monster working correctly,get your monster and add this code to test:
At the top of the monster i just have:

C#:
using System;
using Server.Items;

C#:
public class MobileDeleteTime : Timer
        {
        private Item mob;

        public MobileDeleteTime(Item m)
            : base(TimeSpan.FromSeconds(300))//////aqui el numero de segundos
        {
            mob = m;
            Priority = TimerPriority.OneSecond;
        }

        protected override void OnTick()
        {
            if (mob == null || mob.Deleted)
            {
                Stop();
                return;
            }

            mob.Delete();
        }
    }
//////////////////////////////////////////////////
//////////////////////////////////////////////////
public override bool OnBeforeDeath()
        {
            // spawn the item
            World.Broadcast( 2512, true, "Nexgar has been defeated ! ! ! ..." );
           

            Item item = (Item)Activator.CreateInstance(typeof(Moongate));
            Moongate moon = (Moongate)item;

            moon.TargetMap = Map.Felucca; //or map
            moon.Target = new Point3D(5947, 1459, 10); // Set map X,Y,Z location here
            moon.Hue = 1691;
            //moon.name = "Entrance";

            // Map map = Map.Trammel;

            Point3D pnt = GetSpawnLocation();

            moon.MoveToWorld(pnt, this.Map);

            Timer m_timer = new MobileDeleteTime(item);
            m_timer.Start();
            return base.OnBeforeDeath();
        }

        //from champspawn.cs
        public Point3D GetSpawnLocation()
        {
            int m_SpawnRange = 2;
            Map map = Map;

            if (map == null)
                return Location;

            // Try 20 times to find a spawnable location.
            for (int i = 0; i < 20; i++)
            {
                int x = Location.X + (Utility.Random((m_SpawnRange * 2) + 1) - m_SpawnRange);
                int y = Location.Y + (Utility.Random((m_SpawnRange * 2) + 1) - m_SpawnRange);
                int z = Map.GetAverageZ(x, y);

                if (Map.CanSpawnMobile(new Point2D(x, y), z))
                    return new Point3D(x, y, z);
            }

            return Location;
    }
 
Is this typed out correctly or am I missing something hun? When I copy and paste it..it says action: property not found and does not work
Yes. If you are seeing that error, I am going to assume your Xmlspawner install is not complete and you are missing the Attachments. If not, send me a PM and I will go from there. (see attached screenshot from 5 minutes ago) :)
1638412598075.png
 
Back