Resource icon

Invasion System 1.0

No permission to download

Ravenwolfe

Moderator
Ravenwolfe submitted a new resource:

Invasion System - town invasion

This is a control system for scheduling town invasions. I wrote a simple version of this for a shard I'm helping on. I have since made improvements to it and the owner has consented for me to release it since there are no invasion systems currently released. Also need to give a big thanks to @Vorspire who helped me with the Persistance!

Use the command [invasionsystem and you will get the following gump:
View attachment 9478
In that gump, you can select the town,...

Read more about this resource...
 

manwitch

Citizen
I'm trying to make this work for Runuo 2.5. I get line 108 and 125 persistence doesn't exist in this context errors. I've tried a lot to fix them but at a dead end. Any ideas?
 

Ravenwolfe

Moderator
RunUO does not have Persistence included in the server.

You will need to add the following file to Server/Persistence and then you need to recompile the core. You should be able to add this without any impact to other systems.

I thought @Vorspire had added it to RunUO but it doesn't look like it has been added.
 

Attachments

  • Persistence.cs
    2.3 KB · Views: 46

Ravenwolfe

Moderator
love it!

What about map selection?

As stated, the map can be set for each town in the scripts but the gump doesnt specify the map, so you basically are hardcoding the locations in the script.

I'll look at expanding the functionality in the next version.
 

zerodowned

Moderator
Haven't had a chance to actually look through the system; but do you happen to already know an easy way to make certain items drop only on invasion spawn?
 

zerodowned

Moderator
looks like this is the best place?

Code:
private void AddMonster(Type type)
        {
            object monster = Activator.CreateInstance(type);

            if (monster != null && monster is Mobile)
            {
                Point3D location = FindSpawnLocation();

                if (location == Point3D.Zero)
                {
                    return;
                }

                Mobile from = (Mobile)monster;

                from.OnBeforeSpawn(location, SpawnMap);
                from.MoveToWorld(location, SpawnMap);
                from.OnAfterSpawn();

                if (from is BaseCreature)
                {
                    ((BaseCreature)from).Tamable = false;
                }

                _Spawned.Add(from);
            }
        }
 

Ravenwolfe

Moderator
would it be possible to run this script on the old runuo 1.0 ?
it really looks cool!

Probably, but it would be tricky since RunUO 1.0 compiles older c# and the system uses Linq. I've got many things on my plate before i would look at that, including improvements to this system. A major goal is better spawning so creatures dont end up in unreachable spots.
 

zerodowned

Moderator
I've used this system a few times on my shard and love it.

Two suggestions:
1) Have an option to set the time of the invasion to something more simple like "In X Minutes". Or when it's displaying the time in the gump, have it automatically add about 5 minutes on.

2) If you wanted to get fancy, you could have a setting in the script for the user to enter their actual time zone so that when it does display the date/time in the gump it's translated from UTC

3) Are you color blind or do you secretly love neon pink? lol because the text for entering the date/time is neon pink / magenta / something a little hard to read.