Elyrith

Initiate
During the real early days of OSI UO there was an event where ratmen and lizardmen spawned inside a few cities, including Britain and Trinsic, but the guards didn't react to them.

I found Milva's huge tutorial for xml spawner, but it didn't mention this feature at all. I spent about 45 minutes going over all the props for the xml spawner and 'spawner' with no luck. I did a few searches on these forums for various combinations of 'spawn,' 'spawner,' and 'guards,' but found nothing related. I tried most of the same searches on Google, but almost all relevant info is in these forums.

Ideally I'd like to place 3-4 spawners each in a few cities that will spawn ratmen and lizardmen who will not be killed by guards.

If there's no default way, I have the beginnings of ideas on how to do it:
1) Add an item to the 'backpack' of every enemy spawned, then somehow have the guards not spawn on anything carrying that item.
2) Somehow disable the guards within the spawn area. (However, this likely just creates a 'dangerous' zone that you can leave.)
3)

Some results I found that I don't think are what I'm looking for:
1) "Invasion System 1.0" (found on the ServUO site through Google). This looks like it's designed for a 1-time champion spawn within a town.
2) A custom script called "SimpleInvasionSpawner.cs" (found via Google). This looks more promising, but still does champion spawns. I may be able to chop out the champion stuff and make use of it, though.

I'll keep looking, but if there's a simpler way that I've missed, please let me know.
-Elyrith
 
In /Scripts/Regions/GuardedRegion.cs

Code:
        public bool IsGuardCandidate(Mobile m)
        {
            if (m is BaseGuard || !m.Alive || m.IsStaff() || m.Blessed || (m is BaseCreature && ((BaseCreature)m).IsInvulnerable) ||
                IsDisabled())
            {
                return false;
            }

            return (!AllowReds && m.Murderer) || m.Criminal || (m is BaseCreature && ((BaseCreature)m).IsAggressiveMonster);
}

You can change the last line something like this:

Code:
            return (!AllowReds && m.Murderer) || m.Criminal || (m is BaseCreature && ((BaseCreature)m).IsAggressiveMonster
                 && !(m is RatMan) && !(m is LizardMan));
}
 
That is awesome, thank you!

I don't know if I want all ratmen and lizardmen to be immune, but it's a great head-start!

To get a little trickier, I'll try something with the "team" option in the xml spawner, or some other things as I come up with them.
 
Well, since this comes from "GuardedRegion" you can use the region as a condition easily also. Example:

Code:
*SNIP*

&& !(this is MyEventRegion && m is RatMan) && !(this is MyEventRegion && m is LizardMan)

*SNIP
 
This is my second 'modification' so I was taking some baby steps.

1) I got your first suggestion working (disabling guards for all aggressive mobiles), so you definitely gave me the right place in the code. (Not that I doubted you, but it organized it in my head.)
2) Your second suggestion would probably work, but I don't know how to create an event region. I didn't work on that path, since I really wanted to try using the team
3) I got what I wanted by changing /Scripts/Regions/GuardedRegion.cs:

Code:
if (m is BaseGuard || !m.Alive || m.IsStaff() || m.Blessed || (m is BaseCreature && ((BaseCreature)m).IsInvulnerable) ||
...to...
Code:
if (m is BaseGuard || !m.Alive || m.IsStaff() || m.Blessed || (m is BaseCreature && ((BaseCreature)m).IsInvulnerable) || (m is BaseCreature && ((BaseCreature)m).Team > 1000) ||

Do you think this kind of change is okay to submit a pull request for? That way others could use it to create their own events. I made the check be team greater than 1000 to ensure it didn't collide with any existing teams (I hope), but not restrict it to a particular number. You could also create your own event this way by spawning different teams to fight each other.

I can create the pull request if this is okay, and of course I accept any feedback. :)
 
Well good that it works for you bit first a small suggestion ;)

Code:
if (m is BaseGuard || !m.Alive || m.IsStaff() || m.Blessed || (m is BaseCreature && (((BaseCreature)m).IsInvulnerable || ((BaseCreature)m).Team > 1000)) ||

this way you wont check twice if m is BaseCreature

secondly I dont think you need to create a pull request for this. Since it is a custom feature and not something running on OSI (as far as I know)
 
It looks like there may be a new way to do this. The line we were messing with is now...
Code:
if (m is BaseGuard || m.GuardImmune || !m.Alive || m.IsStaff() || m.Blessed || (m is BaseCreature && ((BaseCreature)m).IsInvulnerable) ||

Now I need to figure out how to add the GuardImmune characteristic to the mobiles from my spawner. That way I won't have a modified core file, too, which is something I was going to look into next. :)
[doublepost=1531968900][/doublepost]My first/test spawner looks like this:
Code:
<Spawns>
	<Points>
		<Name>1997BritainInvasionNW</Name>
		<UniqueId>1997BritainInvasionNW</UniqueId>
		<Map>Trammel</Map>
		<X>3504</X>
		<Y>2741</Y>
		<Width>60</Width>
		<Height>60</Height>
		<CentreX>1473</CentreX>
		<CentreY>1586</CentreY>
		<CentreZ>20</CentreZ>
		<Range>40</Range>
		<MaxCount>20</MaxCount>
		<MinDelay>180</MinDelay>
		<MaxDelay>150</MaxDelay>
		<DelayInSec>False</DelayInSec>
		<Duration>0</Duration>
		<DespawnTime>0</DespawnTime>
		<ProximityRange>-1</ProximityRange>
		<ProximityTriggerSound>500</ProximityTriggerSound>
		<TriggerProbability>1</TriggerProbability>
		<InContainer>False</InContainer>
		<MinRefractory>0</MinRefractory>
		<MaxRefractory>0</MaxRefractory>
		<TODStart>0</TODStart>
		<TODEnd>0</TODEnd>
		<TODMode>0</TODMode>
		<KillReset>1</KillReset>
		<ExternalTriggering>False</ExternalTriggering>
		<SequentialSpawning>-1</SequentialSpawning>
		<AllowGhostTriggering>False</AllowGhostTriggering>
		<AllowNPCTriggering>False</AllowNPCTriggering>
		<SpawnOnTrigger>False</SpawnOnTrigger>
		<SmartSpawning>False</SmartSpawning>
		<TickReset>False</TickReset>
		<Team>1997</Team>
		<Amount>1</Amount>
		<IsGroup>False</IsGroup>
		<IsRunning>True</IsRunning>
		<IsHomeRangeRelative>True</IsHomeRangeRelative>
		<Objects2>Lizardman:MX=25:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=Ratman:MX=15:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=RatmanArcher:MX=5:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:</Objects2>
	</Points>
</Spawns>

I'll work on it more tomorrow. At the last second I tried adding...
Code:
<GuardImmune>True</GuardImmune>
...but that didn't work. I guess it was too easy, hehe.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back