Difference between revisions of "Manual:Game Mechanics/Monsters"

From DikuMUD Wiki
Jump to navigation Jump to search
(Created page with "This might belong better in a builder's tutorial 1. Monster Creation Document Name: monsters.doc Version:...")
 
(checked against the current code (wiki review 2026-11-15))
 
Line 1: Line 1:
−
This might belong better in a builder's tutorial
+
This page explains what a monster's numbers do and how to balance a monster against the players who will meet it. How to write monsters, their fields and the <code>%reset</code> commands that load them is in [[Manual:Zone Manual/The NPC Section|the Zone Manual]], with the templates on [[Manual:Zone Manual/The NPC Section/NPC macros|NPC macros]]. The macros named here come with <code>#include &lt;macros.h&gt;</code>.
  
−
                      1.   Monster Creation
+
== Level ==
−
                               
+
A monster's <code>level</code> is 0 to 199; vmc refuses other values. Mortal players are level 1 to 50, though their virtual level goes on (see [[Manual:Game Mechanics/Levels|Levels]]). The level decides how many points the monster's abilities and weapon and spell skills get (below) and how much experience it gives:
−
Document Name:     monsters.doc
+
* 15% more for each level the monster is above the player (up to a cap, see [[Manual:Game Mechanics/Levels#Experience from a kill|Levels]]), 15% less for each level below; a monster seven levels below a player gives nothing;
−
Version:          7.30
+
* in a group, a member more than five levels below the group's best loses 7% for each level beyond five.
−
Author:           Michael Seifert (seifert@diku.dk)
+
So an area works best when its monsters span about ten levels: below that range they give no experience, above it they kill. A goblin camp for beginners might be level 1 to 8, an orc fortress 10 to 20.
−
Questions to:      seifert@diku.dk
 
−
Document intended for:  World Creators
 
  
−
Short Description:
+
Monsters above level 50 hit harder still: the roll of each blow and attack spell is multiplied by (level - 30) / 25 (<code>roll_boost()</code> in <code>vme/src/fight.cpp</code>), so a level 60 monster rolls 1.2 times as high, a level 100 one 2.8 times, a level 199 one 6.8 times. For levels 51 to 54 the factor is below 1 (0.84 at level 51), so those monsters roll lower than a level 50 one. Players are never above level 50, so this only works for monsters (and gods).
−
This  document describes how to create monsters, and explains  in
 
−
brief  how  the various weapon and armour values interact. Before
 
−
reading  this  document  you should read the object.txt  document
 
−
describing weapon and armour quality. Abilities and their  meaning
 
−
is described in the ability.txt document.
 
  
−
I’ve  attempted to remove all old references that  are no  longer
+
== Abilities ==
−
valid (hand, toughness, etc).
+
A monster's abilities are given as percentages, not values: <code>MSET_ABILITY(str, dex, con, hpp, bra, cha, mag, div)</code>. The eight must add up to 100, or vmc stops ("Abilities in '...' sums up to ..., and not 100"). Without it a monster has STR 40, DEX 30, CON 10, HPP 15, BRA 3, CHA 2.
−
   
 
−
                        2.   Introduction
 
−
                               
 
−
This  document  will  step-by-step go through the  most  important
 
−
attributes of a monster and explain their meaning.
 
  
−
2.1  Monster Level (level)
+
vmc gives the monster 96 &times; level points and spends each ability's share of them (<code>set_points()</code> in <code>vme/src/vmc/vmc_process.cpp</code>). Points get dearer as they are bought: the first ''level'' + 1 points of an ability cost 10 each, the next ''level'' + 1 cost 20 each, and so on. A high percentage therefore gives less than its share:
−
When  creating a monster it must be between level 0 and  199.  The
 
−
level of  the monster decides how many skill points and ability
 
−
points  the  monster  has. Players start at third  level  and  are
 
−
expected to be between level [3..100]. The level of the monster is
 
−
specified using the level field.
 
  
−
    level 0       /* Mosquito */
+
{| class="wikitable"
 +
! Level !! 5% !! 10% !! 15% !! 20% !! 25% !! 30% !! 40% !! 50%
 +
|-
 +
| 1 || 0 || 0 || 1 || 1 || 2 || 2 || 2 || 3
 +
|-
 +
| 5 || 2 || 4 || 6 || 7 || 9 || 10 || 12 || 14
 +
|-
 +
| 10 || 4 || 9 || 12 || 15 || 17 || 19 || 23 || 27
 +
|-
 +
| 20 || 9 || 19 || 24 || 29 || 34 || 39 || 46 || 53
 +
|-
 +
| 30 || 14 || 28 || 37 || 44 || 51 || 58 || 69 || 79
 +
|-
 +
| 50 || 24 || 48 || 61 || 73 || 85 || 97 || 115 || 131
 +
|-
 +
| 100 || 48 || 96 || 122 || 146 || 170 || 194 || 229 || 261
 +
|-
 +
| 150 || 72 || 144 || 183 || 219 || 255 || 291 || 343 || 391
 +
|-
 +
| 199 || 95 || 191 || 243 || 291 || 338 || 386 || 454 || 500
 +
|}
 +
No value goes above 500: vmc cuts it there and warns "An ability is ... points". Spend nothing on both magic and divine: a monster's spells use only one of them (see [[Manual:Game Mechanics/Abilities|Abilities]]). A warrior wants strength (damage), dexterity (defence) and hit points; a caster wants magic or divine, and brain to resist spells.
  
−
In  general, an area should be designed around a 10 level span  to
+
<code>vmc -v</code> prints the values it worked out, with the hit points in the HIT column:
−
be fairly consistent. For example a goblin camp for newbie players
+
<pre>
−
should be of level 0-10 (perhaps only 6). An orc area might be  in
+
                      STR DEX CON HIT BRA CHA MAG DIV
−
the range 10-20th level.
 
−
The  reason  is,  that monsters 10 levels below a  player  give  0
 
−
experience  points  while monsters 10 levels above  a  player  are
 
−
beginning to be a difficult kill. If you make an area too diverse
 
−
players will give up since monsters either seem too easy (no
 
−
experience) or too hard.
 
  
−
2.2 Natural armour & attack
+
black_dragon          44  32  32 106  32  32  44    0
−
The  natural  armour  is  specified using  the NATURAL_DEF  macro
+
young_dragon          51  28  28  94  44  28  37    0
−
together with natural attack. For example:
+
</pre>
 +
(the two dragons in the example at the end of this page).
  
−
NATURAL_DEF(WPN_CRUSH, ARM_PLATE)
+
== Hit points ==
 +
A monster's hit points are 3 &times; HPP + 10; <code>hit</code> in the zone is ignored. With the HPP percentage:
 +
{| class="wikitable"
 +
! Level !! 1 !! 5 !! 10 !! 20 !! 30 !! 50 !! 75 !! 100 !! 150 !! 199
 +
|-
 +
| HPP 10% || 10 || 22 || 37 || 67 || 94 || 154 || 226 || 298 || 442 || 583
 +
|-
 +
| HPP 15% (default) || 13 || 28 || 46 || 82 || 121 || 193 || 286 || 376 || 559 || 739
 +
|-
 +
| HPP 20% || 13 || 31 || 55 || 97 || 142 || 229 || 340 || 448 || 667 || 883
 +
|-
 +
| HPP 30% || 16 || 40 || 67 || 127 || 184 || 301 || 448 || 592 || 883 || 1,168
 +
|}
  
−
You  should  know  that the weight of the monster determines  the
+
== Weapon and spell skills ==
−
maximum  amount of damage it can give when using a natural attack.
+
A monster knows weapons and spells by family and sphere only: one value for all swords, one for all fire spells. <code>MSET_WEAPON(axe_ham, sword, club_mace, pole, unarmed, special)</code> and <code>MSET_SPELL(div, pro, det, sum, cre, min, hea, col, cel, int, ext)</code> give them as percentages, and the weapons and spells together must add up to 100 ("Spells&weapons in '...' sums up to ..."). The default is 100% unarmed. The families are:
−
The weight is categorized as follows:
+
{| class="wikitable"
 +
! Family !! Weapons
 +
|-
 +
| axe_ham || axes and hammers
 +
|-
 +
| sword || swords, daggers, rapiers
 +
|-
 +
| club_mace || clubs, maces, flails, morning stars
 +
|-
 +
| pole || quarterstaff, spear, halberd, bardiche, scythe, trident
 +
|-
 +
| unarmed || fist, kick, claw, bite, sting, crush: all natural attacks
 +
|-
 +
| special || whip, bow, crossbow, sling
 +
|}
 +
The spheres are divine, protection, detection, summoning, creation, mind, heat (fire), cold, cell (electricity), internal (poison) and external (acid).
  
−
  Lbs  Size
+
vmc gives the monster 120 &times; level points for them, bought the same way as abilities. A quarter of its best family becomes its skill in all weapons, and a quarter of its best sphere its skill in all spells. A monster attacks with its skill in the weapon's family, and defends against a weapon with half its skill in that weapon's family (or the quarter, if that is more). Spells work the same way: the spheres are both how well it casts and how well it resists. An orc with nothing in clubs fights badly with a club, and defends poorly against one: give a monster skill in what it wields and in what it will meet.
−
0..5  Tiny
 
−
6..40  Small
 
−
41..160 Medium
 
−
161..50 Large
 
−
  0
 
−
501+  Huge
 
  
−
By default monsters are medium.
+
== Natural attack and armour ==
 +
<code>NATURAL_DEF(weapon, armour)</code> sets what the monster hits with when it wields no weapon, and what protects it where it wears no armour. The default is <code>NATURAL_DEF(WPN_FIST, ARM_HLEATHER)</code>. vmc takes any weapon type numbered from <code>WPN_FIST</code> (34) to <code>WPN_CRUSH</code> (124) in <code>vme/include/values.h</code>; use a natural one: fist, kick, elbow, knee, claw, or one of the sized bites, stings, claws and crushes (<code>WPN_BITE_SMALL</code>, <code>WPN_CLAW_LARGE</code>...). <code>WPN_CRUSH_LARGE</code> and <code>WPN_CRUSH_HUGE</code> are above that range and refused. The armour is one of <code>ARM_CLOTHES</code>, <code>ARM_LEATHER</code>, <code>ARM_HLEATHER</code>, <code>ARM_CHAIN</code> and <code>ARM_PLATE</code>; it decides which column of the attacker's damage table is used (see [[Manual:Game Mechanics/Objects#Weapons|Objects]]).
  
−
2.3  Good, Evil and Neutral alignments (alignment)
+
A natural attack hurts more the heavier the monster is: the roll is cut to a part of itself before the damage table, by the monster's <code>weight</code> in pounds:
−
Alignment  is a value between -1000 and +1000, where  -1000  is
+
{| class="wikitable"
−
ultimate  evil, 0 is neutral and +1000 is ultimate good.  Good  is
+
! Weight !! up to 5 !! 6 to 40 !! 41 to 160 !! 161 to 500 !! over 500
−
per  definition any value from +1000..+350, neutral is  any  value
+
|-
−
from  +349..-349 and evil is any value from -350..-1000. Any value
+
| Size || tiny || small || medium || large || huge
−
in between can also be used.
+
|-
−
    alignment -750 /* Quite evil, maybe a Ghoul  */
+
| Roll counts || 50% || 60% || 70% || 80% || 100%
−
    alignment -350 /* Barely evil.               */
+
|}
 +
The default weight is 120 pounds, medium. A rat's bite should not hurt like a dragon's.
  
−
2.4  The Race (race)
+
== Other numbers ==
−
Each  monster has a race as specified in values.h. In  case  you
+
{| class="wikitable"
−
can’t  find  a race which matches your monster, just  use  #define
+
! Field !! Range !! What it does
−
RACE_XXX  in  you  own zonefile with a number that  isn’t  already
+
|-
−
used. We will then later transfer it to values.h. Example:
+
| <code>offensive</code>, <code>defensive</code> (or <code>ATTACK_DEFENSE(off, def)</code>) || -1000 to 1000, default 0 || Added to every attack the monster makes, and to its defence against every attack, in melee and against spells. 25 is about what not being able to see the opponent costs.
 +
|-
 +
| <code>speed</code> || 4 to 200, default 12 || Lower is faster. A monster at speed 6 gets two attacks a round, at speed 4 three. Slower than 12 doesn't give fewer attacks: as long as one blow fits in a round, it attacks every round, and once it doesn't fit (above speed 35 with a natural attack, 20 with a one-handed weapon, 16 with a two-handed one) it never attacks in melee. See [[Manual:Game Mechanics/Combat#Rounds|Combat]].
 +
|-
 +
| <code>alignment</code> || -1000 to 1000 || 350 and up is good, -350 and down evil. A good player gets 20% more experience for killing an evil monster, an evil one 10% more for a good monster; killing changes the killer's alignment.
 +
|-
 +
| <code>exp</code> || -500 to 499, default 100 || The experience the monster gives a single player of its own level, before the adjustments on [[Manual:Game Mechanics/Levels#Experience from a kill|Levels]]. 0 gives none; below 0 is a penalty for killing it.
 +
|-
 +
| <code>money</code> || || vmc warns, without stopping, when a monster carries more than its level's share: level &times; 5 iron pieces up to level 20, &times; 10 up to 100, &times; 15 up to 150, &times; 20 up to 200.
 +
|}
  
−
    race RACE_DRAGON_SILVER
+
== How much experience ==
 +
The default of 100 suits an ordinary monster. A monster that is harder to kill than its level shows, or more dangerous, should give more; one that is easier should give less. As a guide, add to 100:
 +
{| class="wikitable"
 +
! The monster !! Add
 +
|-
 +
| has a breath weapon || +50 (the dragon templates have <code>exp</code> 150 to 160)
 +
|-
 +
| has a dangerous fighting routine, such as fleeing to heal and coming back || +20 to +50
 +
|-
 +
| is poisonous: a player can die after the fight is won || +20
 +
|-
 +
| is invisible: players who can't see it can't attack it || +15
 +
|-
 +
| casts spells strong for its level || +10 to +30
 +
|-
 +
| hides || +10
 +
|-
 +
| ambushes players || +10
 +
|-
 +
| gets help from others, or is guarded by monsters that rescue it || +5 to +50
 +
|-
 +
| is aggressive || +5
 +
|-
 +
| sees invisible and is aggressive || +5
 +
|-
 +
| rescues others, and so gets into every fight || -5
 +
|-
 +
| leaves thieves alone (<code>NPC_NICE_THIEF</code>) || -5
 +
|-
 +
| is blind || -15
 +
|-
 +
| wields a weapon of a family it has no skill in || -50
 +
|}
 +
Don't add for the wands, scrolls or magic items a monster carries: the items are reward enough.
  
−
or if the race you need isn’t defined, you could type:
+
== Spells and breath ==
 +
A monster casts in combat with <code>combat_mag@function(attack_spell, defence_spell, percent, speed)</code> from <code>function.zon</code>: it casts the attack spell, and the defence spell (such as a heal) when its hit points fall below ''percent''; ''speed'' is how many rounds between spells, 1 to 5. Either spell can be <code>""</code> for none.
 +
<pre>
 +
dilcopy combat_mag@function("fireball", "heal", 25, 2);
 +
</pre>
 +
A spell is cast with the monster's magic or divine (whichever the spell uses), against the target's brain, and with its skill in the spell's sphere against the target's. Give a caster both: <code>MSET_ABILITY</code> with magic or divine, and <code>MSET_SPELL</code> with the sphere of its spells. Breath weapons are spells too ("acid breath", "fire breath", "frost breath", "gas breath", "light breath"...), and the dragon templates cast them with <code>combat_mag</code>.
  
−
    #define RACE_CRABMAN    7681 /* This is a large red crab man
+
Other behaviour comes from DIL in <code>function.zon</code> as well, for example <code>aggressive@function</code>, <code>teamwork@function</code> and <code>rescue@function</code>; the comment above each tells its arguments. The old specials <code>SFUN_COMBAT_MAGIC</code>, <code>SFUN_BREATH_WEAPON</code> and <code>SFUN_AGGRESSIVE</code> are gone.
−
*/
 
−
    race RACE_CRABMAN
 
  
−
Later  it  will  be inserted into values.h - and you  should  then
+
== Templates ==
−
remove your definition (you will get warnings at that time).
+
<code>macros.h</code> includes a large set of ready-made monsters: <code>mhumanoid.h</code> and <code>chumanoid.h</code> (people and children of every race and trade), <code>monster.h</code>, <code>fantasy.h</code>, <code>plant.h</code> and <code>aquatic.h</code> (animals, dragons, plants, sea creatures). Look at how they are made before making your own; most monsters in the public zones start from one. Most take a level and a sex, such as <code>M_DRAGON_BLACK_SMALL(level, sex)</code>, and set the race, abilities, skills, natural attack, behaviour and experience.
  
−
2.5  The gender (sex)
+
== Example: a black dragon ==
−
Each  monster has a gender: male, female or none, as specified  in
+
Made by hand, a female black dragon of level 30 with an acid breath:
−
values.h SEX_XXX macros. Example:
+
<pre>
−
    sex SEX_NEUTRAL
+
black_dragon
−
 
+
names {"black dragon", "dragon"}
−
2.6  Setting Abilities (ability[])
+
title "a black dragon"
−
All  abilities are in the range [1..200]. Players usually  have  a
+
descr "A black dragon lies here, watching you."
−
maximum of 150, modified by magic... 200 is considered divine.
+
race RACE_DRAGON_BLACK
−
When  creating a monster you can not directly specify the size  of
+
sex SEX_FEMALE
−
the  abilities, instead you specify a percentage distribution  of
+
level 30
−
points.  The amount of points are then distributed by the computer
+
height 625
−
according  to  the  specified level.  The  MSET_ABILITY  macro  is
+
weight 1250
−
available for this purpose, and has the format:
+
alignment -900
−
 
+
NATURAL_DEF(WPN_CLAW_MEDIUM, ARM_PLATE)
−
    MSET_ABILITY(str,dex,con,hpp,bra,cha,mag,div)
+
MSET_ABILITY(20,12,12,12,12,12,20,0)
−
 
+
MSET_WEAPON(10,10,10,5,30,5)
−
The  amount of points distributed depends directly upon the  level
+
MSET_SPELL(0,0,0,0,0,0,0,0,0,0,30)
−
of the monster and the percentage as the table below shows. If for
+
exp 150
−
example you create a monsters of level 30, then 20% will cause the
+
dilcopy combat_mag@function("acid breath", "", 25, 2);
−
monster to get a little above 30 points.
+
end
−
 
+
</pre>
−
Note that the sum of the ability values must be 100%. This is thus
+
* Height is in centimetres, weight in pounds. At 1,250 pounds she is huge: her claws use the whole roll.
−
an example of an ability distribution:
+
* The abilities add up to 100, with most in strength and magic; the weapons (70) and the spells (30) together add up to 100, with natural attacks and the acid (external) sphere first.
−
 
+
* <code>exp 150</code>: 100, and 50 for the breath weapon.
−
    MSET_ABILITY(25,15,10,15,10,5,10,0)  /* Sum is 100% */
+
The same from a template, which also makes her aggressive:
−
 
+
<pre>
−
2.6.1
+
young_dragon
−
 
+
names {"young black dragon", "black dragon", "dragon"}
−
Hints
+
title "a young black dragon"
−
If you choose high percentages and high levels, you may “waste”  a
+
descr "A young black dragon hisses at you."
−
ability  points as it would pop above 200 (all excess  points  are
+
M_DRAGON_BLACK_SMALL(30, SEX_FEMALE)
−
simply  removed). For example a level 199 monster with an  ability
+
end
−
percentage  a  bit above 20% will make an ability  above  the  200
+
</pre>
−
points maximum.
 
−
Do  not  spend  points on both MAG and DIV, only  the  appropriate
 
−
value  of  the  two  are  used. So magic  users  should  have  MAG
 
−
(fireball,  etc.) and clerics should have DIV (cure light  wounds,
 
−
etc.).
 
−
 
 
−
2.7  Setting Weapon and Spell skills (spell[], weapon[])
 
−
NPC's  know about weapons and spells but not at the same  detailed
 
−
level as  the  player. For NPC’s the spell and weapon  group  are
 
−
used.  Thus the “axe hammer category” defines all defence and  all
 
−
attack for all kind of axes and hammers - whereas the player would
 
−
have  to train individually in each axe and hammer type. The  same
 
−
is  true for spells. Thus if a monster has 25 points in the weapon
 
−
"sword  category" it will fight (and defend) with  all  sword-like
 
−
weapons at skill 25.
 
−
When  you  define weapon and spell skills (monsters have no  skill
 
−
skills)  you  also define these as percentages,  and  the  program
 
−
automatically distributes the points. Use the pre-defined macros:
 
−
 
 
−
      MSET_WEAPON(axe_ham, sword,  club_mace,  polearm,  unarmed,
 
−
special)
 
−
 
 
−
Where
 
−
    axe_ham  Is any hammer or axe weapon.
 
−
    sword          Is any sword like weapon, including dagger and
 
−
rapier, etc.
 
−
      club_mace  Is any club or mace like weapon, flails,  morning
 
−
star, etc.
 
−
              polearm    Is any flail or pole like weapon:  spear,
 
−
              staff, halberd, trident, sickle, scythe.
 
−
    unarmed  Is any bite, claw, sting or other natural attack.
 
−
    special  Is any very peculiar weapon, currently only whip.
 
−
 
 
−
      MSET_SPELL(div, pro, det, sum, cre, min, hea, col, cel, int,
 
−
ext)
 
−
 
 
−
Where
 
−
    div  Covers all divine sphere spell.
 
−
    pro  Covers all protection sphere spells.
 
−
    det  Covers all detection sphere spells.
 
−
    sum  Covers all summoning spells.
 
−
    cre  Covers all creation spells.
 
−
    min  Covers all mind spells.
 
−
    hea  Covers all heat spells (fireball, etc.)
 
−
    col  Covers all cold spells (frostball, etc.)
 
−
      cel  Covers all cell (electricity) spells (jolt,  lightning
 
−
bolt, etc.)
 
−
    int  Covers all internal (poison) spells (toxicate, etc.)
 
−
    ext  Covers all external (acid) spells (acid ball etc.)
 
−
See also values.h and wmacros.h.
 
−
The  sum of all spell and weapon skills must be 100%. For example,
 
−
the sum is 100%:
 
−
 
 
−
      MSET_WEAPON(10,10,20,5,15,5) /*  75%  Total,  Club/Mace  is
 
−
primary  */
 
−
      MSET_SPELL(8,0,0,3,0,3,2,3,3,3,3) /*  25%  Total,  Fire  is
 
−
primary        */
 
−
 
 
−
Remember that the groups define both attack and defence.  Thus  if
 
−
you  make  an Orc which has 0% in the flail group it can only  use
 
−
its  dexterity to defend itself. Likewise with spell  groups.  For
 
−
this  reason  the groups are both "resistance" as well  as  attack
 
−
groups.
 
−
 
 
−
2.8  Spell casting monsters
 
−
Some  monsters  are spell casting and spend a  lot  of  points  on
 
−
either  Magic  or  Divine power together with  brain.  To  make  a
 
−
monster  cast  spells  a number of various  special  routines  are
 
−
available, for example:
 
−
 
 
−
    special SFUN_COMBAT_MAGIC “cast acid ball”
 
−
    special SFUN_COMBAT_MAGIC_HEAL “cast random teleport”
 
−
 
 
−
This  would make a monster use the “acid ball” spell when  engaged
 
−
in  combat.  The monster would attempt to cast “random  teleport”
 
−
when  it  gets low on hitpoints. The following table  shows  which
 
−
spells a monster should use at a given level:
 
−
 
 
−
Level  Circle
 
−
0-14  1st    magic
 
−
      circle
 
−
15-34  2nd    magic
 
−
      circle
 
−
35-200 3rd    magic
 
−
      circle
 
−
 
 
−
For  example, a fireusing monster of level 20 would  use  the  2nd
 
−
circle  of  magic (the fireball spell) whereas a level  5  monster
 
−
would  use  the  burn spell. There are also special  routines  for
 
−
breathweapons  for  use  with for example  dragons.  See  monster
 
−
definitions in composed.h.
 
−
 
 
−
2.9  More or less Experience (exp)
 
−
By  default a monster gives the amount of experience it  is  worth
 
−
(which  depends  on the level of the monster).  If  you  create  a
 
−
particular powerful monster or a very weak monster, you  may  wish
 
−
to  raise  or lower the amount of experience given to the  player.
 
−
This  can  be  done  by  specifying  an  experience  percentage
 
−
modification.
 
−
You may want to modify the standard amount (of 0%) when you create
 
−
non-standard  monsters.  The default  amount  is  not  always  the
 
−
correct  amount,  for example an aggressive invisible  10th  level
 
−
dragon with breath weapon and spells, should give more exp than  a
 
−
blind, thieves-friendly dragon. The way I suggest you to calculate
 
−
the  monsters  experience  value should be  adding  the  following
 
−
amplifiers:
 
−
Note  that  if  the  monster is using wands,  scrolls,  staffs  or
 
−
magical  items this should not increase the exp amount, since  the
 
−
item value should be more than enough reward for the players!
 
−
See example application later in this document.
 
−
Amplifiers :
 
−
 
 
−
Ability / Skill  Bonus                  Examples
 
−
Breath weapon        +50  Usually a Dragon or Gorgon
 
−
Special fighting  +20..5  Example : The Evil Iggy remembers who
 
−
routine                0  he is fighting with. When he gets below
 
−
                          50% hits he casts "random teleport".
 
−
                          Later (when he has full hp) he summons
 
−
                          the player he has been fighting with
 
−
                          and THEN tries to kill the player. This
 
−
                          routine is highly dangerous for groups.
 
−
Low level monster  +10..3  A low level NPC has a special routine
 
−
casts                  0  SFUN_COMBAT_MAGIC or
 
−
high level spells          SFUN_COMBAT_MAGIC_HEAL where the spell
 
−
                          is a high level spell. Ex. a 1. level
 
−
                          wizard casts a "acid ball". This is up
 
−
                          to the creator to decide how tough the
 
−
                          monsters spell should be.
 
−
Monster stings        +20  Player can die even after a successful
 
−
(poison)                   kill
 
−
Monster is            +15  Players can not attack, and player's
 
−
invisible                  group will not be able to help, unless
 
−
                          they can see invisible
 
−
Monster is hiding    +10  A thief
 
−
Monster can see        +5  This is only dangerous if the monster
 
−
invisible                  is aggressive, and this amplifier
 
−
                          should only be used in such a case.
 
−
Monster is team    +5..+5  The guards helps the Captain and each
 
−
working                0  other.
 
−
Monster is being  +5..+3  The king is hard to kill, you have to
 
−
rescued                0  kill his lifeguards first.
 
−
Monster is            +5  Monster will hit first and increase
 
−
aggressive                chance of a kill
 
−
Monster is            +10  The monster is using the special
 
−
ambushing                  function SFUN_RAN_ATTACK
 
−
Monster have to        -5  The monster will always get into a
 
−
rescue                    fight, and the chance of being killed
 
−
                          is higher than the NPC it'll have to
 
−
                          rescue.
 
−
Monster is            -5  A usually stupid cleric etc.
 
−
friendly to
 
−
thieves
 
−
Blind                -15  A mole in daylight.
 
−
If weapon            -50  If a NPC is equipped with a weapon
 
−
category isn't            which isn't in a category he has
 
−
like wielded              practised.
 
−
weapon
 
−
 
 
−
 
 
−
2.10
 
−
 
 
−
Standard monsters in composed.h
 
−
The file composed.h contains many standard monsters. It is a good
 
−
idea  to  study these definitions, as they form the basis of  many
 
−
different  monsters. Note that the definitions  by  no  means  are
 
−
perfect, but  we  are hoping to make a more  or  less  “complete”
 
−
monster  compendium.  If  you create certain  (general)  monsters,
 
−
please design it as a macro so that it can be incorporated in  the
 
−
file. The more monsters created by using these macros the better a
 
−
place the game will be for the players.
 
−
 
 
−
2.11 Examples
 
−
The  following  is  an  example  of creating  different  types  of
 
−
monsters.
 
−
 
 
−
2.11.1    A Black Dragon
 
−
In  this example a black dragon is created. You should notice that
 
−
the  number  “121”  is the value of the SPL_ACIDBALL_3  definition
 
−
since  I  can’t  currently get it translated  inside  quotes.  The
 
−
following should at least be specified in your zone file.
 
−
 
 
−
    race RACE_DRAGON_BLACK
 
−
    sex SEX_FEMALE
 
−
    level 15
 
−
    height625                        /* In centimetres. 1 inch
 
−
== 2.54cm */
 
−
    weight    1250                        /* In pounds, 1 pound
 
−
= 0.45359kg    */
 
−
    NATURAL_DEF(WPN_CLAW, ARM_PLATE)
 
−
    exp 50                            /* Bonus for breath weapon
 
−
*/
 
−
          alignment      -900                      /*      Evil.
 
−
*/
 
−
      MSET_ABILITY(20,12,12,12,12,12,20,0)    /* Most STR and  MAG
 
−
*/
 
−
      MSET_WEAPON(10,10,10,5,30,5)       /*  Natural  is  above
 
−
average        */
 
−
      MSET_SPELL(0,0,0,0,0,0,0,0,0,0,30)      /*  Acid  sphere
 
−
(external)          */
 
−
    special SFUN_BREATH_WEAPON “”+SPL_ACIDBALL_3
 
−
 
 
−
Calculation of experience:
 
−
    Breath weapon      =  50%
 
−
                        ----------
 
−
    SUM                =  50%
 
−
 
 
−
The  same  dragon could have been created by using the macro  from
 
−
the file composed.h:
 
−
 
 
−
    M_DRAGON_BLACK(15, SEX_FEMALE)
 
−
 
 
−
2.11.2
 
−
 
 
−
A strong warrior
 
−
See  the composed.h macros - they contain definitions for a  great
 
−
variety of humans!
 
−
 
 
−
 
 
−
1.  In general when creating a warrior monster, Strength
 
−
determines amount of damage, Dexterity determines chance to
 
−
defend. Armour the amount of damage received. Constitution
 
−
determines hitpoint gain rate. Weapon skills ought to be high,
 
−
spell skills few, and only as 'resistance' against magic.
 

Latest revision as of 06:27, 15 November 2026

This page explains what a monster's numbers do and how to balance a monster against the players who will meet it. How to write monsters, their fields and the %reset commands that load them is in the Zone Manual, with the templates on NPC macros. The macros named here come with #include <macros.h>.

Level

A monster's level is 0 to 199; vmc refuses other values. Mortal players are level 1 to 50, though their virtual level goes on (see Levels). The level decides how many points the monster's abilities and weapon and spell skills get (below) and how much experience it gives:

  • 15% more for each level the monster is above the player (up to a cap, see Levels), 15% less for each level below; a monster seven levels below a player gives nothing;
  • in a group, a member more than five levels below the group's best loses 7% for each level beyond five.

So an area works best when its monsters span about ten levels: below that range they give no experience, above it they kill. A goblin camp for beginners might be level 1 to 8, an orc fortress 10 to 20.

Monsters above level 50 hit harder still: the roll of each blow and attack spell is multiplied by (level - 30) / 25 (roll_boost() in vme/src/fight.cpp), so a level 60 monster rolls 1.2 times as high, a level 100 one 2.8 times, a level 199 one 6.8 times. For levels 51 to 54 the factor is below 1 (0.84 at level 51), so those monsters roll lower than a level 50 one. Players are never above level 50, so this only works for monsters (and gods).

Abilities

A monster's abilities are given as percentages, not values: MSET_ABILITY(str, dex, con, hpp, bra, cha, mag, div). The eight must add up to 100, or vmc stops ("Abilities in '...' sums up to ..., and not 100"). Without it a monster has STR 40, DEX 30, CON 10, HPP 15, BRA 3, CHA 2.

vmc gives the monster 96 × level points and spends each ability's share of them (set_points() in vme/src/vmc/vmc_process.cpp). Points get dearer as they are bought: the first level + 1 points of an ability cost 10 each, the next level + 1 cost 20 each, and so on. A high percentage therefore gives less than its share:

Level 5% 10% 15% 20% 25% 30% 40% 50%
1 0 0 1 1 2 2 2 3
5 2 4 6 7 9 10 12 14
10 4 9 12 15 17 19 23 27
20 9 19 24 29 34 39 46 53
30 14 28 37 44 51 58 69 79
50 24 48 61 73 85 97 115 131
100 48 96 122 146 170 194 229 261
150 72 144 183 219 255 291 343 391
199 95 191 243 291 338 386 454 500

No value goes above 500: vmc cuts it there and warns "An ability is ... points". Spend nothing on both magic and divine: a monster's spells use only one of them (see Abilities). A warrior wants strength (damage), dexterity (defence) and hit points; a caster wants magic or divine, and brain to resist spells.

vmc -v prints the values it worked out, with the hit points in the HIT column:

                      STR  DEX  CON  HIT  BRA  CHA  MAG  DIV

black_dragon           44   32   32  106   32   32   44    0
young_dragon           51   28   28   94   44   28   37    0

(the two dragons in the example at the end of this page).

Hit points

A monster's hit points are 3 × HPP + 10; hit in the zone is ignored. With the HPP percentage:

Level 1 5 10 20 30 50 75 100 150 199
HPP 10% 10 22 37 67 94 154 226 298 442 583
HPP 15% (default) 13 28 46 82 121 193 286 376 559 739
HPP 20% 13 31 55 97 142 229 340 448 667 883
HPP 30% 16 40 67 127 184 301 448 592 883 1,168

Weapon and spell skills

A monster knows weapons and spells by family and sphere only: one value for all swords, one for all fire spells. MSET_WEAPON(axe_ham, sword, club_mace, pole, unarmed, special) and MSET_SPELL(div, pro, det, sum, cre, min, hea, col, cel, int, ext) give them as percentages, and the weapons and spells together must add up to 100 ("Spells&weapons in '...' sums up to ..."). The default is 100% unarmed. The families are:

Family Weapons
axe_ham axes and hammers
sword swords, daggers, rapiers
club_mace clubs, maces, flails, morning stars
pole quarterstaff, spear, halberd, bardiche, scythe, trident
unarmed fist, kick, claw, bite, sting, crush: all natural attacks
special whip, bow, crossbow, sling

The spheres are divine, protection, detection, summoning, creation, mind, heat (fire), cold, cell (electricity), internal (poison) and external (acid).

vmc gives the monster 120 × level points for them, bought the same way as abilities. A quarter of its best family becomes its skill in all weapons, and a quarter of its best sphere its skill in all spells. A monster attacks with its skill in the weapon's family, and defends against a weapon with half its skill in that weapon's family (or the quarter, if that is more). Spells work the same way: the spheres are both how well it casts and how well it resists. An orc with nothing in clubs fights badly with a club, and defends poorly against one: give a monster skill in what it wields and in what it will meet.

Natural attack and armour

NATURAL_DEF(weapon, armour) sets what the monster hits with when it wields no weapon, and what protects it where it wears no armour. The default is NATURAL_DEF(WPN_FIST, ARM_HLEATHER). vmc takes any weapon type numbered from WPN_FIST (34) to WPN_CRUSH (124) in vme/include/values.h; use a natural one: fist, kick, elbow, knee, claw, or one of the sized bites, stings, claws and crushes (WPN_BITE_SMALL, WPN_CLAW_LARGE...). WPN_CRUSH_LARGE and WPN_CRUSH_HUGE are above that range and refused. The armour is one of ARM_CLOTHES, ARM_LEATHER, ARM_HLEATHER, ARM_CHAIN and ARM_PLATE; it decides which column of the attacker's damage table is used (see Objects).

A natural attack hurts more the heavier the monster is: the roll is cut to a part of itself before the damage table, by the monster's weight in pounds:

Weight up to 5 6 to 40 41 to 160 161 to 500 over 500
Size tiny small medium large huge
Roll counts 50% 60% 70% 80% 100%

The default weight is 120 pounds, medium. A rat's bite should not hurt like a dragon's.

Other numbers

Field Range What it does
offensive, defensive (or ATTACK_DEFENSE(off, def)) -1000 to 1000, default 0 Added to every attack the monster makes, and to its defence against every attack, in melee and against spells. 25 is about what not being able to see the opponent costs.
speed 4 to 200, default 12 Lower is faster. A monster at speed 6 gets two attacks a round, at speed 4 three. Slower than 12 doesn't give fewer attacks: as long as one blow fits in a round, it attacks every round, and once it doesn't fit (above speed 35 with a natural attack, 20 with a one-handed weapon, 16 with a two-handed one) it never attacks in melee. See Combat.
alignment -1000 to 1000 350 and up is good, -350 and down evil. A good player gets 20% more experience for killing an evil monster, an evil one 10% more for a good monster; killing changes the killer's alignment.
exp -500 to 499, default 100 The experience the monster gives a single player of its own level, before the adjustments on Levels. 0 gives none; below 0 is a penalty for killing it.
money vmc warns, without stopping, when a monster carries more than its level's share: level × 5 iron pieces up to level 20, × 10 up to 100, × 15 up to 150, × 20 up to 200.

How much experience

The default of 100 suits an ordinary monster. A monster that is harder to kill than its level shows, or more dangerous, should give more; one that is easier should give less. As a guide, add to 100:

The monster Add
has a breath weapon +50 (the dragon templates have exp 150 to 160)
has a dangerous fighting routine, such as fleeing to heal and coming back +20 to +50
is poisonous: a player can die after the fight is won +20
is invisible: players who can't see it can't attack it +15
casts spells strong for its level +10 to +30
hides +10
ambushes players +10
gets help from others, or is guarded by monsters that rescue it +5 to +50
is aggressive +5
sees invisible and is aggressive +5
rescues others, and so gets into every fight -5
leaves thieves alone (NPC_NICE_THIEF) -5
is blind -15
wields a weapon of a family it has no skill in -50

Don't add for the wands, scrolls or magic items a monster carries: the items are reward enough.

Spells and breath

A monster casts in combat with combat_mag@function(attack_spell, defence_spell, percent, speed) from function.zon: it casts the attack spell, and the defence spell (such as a heal) when its hit points fall below percent; speed is how many rounds between spells, 1 to 5. Either spell can be "" for none.

dilcopy combat_mag@function("fireball", "heal", 25, 2);

A spell is cast with the monster's magic or divine (whichever the spell uses), against the target's brain, and with its skill in the spell's sphere against the target's. Give a caster both: MSET_ABILITY with magic or divine, and MSET_SPELL with the sphere of its spells. Breath weapons are spells too ("acid breath", "fire breath", "frost breath", "gas breath", "light breath"...), and the dragon templates cast them with combat_mag.

Other behaviour comes from DIL in function.zon as well, for example aggressive@function, teamwork@function and rescue@function; the comment above each tells its arguments. The old specials SFUN_COMBAT_MAGIC, SFUN_BREATH_WEAPON and SFUN_AGGRESSIVE are gone.

Templates

macros.h includes a large set of ready-made monsters: mhumanoid.h and chumanoid.h (people and children of every race and trade), monster.h, fantasy.h, plant.h and aquatic.h (animals, dragons, plants, sea creatures). Look at how they are made before making your own; most monsters in the public zones start from one. Most take a level and a sex, such as M_DRAGON_BLACK_SMALL(level, sex), and set the race, abilities, skills, natural attack, behaviour and experience.

Example: a black dragon

Made by hand, a female black dragon of level 30 with an acid breath:

black_dragon
names {"black dragon", "dragon"}
title "a black dragon"
descr "A black dragon lies here, watching you."
race RACE_DRAGON_BLACK
sex SEX_FEMALE
level 30
height 625
weight 1250
alignment -900
NATURAL_DEF(WPN_CLAW_MEDIUM, ARM_PLATE)
MSET_ABILITY(20,12,12,12,12,12,20,0)
MSET_WEAPON(10,10,10,5,30,5)
MSET_SPELL(0,0,0,0,0,0,0,0,0,0,30)
exp 150
dilcopy combat_mag@function("acid breath", "", 25, 2);
end
  • Height is in centimetres, weight in pounds. At 1,250 pounds she is huge: her claws use the whole roll.
  • The abilities add up to 100, with most in strength and magic; the weapons (70) and the spells (30) together add up to 100, with natural attacks and the acid (external) sphere first.
  • exp 150: 100, and 50 for the breath weapon.

The same from a template, which also makes her aggressive:

young_dragon
names {"young black dragon", "black dragon", "dragon"}
title "a young black dragon"
descr "A young black dragon hisses at you."
M_DRAGON_BLACK_SMALL(30, SEX_FEMALE)
end