HOW TO ADD CUSTOM LEGION TYPES
If you are new in the scripting or programming please read the WHOLE text
carefully and follow all instructions !
This small text file will explain how to add custom legion types to the script.
First of all you need to decide wich types of monsters you will have in the
legion. For example you decide to have some kind Ogre legion type consist of:
Ogre lord as a leader,
Ogres as a minions,
Trolls as a support and
Ettins as an infantry.
You need to find class names for the mobiles you decided to include. This is
really simple if you are know what to do. Just search for the corresponding
file names in the runuo monster subfolders (\Scripts\Mobiles\Monsters) because
all standart monster classes is there.
You will find:
Ogre Lord in \Scripts\Mobiles\Monsters\Humanoid\Melee\OgreLord.cs
Ogre in \Scripts\Mobiles\Monsters\Humanoid\Melee\Ogre.cs
Troll in \Scripts\Mobiles\Monsters\Humanoid\Melee\Troll.cs
Ettin in \Scripts\Mobiles\Monsters\Humanoid\Melee\Ettin.cs
Almost always the filename will inform you about the mobile defined in the file.
To be sure just open and view the script to see the Name or corpse name of the
mob. If you sure this is the mob you need look at the class name. For example
lets see the Ettin.cs:
namespace Server.Mobiles
{
[CorpseName( "an ettins corpse" )]
public class Ettin : BaseCreature
{
[Constructable]
See this line:
public class Ettin : BaseCreature
The class name is Ettin :)
Now take a look in the all over files. Yes, the Ogre Lord have OgreLord class
name (Space is removed in the class name, dont forget this !).
Ok, now you know all the class names of all monsters. Time to edit some files :)
I strongly suggest you to make backup copy of the "EvilLegion.cs" and
"EvilAttackTypes.cs". If something going wrong you will always have ability
to restore this files if you make backup.
Open EvilAttackTypes.cs with notepad for example. See this enumeration:
public enum EvilAttackSpawnType
{
Scroll to the end of enum and put a comma after the last type in the enum
and add a new line named Ogre. This should look like this:
public enum EvilAttackSpawnType
{
UndeadLow,
UndeadAdv,
OrcKinLow,
OrcKinAdv,
Savage,
Juka,
Meer,
Ophidian,
Terathan,
Ratman,
Elemental,
AbyssLow,
AbyssAdv,
Dragon,
Forest,
Ogre
}
Dont worrie if the last type of your enum was not the "Forest" because i write
this howto based on version 1.0beta release. In the future versions this enum
may grow :) So, just put a comma at the last type and add another line named
Ogre. Save the file.
Open EvilLegion.cs (again with notepad). Scroll down one or two page and look
for the this code:
public static Type[] spawnTypes = new Type[]
{
typeof( Lich ), typeof( SkeletalKnight ), typeof( Zombie ), typeof( Skeleton ),
typeof( LichLord ), typeof( Lich ), typeof( RottingCorpse ), typeof( SkeletalKnight ),
typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcBomber ), typeof( Orc ),
This is the legions definition. Find the end line, possible look like this:
typeof( Treefellow ), typeof( Treefellow ), typeof( Unicorn ), typeof( Pixie )
};
Again, you need put a comma after last line with typeof() things, press enter
and form the new line as i show below:
typeof( OgreLord ), typeof( Ogre ), typeof( Troll ), typeof( Ettin )
Notice: first typeof() is for leader, second for minions and others is for the
support and infantry.
Now the end of this thing should look this:
typeof( Treefellow ), typeof( Treefellow ), typeof( Unicorn ), typeof( Pixie ),
typeof( OgreLord ), typeof( Ogre ), typeof( Troll ), typeof( Ettin )
};
Save the file. Now, if all is done correctly just start the server and have
a fun with new legion types. If you make the mistakes its highly
possible the server will wont start and show error message at the script
compiling. If you are expirenced or even newby programmer i dont think you
will get any errors :) Anyway if you got them and dont know what this
mean just restore the backup and try again. Believe me, its simple. Just
dont miss anything from this manual.
If you want add non standart monsters form the legions the procedure is
the same. But before add new legion type you need to install the custom mobiles.
Or you already have them installed ? :) Good :) Now just follow all procedures
described above and you will done :)
Lets try on the example. Take a look at the Drow Elves
(http://www.runuo.com/forum/showthread.php?p=289011#post289011)
by malgrimace. I want to have Drow Legion with the following mobiles:
Drow Lord, Drow Sorceress, Drow Archer and Drow Warrior. I will be brief in the
description because all the steps are the same as i describe before.
As i described above add line to EvilAttackTypes.cs:
Drow
As i described above add line to EvilLegion.cs:
typeof( DrowLord ), typeof( DrowSorceress ), typeof( DrowArcher ), typeof( DrowWarrior )
Dont forget about commas at the rigth place and over stuff i mentioned above :)