The Dystopian OLC guide
The command 'medit' allows the builder to enter medit mode.

Syntax medit [create] (vnum)

The create flag is only used when creating a new mob. By default medit will call the show command, displaying the stats of the mob.


Name:        [warlord]
Area:        [   59] Jobo's Hell
Act:         [npc]
Vnum:        [30120]
Sex:         [male]
Level:       [2499]
Align:       [-1000]
Affected by: [sanctuary]
v0: Toughness         [  45]
v1: Damage Modifier   [   3]
v2: Extra Attacks     [  15]
Attack     : [Slash]
Spec fun:    [spec_warlord]
Short descr: The Warlord
Long descr:
The Warlord is standing here.
Description:
This is one mean bastard, better not
get to close to him, he might do
something nasty to you
Name
Is the keywords for the given mob.
Level
The power of the mob
Affected by
Different spells affecting the mob
Short/Long
Combat and Room description of the mob
Description
The description of the mob when looked at.
v0-v2
Combat modifiers
Attack
The mobs natural attack style

There are several commands available in medit mode, heres a description.

Command Description
show Will list the mob like in the table above
create Will create a new mob (takes a vnum as argument)
name Is used to set the keywords of the mob
short Is used to change the combat/chat name of the mob
long Is used to change the room description of the mob
v0-v2 Changes the combat parameters of the mob
shop/quest/spec Adds a special program to the mob
level Sets the level (power) of the mob
weapon Sets the mobs natural attack type
? Information about flags (example '? act' will list all act flags)
alignment Changes the alignment of the mob
done Leaves medit mode

The following is an example on how to use medit on mob 4001.

OLC> medit 4001                - open mob vnum 4001 for editing.
OLC> name dragon black         - change its keyword to 'black dragon`.
OLC> short A Black Dragon      - change its brief description to the same.
OLC> v2 4                      - give it 4 extra attacks.
OLC> align good                - change its alignment to good.
OLC> done                      - save changed and leave medit mode.

Combat Parameters

Value 0
This is the toughness of the mob, and values from -100 to 100 is valid

If the value is > 0, then the damage taken is reduced by a percent equal to the value. Example, should some mob with a v0 of 45 be struck by a 1000 damage attack, then it would only take 550 points of damage (it has 45% toughness).

If the value is < 0, then the mob takes additional damage from attacks.

Value 1
Damage Modifier, valid values are 1 to 3.

The damage dealt by the mob is multiplied by this number, so if you set it to 2, then it will deal double damage.

Value 2
Extra Attacks, valid range is 0 to 20

This value simple increases the amount of attacks the mob has each round.

Level
The power of the mob

This value will increase hitroll/damroll/hitpoints/attacks/dodge/parry of the mob.

Mob Flags

Mobiles have two flag types, which can be toggled on/off by typing the name of the flag in medit mode. Act flags and Affected_by flags.

Act Flags

Flag Description Flag Description
Sentinel The mob stays in the room where it was reset. Scavenger The mob will pick things up.
Agressive The mob will attack anyone entering it's room. Stay_area The mob will not leave the area to which it belongs.
Wimpy The mob will flee when hurt. Pet This is NOT used.
No_parts The mob will not lose any bodyparts. No_autokill The mob cannot be killed by assissinate and other one_hit kills.
No_exp The mob gives no experience when killed.

Affected_by Flags

Flag Description Flag Description
Blind The mob starts the game blinded. Invisible The mob is invisble.
Detect-Evil The mob can sense the presence of evil beings. Detect-Invis The mob can see invisble objects/people.
Detect-Magic The mob can see all things magical. Detect-Hidden The mob can see hidden people.
Shadowplane The mob can see into the shadowplane. Sanctuary The mob starts with the sanctuary spell.
Faerie-Fire The mob starts illuminated by faerie fire. Infrared The mob can see in the dark.
Ethereal The mob starts the game as a ghostlike being. Sneak The mob doens't make any sounds when it moves.
Curse The mob starts the game with the curse spell. Flaming The mob is on flames.
Poison The mob is sick with poison. Protect The mob is protected from evil.
Hide The mob is hidden. Sleep The mob starts with the sleep spell.
Charm Do NOT set this. Flying The mob is flying in the air.
Pass-Door The mob can walk through closed doors. Shadowsight The mob can see into the shadowplane
Web The mob starts the game webbed. Drowfire The mob stars the game illuminated by drowfire.
Peace The mob is protected from attacks. Infirmity The mob is horrible sick.

Combat Programs

A mob can have a special combat program attached to it, this doesn't mean every single mob should have a program, but rather special mobs, which have a reason (perhaps the leaders of an area), could have a set of combat powers, which they can use when needed.

The special programs used for this, is the same programs that are used to automate mob actions, like walking around, talking, picking up stuff, etc. So the part of the program that handles combat, must be easy to find for the mud, here is an example of a simple combat program.

bool spec_monk(CHAR_DATA *ch, char *argument)
{
  if (!str_cmp(argument, "update"))
  {
    return FALSE;
  }
  else if (!str_cmp(argument, "midround"))
  {
    CHAR_DATA *victim;
        
    if ((victim = ch->fighting) != NULL)
    {
      one_hit(ch, victim, gsn_bladespin, 0);
      one_hit(ch, victim, gsn_bladespin, 0);
    }
    return TRUE;
  }
  else return FALSE;
}

Basicly this small program will do nothing when it is called in the update part (update) of the code, but when called from combat (midround), then it will strike the player the mob is fighting with two bladespins. Of course one could make more complicated programs, allowing the mob to cast spells, regenerate, flee, etc.

To attach a special program to a mob, one simply types (if the name of the program is spec_monk) 'spec spec_monk', while being in redit mode of course. The command '? spec' will give a list of valid specs to use.

Shop Programs

A mob can run a shop, when a mob is given a shop spec, it can no longer be attacked by players, nor can it be targetted by powers that transfer items to the mob (transport spell, give command, etc).

To set a shop program on a mob, one uses the command 'shop' command in medit mode, which works just like the spec command for special combat programs mentioned above.

The most common shop program is the generic shop, which allows the shopkeeper to sell the items in it's inventory (it never runs out of items though) at a qps cost.

More interesting programs can be made, as long as the two commands 'list' and 'buy' will work with the program (other shopping commands can be made, but those two must always be present).

This is how the generic shop program works.

void shopspec_generic(CHAR_DATA *keeper, CHAR_DATA *ch, char *argument)
{
  char arg[MAX_INPUT_LENGTH];
  char item[MAX_INPUT_LENGTH];
  char buf[MAX_STRING_LENGTH];
  OBJ_DATA *obj;
        
  argument = one_argument(argument, arg);
  one_argument(argument, item);
           
  if (!str_cmp(arg, "list"))
  {
    if (!keeper->carrying)
    {
      do_say(keeper, "I'm afraid I'm not selling anything right now");  
      return;
    }
    else
    {
      do_say(keeper, "Take a look at my goods");
      send_to_char("\n\r", ch);
      for (obj = keeper->carrying; obj; obj = obj->next_content)
      {
        sprintf(buf, " * %-32s   %4d\n\r", obj->short_descr, obj->cost);
        send_to_char(buf, ch);
      }
      return;
    }
  }
  else if (!str_cmp(arg, "buy"))
  {
    if (!keeper->carrying)
    {
      do_say(keeper, "I'm afraid I'm not selling anything right now");
      return;
    }   
    else
    {
      for (obj = keeper->carrying; obj; obj = obj->next_content)
      {
        if (is_full_name(item, obj->name))
        {
          if (ch->pcdata->quest < obj->cost)
          {
            do_say(keeper, "You cannot afford that item");
            return;
          }
          else ch->pcdata->quest -= obj->cost;
          obj = create_object(get_obj_index(obj->pIndexData->vnum), 50);
          obj_to_char(obj, ch);
          do_say(keeper, "Nice doing buisness with you");
          return;
        }
      }
      do_say(keeper, "I'm afraid I'm not selling that");
      return;
    }  
  }
  else do_say(keeper, "I'm afraid I don't understand");
}

As you can see, this program only takes two different arguments, namely the two simple commands 'buy' and 'list', which will allow players to see what the shopkeeper is selling (and at what price), and allow the player to buy items from the shopkeeper.

Quest Programs

Quest programs are the most restricted of the programs that can be attached to mobs. Just like before, the command used is 'quest' in redit mode and valid quest programs can be shown with the '? quest' command.

A quest is defined by 7 numbers.

Type : this is the type of quest, and can be one of the following

  • QT_MOB : Kill a single mob
  • QT_OBJ : Retrieve a single item
  • QT_MOB_AND_OBJ : Kill a mob and retrieve an item
  • QT_MASS_KILL : Kill a series of mobs which are somehow connected
  • QT_PK : Kill a given player

    Giver : This is the vnum of the questmaster that gave the quest
    Time : This is the amount of mudhours the player has to complete the quest
    vnums 1-4 : These four vnums are used to define the quest

    A questprogram must consist of a gain part and a complete part.

    This is an example of a simple QT_MOB_AND_OBJ program.

    void questspec_mob_and_item(CHAR_DATA *questmaster, CHAR_DATA *ch, char *argument)
    {
      if (!str_cmp(argument, "gain"))
      {
        QUEST_DATA new_quest;
               
        do_say(questmaster, "Please slay this monster and retrive this item for me!");
        new_quest.type      = QT_MOB_AND_OBJ;
        new_quest.time      = 25;
        new_quest.giver     = questmaster->pIndexData->vnum;
        new_quest.vnums[0]  = get_rand_mob();  // this function gets a random item.
        new_quest.vnums[1]  = get_rand_item(); // this function gets a random mob.
        quest_to_char(ch, &new_quest);
        return;
      }
      else if (!str_cmp(argument, "complete"))
      {
        int value = 90;
    
        give_token(questmaster, ch, value);  // this functions gives the player a qps token.
        do_say(questmaster, "Thanks for solving my quest, come back again if you want.");
        return;
      }
    }
    

    Any quest program need only consist of those two parts. One to give out the quest, and another to give the reward for completing the quest. This simple example just gives a quest token, but basicly any kind of prize can be given.