home » builders » builder's lessons » unique mobiles

Unique mobiles

An unique mobile sets all the things that a simple mobile does. So everything that has gone before in previous lessons applies here, except instead of an S, a U is used to denote that the mobile is unique and not simple. In addition to what the simple mobile has, the unique mobile has more lines of code setting more features of the mobile. A unique mobile draws less information from the race file than a simple one does. Because of this you may need to set things for that mobile that its race should have, like infravision for underground races.

smelly dwarf short~
{30}a short smelly dwarf~
{30}A short smelly dwarf is drinking an ale here.~
{30}He is very short for a dwarf with dark hair and a dark beard.  He has a
stubby nose and beady eyes.  His hands are large and calloused from
many hours of work at the forge.  He is of a very sturdy build with arms
and legs like small tree trunks. He wears mithril chainmail.
13 13 13 13 13 13 13

Unique mobiles have the same first two lines of code as simple mobs except it starts with a U to denote that it is a unique mobile. As you can see there are several more lines of code setting information about the mobile. Lets go through each line:

AFF_BERSERK AFFTWO_MIND_SHIELDING - This is the affect flags section. It determines what spells and so on the mobile is affected by. A mobile can be affected by more than one affect. Seperate each one with a | (pipe). Some simple mobs may be affected by spells if it is in their race characteristics. For instance simple mobile elves are affected by sneak. You can see what a race is affected by with the showrace command on the test port. For an incomplete list of affect flags look at here. Note that this is two separate values: AFF and AFFTWO.

ARMOR_TYPE_PLATE_MAIL MATERIAL_MITHRIL - Every mobile in the game has what is called Virtual Armour. This armour is worn on the body and helps equal up the fight between NPC and PC. This virtual armour does not fall from the mobile on death. For simple mobs what type and material the virtual armour has is determined by the race and class file. The dwarf in our sample mobile is wearing mithril platemail virtual armour. If you decide that they should wear a piece of armour that players can get, the armour you put on them in resets will over-ride the virtual armour. You should still set the virtual armour to what you want so that if your mobile loads without the object for some reason they are wearing appropriate armour. For a list of armour types refer to here and for a list of material types refer to here.

ALIGN_NEUTRAL_GOOD - This is a recent change. Mobiles now only have their alignment written out verbally on this line; they no longer have their hit dice specified by the builder. (n.b. You should still use the numberic value for MSET.)

13 13 13 13 13 13 13 - This line sets the statistics in the following order: str int wis dex con cha lck. You can choose values between 3 and 22. They affect many things that a mobile can do, like what they can wield and carry. A safe set of values is one that is all 13's. This gives the mobile average statistics. Take care not to go overboard with these values. Our dwarf has average statistics. Dexterity affects the number of objects that BOTH NPC and PC's can carry. A mobile who is going to be a shopkeeper does NOT have to have a high dexterity in order to carry all the items. It has been hardcoded that shopkeepers bypass this requirement.

LANG_COMMON|LANG_DWARVEN - This is the languages that the mobile SPEAKS. This is what he UNDERSTANDS. This is very important in questing mobiles and shop keepers. Mobiles can know more than one language. They need to be seperate by the | character. Refer to here for a list of languages.

LANG_COMMON|LANG_DWARVEN - This second line is the languages that the mobile is SPEAKING. If you use sayto $n in your mobile progs it will determine what language the PC is speaking and then speak in that language IF it knows it. If you just use say on its own in mobile progs it will speak the first language in its list reguardless of whether the PC knows it or not.

RIS_MAGIC RIS_NONE RIS_NONE - The first RIS_NONE refers to the resistances that the mobile has, the second are the mobs immunities, and the third its susceptabilities. Our sample dwarf is resistant to magic. For a complete list of possibile resistances/immunities/susceptabilities refer to here.