RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Shivan Spawneable Guards

shivan

Sorceror
[RunUO 2.0 RC1/2] Shivan Spawneable Guards v1.9

Hi, this is the first scritp that i made that really deserved to be uploaded here :), but still is a simple one though, im learning :).

Ok, these Guards are not AreaRegion guards, this ones you will have to spawn them like any other NPCs.

The FightMode are set to EVIL, so they attacks Criminals and Pks on sight.
And also attacks any monster with FightMode.Closest that they come across.
(this is set manually by a opposition group, so there could be any missplaced or mising NPC on the list, if you see one please tell me), this also means that if you have any custom NPC and you plan that the guards could attack it you have to add it to the list.

Ok, there are 3 types of guards; Mage, Warrior, Archer:

In common they could be mounting or no, there are 50% chance that they have a horse on spawn.
all of them have a high chance of pacify enemy pets attacking them and go directly to attack their masters.

Their also respond to a "guards" speech, in a very limited from, for example if a enemy is running from a guard and try to hide inside a building or maybe being a wall there is a chance that the guard can get to him, here is where comes the guards command, is a guard stills have a target and that target is hiding behind a wall (it must block LOS), if someone say "guards" the guard will teleport to its target and attack. THIS ONLY WORK IF THE GUARD HAVE A TARGET AND HAVE A BLOCKED LOS.

Also there are an "Advanced Guard Command" mode, that is disabled by default, but when enable the guards will askwer to the "guards" speech in a diferent way, it also work as mencioned before, but when someone says "guards" the guard will check for any enemy Player in its perception range, no matter if hiding behind a wall, and inmidiately attacks him if if in Visual, if not in LOS (ie: behind a wall) it will teleport to it. This only works with Players and not monsters.
If the player is hidded, nothing will happend, the guard cant see it.

Added v1.8:
A how exist a new guard variant that, as all others, attacks monsters, and Criminals only.

The Mage:

Is a mage, it have some added random spells, and is inmune to poison.
It can Dispel Summons attacking her.

The Warrior:

The Warrior have random equiptment, it could have a Sword, Fence or Mace weapon, and if it have a one handed weapon it also have a shield.
And also heals itself with bandages.
Does bonus damage to summons.

The Archer:

Like the warrior, it also heal with bandages and the weapon is a random of bows and crossbows, and does bonus damaged to summons.

When the targets comes in melee range it uses a dagger instead, and if the target gets away from him, it use its ranged weapon again.

It also have 20% chance of dismounting the target (if a player) or kill the mount (other NPC) when using a Heavy Crossbow.

The "Good" Guards:
-Attacks Criminal and PKs.
-Attacks Monsters
-Attacks Evil Guards

The "Evil" Guards:
-Attacks any player which less than 5 kills.
-Attacks Monsters
-Attacks Good Guards

The "No Criminals" Guards:
-Attacks Criminal.
-Attacks Monsters

Installation: (2 small distro edits) Always save a backup!.
-------------------------------------------------------
1) Drop the spawneableguard folder intro your custom folder.
2) Open your OppositionGroup.cs file and find this line:
Code:
		public static OppositionGroup FeyAndUndead
		{
			get{ return m_FeyAndUndead; }
		}

add the following after that line:

Code:
        private static OppositionGroup m_newguards = new OppositionGroup(new Type[][]
			{
				new Type[]
				{
					typeof( NewMageGuard ), 
                                        typeof( NewArcherGuard ), 
					typeof( NewWarriorGuard ),
                                        typeof( NewMageEvilGuard ), 
                                        typeof( NewArcherEvilGuard ), 
					typeof( NewWarriorEvilGuard ),
                                        typeof( NewMageNoCriminalGuard ), 
                                        typeof( NewWarriorNoCriminalGuard ), 
					typeof( NewArcherNoCriminalGuard )
				},
				new Type[]
				{   
					typeof( AncientLich ),
					typeof( Bogle ),
					typeof( LichLord ),
					typeof( Shade ),
					typeof( Spectre ),
					typeof( Wraith ),
					typeof( BoneKnight ),
					typeof( Ghoul ),
					typeof( Mummy ),
					typeof( SkeletalKnight ),
					typeof( Skeleton ),
					typeof( Zombie ),
					typeof( ShadowKnight ),
					typeof( DemonKnight ),
					typeof( DarknightCreeper ),
					typeof( RevenantLion ),
					typeof( LadyOfTheSnow ),
					typeof( RottingCorpse ),
					typeof( SkeletalDragon ),
					typeof( Lich ),

					typeof( Centaur ),
					typeof( EtherealWarrior ),
					typeof( Kirin ),
					typeof( LordOaks ),
					typeof( Pixie ),
					typeof( Silvani ),
					typeof( Unicorn ),
					typeof( Wisp ),
					typeof( Treefellow ),

					typeof( Orc ),
					typeof( OrcBomber ),
					typeof( OrcBrute ),
					typeof( OrcCaptain ),
					typeof( OrcishLord ),
					typeof( OrcishMage ),
					typeof( SpawnedOrcishLord ),

					typeof( Savage ),
					typeof( SavageRider ),
					typeof( SavageRidgeback ),
					typeof( SavageShaman ),
					
					typeof( TerathanAvenger ),
					typeof( TerathanDrone ),
					typeof( TerathanMatriarch ),
					typeof( TerathanWarrior ),
					typeof( OphidianArchmage ),
					typeof( OphidianKnight ),
					typeof( OphidianMage ),
					typeof( OphidianMatriarch ),
					typeof( OphidianWarrior ),

					typeof( DireWolf ),
					typeof( HellCat ),
					typeof( PredatorHellCat ),
					typeof( GiantToad ),
					typeof( HellSteed ),
					typeof( BlackSolenInfiltratorQueen ),
					typeof( LesserHiryu ),
					typeof( SavageRidgeback ),
					typeof( ScaledSwampDragon ),
					typeof( SkeletalMount ),
					typeof( Alligator ),
					typeof( GiantSerpent ),
					typeof( IceSerpent ),
					typeof( IceSnake ),
					typeof( LavaLizard ),
					typeof( LavaSerpent ),
					typeof( LavaSnake ),
					typeof( SilverSerpent ),
					typeof( Snake ),
					typeof( GiantRat ),
					typeof( Sewerrat ),
					typeof( VampireBat ),
					typeof( EvilHealer ),
					typeof( EvilWanderingHealer ),
					typeof( Harrower ),
					typeof( HarrowerTentacles ),
					typeof( BlackSolenInfiltratorWarrior ),
					typeof( BlackSolenQueen ),
					typeof( BlackSolenWarrior ),
					typeof( BlackSolenWorker ),
					typeof( RedSolenInfiltratorQueen ),
					typeof( RedSolenInfiltratorWarrior ),
					typeof( RedSolenQueen ),
					typeof( RedSolenWarrior ),
					typeof( RedSolenWorker ),
					typeof( AbysmalHorror ),
					typeof( BoneDemon ),
					typeof( Devourer ),
					typeof( FleshGolem ),
					typeof( FleshRenderer ),
					typeof( Gibberling ),
					typeof( GoreFiend ),
					typeof( Impaler ),
					typeof( MoundOfMaggots ),
					typeof( PatchworkSkeleton ),
					typeof( Ravager ),
					typeof( Revenant ),
					typeof( SkitteringHopper ),
					typeof( VampireBat ),
					typeof( WailingBanshee ),
					typeof( WandererOfTheVoid ),
					typeof( DreadSpider ),
					typeof( FrostSpider ),
					typeof( GiantBlackWidow ),
					typeof( GiantSpider ),
					typeof( AirElemental ),
					typeof( IceElemental ),
					typeof( ToxicElemental ),
					typeof( PoisonElemental ),
					typeof( FireElemental ),
					typeof( WaterElemental ),
					typeof( EarthElemental ),
					typeof( Efreet ),
					typeof( SnowElemental ),
					typeof( AgapiteElemental ),
					typeof( BronzeElemental ),
					typeof( CopperElemental ),
					typeof( DullCopperElemental ),
					typeof( GoldenElemental ),
					typeof( ShadowIronElemental ),
					typeof( ValoriteElemental ),
					typeof( VeriteElemental ),
					typeof( ArcaneDaemon ),
					typeof( Balron ),
					typeof( Betrayer ),
					typeof( BoneMagi ),
					typeof( ElderGazer ),
					typeof( EvilMage ),
					typeof( EvilMageLord ),
					typeof( Gargoyle ),
					typeof( GargoyleDestroyer ),
					typeof( GargoyleEnforcer ),
					typeof( Gazer),
					typeof( GolemController ),
					typeof( IceFiend ),
					typeof( Imp ),
					typeof( OrcishMage ),
					typeof( RatmanMage ),
					typeof( SkeletalMage ),
					typeof( Succubus ),
					typeof( Titan ),
					typeof( ArcticOgreLord ),
					typeof( Brigand ),
					typeof( ChaosDaemon ),
					typeof( Cursed ),
					typeof( Cyclops ),
					typeof( Doppleganger ),
					typeof( EnslavedGargoyle ),
					typeof( Ettin ),
					typeof( Executioner ),
					typeof( FrostTroll ),
					typeof( GazerLarva ),
					typeof( HeadlessOne ),
					typeof( Juggernaut ),
					typeof( KhaldunRevenant ),
					typeof( KhaldunSummoner ),
					typeof( KhaldunZealot ),
					typeof( Moloch ),
					typeof( Mongbat ),
					typeof( Mummy ),
					typeof( Ogre ),
					typeof( OgreLord ),
					typeof( Ratman ),
					typeof( RatmanArcher ),
					typeof( RestlessSoul ),
					typeof( WhiteWyrm ),
					typeof( ShadowFiend ),
					typeof( SpectralArmour ),
					typeof( StoneGargoyle ),
					typeof( StrongMongbat ),
					typeof( Troll ),
					typeof( ExodusMinion ),
					typeof( ExodusOverseer ),
					typeof( JukaLord ),
					typeof( JukaMage ),
					typeof( JukaWarrior ),
					typeof( MeerCaptain ),
					typeof( MeerEternal ),
					typeof( MeerMage ),
					typeof( MeerWarrior ),
					typeof( HellHound ),
					typeof( VorpalBunny ),
					typeof( DarkWisp ),
					typeof( BladeSpirits ),
					typeof( EnergyVortex ),
					typeof( FrostOoze ),
					typeof( Golem ),
					typeof( PlagueBeast ),
					typeof( PlagueSpawn ),
					typeof( SandVortex ),
					typeof( Slime ),
					typeof( Reaper ),
					typeof( BogThing ),
					typeof( Bogling ),
					typeof( Corpser ),
					typeof( Quagmire ),
					typeof( SwampTentacle ),
					typeof( WhippingVine ),
					typeof( AncientWyrm ),
					typeof( DeepSeaSerpent ),
					typeof( Dragon ),
					typeof( Leviathan ),
					typeof( SerpentineDragon ),
					typeof( ShadowWyrm ),
					typeof( Drake ),
					typeof( Harpy ),
					typeof( Kraken ),
					typeof( Lizardman ),
					typeof( Scorpion ),
					typeof( StoneHarpy ),
					typeof( Wyvern ),
					typeof( DeathwatchBeetle ),
					typeof( DeathwatchBeetleHatchling ),
					typeof( EliteNinja ),
					typeof( FanDancer ),
					typeof( FireBeetle ),
					typeof( Kappa ),
					typeof( KazeKemono ),
					typeof( Oni ),
					typeof( RaiJu ),
					typeof( Ronin ),
					typeof( RuneBeetle ),
					typeof( TsukiWolf ),
					typeof( YomotsuWarrior ),
					typeof( Yamandon),
					typeof( YomotsuElder ),
					typeof( YomotsuPriest ),
					typeof( SummonedDaemon ),
					typeof( abscess ),
					typeof( Changeling ),
					typeof( Chimera ),
					typeof( CuSidhe ),
					typeof( DreadHorn ),
					typeof( DryadA ),
					typeof( FetidEssence ),
					typeof( Grobu ),
					typeof( Hydra ),
					typeof( InsaneDryad ),
					typeof( InterredGrizzle ),
					typeof( LadyMelisande ),
					typeof( LeatherArmoredMinotaur ),
					typeof( Lurg ),
					typeof( Minotaur ),
					typeof( MonstrousInterredGrizzle ),
					typeof( PlateArmoredMinotaur ),
					typeof( ReaperForm ),
					typeof( ShimmeringEffusion ),
					typeof( squirrel ),
					typeof( Tangle ),
					typeof( Thrasher ),
					typeof( TormentedMinotaur ),
					typeof( Travesty ),
					typeof( Troglodyte ),
					typeof( IceHound ),
					typeof( Rat ),
					typeof( Daemon )
				}
			});

        public static OppositionGroup newguards
        {
            get { return m_newguards; }
        }

3) How open you BaseCreature.cs, find this line:

Code:
		public virtual OppositionGroup OppositionGroup
		{
            get { return null; }
		}

change it for this

Code:
		public virtual OppositionGroup OppositionGroup
		{
            get { return OppositionGroup.newguards; }
		}

Thats all.

If anyone have a problem or suggestion please toll me.

Change Log:
v1.9
-Fixed a minor bug in the anti-criminal guards.
Note: Anyone updating from 1.8 or older take a look at the opposition group distro edit.

v1.8
-Fixed a problem with the Archers causing client crashes.
-Added the anti-criminal/Monsters guards.

v1.7
-Fixed a issue of guards no attacking criminals.

v1.6
-Fixed a issue with the Opposition group set.

v1.5
-Add an opcional "advanced guard command" what enhance the guards efficiently in towns with an improved askwer to the guards speech.
-Evil guards not longer attacks staff members.

v1.4
-Added random hairs, hair hue, body hue and speech hue to all guards.
-Pacify chance reduced a little, but is still high.

v1.3
-Added Pacify chance to all guards, if a pet attack them there is a high chance that they will pacify it and go directly to attack their master.
-Added bonus damage to summons to Archers and Warrior guards.
-Added Dispel ability to the Mages guards.
-Added a "guards" speech, now the guards respond to a guards speech in a limited way.

v1.21
-Fixed a bug where the Good Mage Guard where BaseEvilGuard thus being attacked by other good guards.
-Reduced the kills check of evils guards to 5.

v1.2
-Added the Evil Guards
-Improved Archer scritp to reduce CPU usage.
-Added Archer dismounting ability.
-Increased walk/run speed.
-Some other scritp modifications to can make the Evil guards.

v1.1
-Changed the base damage of the Warrior and Archer, now both have diferent damage to ajust more to the weapon that they are carrying, the Archer have an extra one for the dagger.
-The Warrior is stronger to physical attacks if have shield.
-The Mage have extra random spells and is inmune to Poison.
-If the guard is mounted when killed, the Horse is killed too.

How to enable the advanced guards command.
In BaseGoodGuard and BaseEvilGuard you will find this line:
Code:
	public virtual bool AdvancedGuardsCommand{ get{ return false; } }

Just change it to true.

BTW, I get the Opposition list from the Plague Zombie Scritp, i removed some npcs that i know that are FightMode.Agressor, if anyone wonders.
 

Attachments

  • Spawneableguards_v1.9.zip
    21.7 KB · Views: 368

[UVA]steve

Wanderer
Love this thanks for posting :D


just one funny thing are they supposed to dismount then re-mount again lol

its not a big deal they work fine i just find it funny they do that :D

and yes i did have to delete some monsters out of the script but they were all at the bottom so were easy to find and delete
 

shivan

Sorceror
The dismount and mount thing is a client error, or maybe a RunUO bug, the problem is an animation. It happends with all mounted creatures.
 

C h a o s

Wanderer
Just curious, if i add this how can i remove the guards that pop up if people/npc's call the REAL guards?


**Edit** Of course im not totally dumb, i can remove all guard zones, but i want people to know if they're in an area with guards so that little msg is nice to see :p
 

shivan

Sorceror
mmm no idea about that, maybe you can edit the distro guards to be deleted when created...

Version 1.2 Released, and finally the evil ones are here.

*Check the distro modificacions if you are updating from 1.0 or 1.1.

BTW, if you are updating you may recibe a serialize error with the Archer, this is normal, you have to choose to delete them and reload the server.
 

[UVA]steve

Wanderer
C h a o s;738051 said:
Just curious, if i add this how can i remove the guards that pop up if people/npc's call the REAL guards?


**Edit** Of course im not totally dumb, i can remove all guard zones, but i want people to know if they're in an area with guards so that little msg is nice to see :p


i know you can disable them using [setguarded false if i remember correctly thats the command :) but you have to do it for each region so think you have to visit every town and do that unless theres a commands to disable all at once im not sure :)
 

Alex21

Sorceror
I think this is a nice script but a lil hard to use to keep order in town, I have seen people get all the guards to attack there pet, Then they are free to kill noobs afk macroers & so forth,

Maybe give the guards like some peacemaking like ability, So they can peace the pet for upwards of a minute then attack the pet owner,

Also if the guards have no line of sight they wont attack the wrong doer so say the red stands around the corner from a guard, Players have no way to tell the guards to go around the corner, I was thinking making the guards handle some keywords like "guards" or "help", then having the guards do a check of all the mobiles with in 13 tiles?, Then set off after the murderer around the corner, Maybe im not sure how to do this exactly make it so if a red is in a building the guards can like pathfind there way in, I have seen that a red can just hide in a shop while the guards are stuck against the wall trying to move into the shop,

Another thing that might help the non mage guards is give them a damage modifier to summons, Since they cant dispell them, Make them do double the damage to them.

Just some things i thought would add something more to this system,

Nice system keep up the good work.
 

Alex21

Sorceror
O also forgot,

Take a look at BaseVendor.cs and see how they give the vendors there random hair & hair hue as well as random skin hue,

Just think they need some prettying up :)
 

shivan

Sorceror
Yeah i can do something about summons and pets as well as skin and hair hues.

About a command im not sure... i have something in mind that may work. Something like that if someone say "guards", and the guard have a combatant but it cant see it it will teleport to the position of the combatant.
 

Alex21

Sorceror
If you need some help for any reason, I could definatley help with people commanding the guards with "guards".
 

Alex21

Sorceror
Yeh, They are perfect for out of town, but i was thinking of removing all guard regions and using these sort of context.
 

Makaar

Sorceror
I use dark guards on our server (supposed to be followers of Minax in Felucca-only), and they wander outside of towns (we use factions so I didn't put them in town) near roadsides and such. Makes it more dangerous to go to Felucca and more risky for resource gatherers. :)

Also an idea that we do on our shard and its up for grabs is we made a new champ altar and put it in the center of each town, then set the radius as wide as each town, then set the spawn waves to be guards like these, but have harder guards on higher levels. Instead of fighting a champ, though, it just stays on the highest level, until it calms down again and resets back down to level 1 (normal guards). This way it almost acts like GTA with the 'stars', but I think it works well in UO-terms.

Just throwing ideas for other people to use.
 

Alex21

Sorceror
Makaar;738289 said:
I use dark guards on our server (supposed to be followers of Minax in Felucca-only), and they wander outside of towns (we use factions so I didn't put them in town) near roadsides and such. Makes it more dangerous to go to Felucca and more risky for resource gatherers. :)

Also an idea that we do on our shard and its up for grabs is we made a new champ altar and put it in the center of each town, then set the radius as wide as each town, then set the spawn waves to be guards like these, but have harder guards on higher levels. Instead of fighting a champ, though, it just stays on the highest level, until it calms down again and resets back down to level 1 (normal guards). This way it almost acts like GTA with the 'stars', but I think it works well in UO-terms.

Just throwing ideas for other people to use.

That sounds cool, But maybe even better, for every guards that falls spawn two more, which self delete after there combatant is long gone or dead, That way they cant beat the guards, And cant survive in town.
 

shivan

Sorceror
Alex21;738285 said:
Yeh, They are perfect for out of town, but i was thinking of removing all guard regions and using these sort of context.

Expect an update, soon, very soon :) im working late tonight to see if i can finish it. The only thing that i still need to finish is the guards command. The rest is already done.
 

Alex21

Sorceror
shivan;738294 said:
Expect an update, soon, very soon :) im working late tonight to see if i can finish it. The only thing that i still need to finish is the guards command. The rest is already done.

Take a look at my bounty system, In there there is a mobile that handles Speech, like "bounty" etc.
 

shivan

Sorceror
There you go, but anyway, the "guards" is very limited, but is best than nothing, making them to find and teleport to targets that they shouldt be seeing is maybe too much, what can do a pk inside a building anyway? if they cast a mass spell will make it vulnerable to the use of the guards command.

The guards will teleport to their target as long they have a target (you will see them running in war mode), and the LOS to their target is blocked by something... a wall for example.

Makaar, my guards are a little "weak" because in my shard i dont use citys, i have camps and i whanted guard mainly for NPC defence when i do an attack event...

But that is easily to figure out, it just stats.
 
Top