[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:
add the following after that line:
3) How open you BaseCreature.cs, find this line:
change it for this
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:
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.
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.