Area Building

· Home
· Overview
· Helps
· Mobiles
· Objects
· Rooms
· Resets

· Shops
· Specials
· Time
· Weather
· Scripts


This file is a short manual on how to write the SPECIALS section for Mirkwood (ROM 2.3).

-Tomasin


For the most part, this doc was stripped from Ozymandias' ozy.doc. There were a few changes, however. (Room special functions some mob spec functions have been modified)

Like the #RESETS section, the #SPECIALS section has one command per line.

This section defines special functions (spec-fun's) for mobiles. A spec-fun is a C function which gives additional behavior to all mobiles with a given vnum, such as the peripatetic mayor, the beholder casting spells in combat, Tiamat the dragon breathing her breath weapons in combat, and the Grand Mistress teleporting characters she is fighting.

The format of the command:

M <mobile-vnum> <spec-fun>

The 'M' command assigns 'spec-fun' to all mobiles of that vnum. An 'M' line may have a comment at the end. ALL MOBS of the vnum will have the function.

The section ends with an 'S'.


Every three seconds, the server function 'mobile_update' examines every mobile in the game. If the mobile has an associated spec- fun, then 'mobile_update' calls that spec=fun with a single parameter, the 'ch' pointer for that mob. The spec-fun returns TRUE if the mobile did something, or FALSE if it did not. If the spec-fun returns TRUE, then further activity by that mobile is suppressed. All this just basically means that the game checks periodically for mobiles with spec-fun's and causes them to act out their assigned functions, either while wandering about Midgaard and locking the gates, as the mayor does, or while in combat and casting spells and breath weapons, as Tiamat, or the Beholder do.

For this help file, I am not including material on how to add a NEW special function to the code. That information can be found elsewhere, and needs to be coded by the IMP into the 'C' code itself. However, below you can see how to use ALREADY existing spec-funs for your mobiles. I have also provided a listing of the spec-funs available in the game so far.

**NOTE: As spec_fun's DO add (much more than other things) to lag in the game, try NOT to OVER DO IT. Feel free to use a #SPECIALS section, but don't make 100 different dragon or spell-casting type mobiles each with special functions!

Example of #SPECIALS, as found in midgaard.are area file:

#SPECIALS
* for some of the midgaard mobs
M  3000  spec_cast_mage
M  3005  spec_thief
M  3011  spec_executioner
M  3012  spec_cast_adept
M  3020  spec_cast_mage
M  3060  spec_guard
M  3061  spec_janitor
M  3062  spec_fido
M  3143  spec_mayor
S
Explanation:
#SPECIALS           <--- this begins the #SPECIALS section
M  3000  spec_cast_mage    <--- Midgaard's wizard
M  3005  spec_thief        <--- the thief
M  3011  spec_executioner  <--- Hassan
M  3012  spec_cast_adept   <--- the Healer
M  3020  spec_cast_mage    <--- the Mage Guildmaster
M  3060  spec_guard        <--- cityguard
M  3061  spec_janitor      <--- the janitor
M  3062  spec_fido         <--- the fido
M  3143  spec_mayor        <--- Midgaard's Mayor
S

=== List of SPEC-FUN's found in the Mirkwood code:
The spec_breath's are just that. Breath weapons, such as found with most dragons, many of the gods in Olympus, etc.


The spec_cast's give mobiles the abilities to cast spells, depending on which spec_cast you use. To satisfy your own curiosity, I am including a listing of what each spec_cast type will cast, depending on the level of the mobile.

spec_cast_adept spells:

 The spec_cast_adept mobile will cast the following spells at random on all characters in the same room, up to characters of level 10 or less (this may have been changed; but this was correct with the Rom2 code):

     
  • armor
  • bless
  • cure blindness
  • cure light
  • cure poison
  • refresh
spec_cast_cleric spells:

 The spells cast depend on the level of the mobile with this special function. (Thus, if you wish to have a cleric-spell casting mobile that can cast 'curse', make the mobile at least level 12). The following can be cast by this spec-fun:

     
  • blindness - min. lvl. 0
  • cause serious - min. lvl. 3
  • earthquake - min. lvl. 7
  • cause critical - min. lvl. 9
  • dispel evil/good - min. lvl. 10
  • curse - min. lvl. 12
  • change sex - min. lvl. 12
  • flamestrike - min. lvl. 13
  • harm - min. lvl. 15
  • plague - min. lvl. 15
  • demonfire/exorcise - min. lvl 25
  • dispel magic - min. lvl. 16
spec_cast_judge:

 This spec-fun is geared mainly for the Judge mobile in Megacity One. The only spell cast by this spec-fun is 'high explosive'.

spec_cast_mage:

 The spells cast depend on the level of the mobile with this special function. The following can be cast by this spec-fun:

     
  • blindness - min. lvl. 0
  • chill touch - min. lvl. 3
  • weaken - min. lvl. 7
  • teleport - min. lvl. 8
  • colour spray - min. lvl. 11
  • change sex - min. lvl. 12
  • lightning bolt - min. lvl. 13
  • fireball - min. lvl. 15
  • plague - min. lvl. 20
  • acid blast - min. lvl. 20
spec_cast_undead:

 The spells cast depend on the level of the mobile with this special function. The following can be cast by this spec-fun:

     
  • curse - min. lvl. 0
  • weaken - min. lvl. 3
  • chill touch - min. lvl. 6
  • blindness - min. lvl. 9
  • poison - min. lvl. 12
  • energy drain - min. lvl. 15
  • harm - min. lvl. 18
  • plague - min. lvl. 20
  • teleport - min. lvl. 21
spec_cast_warlock:

 The spells cast depend on the level of the mobile with this special function. The following can be cast by this spec-fun:

  • blizzard - min. lvl. 60
  • weaken - min. lvl. 7
  • prismatic spray- min. lvl. 70
  • acid blast- min. lvl. 20
  • ray of enfeeblement- min. lvl. 45
  • fireball - min. lvl. 20
  • dispel magic- min. lvl. 18

As far as the other spec-fun's go, here is a rough breakdown, just to give you and idea what each does:

spec_fun_executioner:

 This spec-fun is more useful if you have player stealing and player killing capabilities in the mud. The mobile with this special- function will attack any player, including an immortal, with a KILLER, or THIEF flag. Additionally, this mobile can 'create' additional cityguards in the room to assist his fight against the player.

spec_fun_puff:

 This amusing special function, written by Seth, of Rivers of Mud, does a number of very silly things, most of which you are probably familiar and therefore I won't go into detail. Don't bother using it.

spec_fun_fido:

 This is a spec-fun customized for the fido mobiles of Midgaard. All it really does is cause the mobile to eat any corpse it may see lying in the room with it; players in the room will witness this in the form of "<mobile-name> savagely devours a corpse."

spec_fun_guard:

 This special-function acts in some ways like the spec_fun_executioner. It causes the mobile to attack characters automatically that have the KILLER or THIEF flags, if player stealing and player killing is allowed in the mud. Also, the spec_fun_guard will intervene in a fight, assisting the 'most evil' of the fighters, alignment-wise. This means that a good character fighting an evil mob will often be joined in his/her/it's fight by the spec_fun_guard mobile, and visa-versa for an evil character attacking good mobiles in the presence of a spec_fun_guard mobile. This assisting is always accompanied by the mobile yelling "PROTECT THE INNOCENT!! BANZAI!!"

spec_fun_janitor:

 This spec-fun causes the mobile to pick up "trash" (objects that are either ITEM_DRINK_CON, or ITEM_TRASH on the ground in the same room as the mobile).

spec_fun_mayor:

 This is geared originally for the mayor of Midgaard. It adds a bit of humor and personality to the charismatic mayor. Basically, the mobile with this special function wanders around, making comments such as "Vandals! Youngsters have no respect for anything!", and other statements, as well as going to sleep, waking up, touring Midgaard, and opening and closing the gates of Midgaard at various times.

spec_fun_poison:

 A mobile with the spec_fun_poison will, when fighting a player, 'bite' the player, and thus poisoning him with a 'poison spell'. This is a good spec-fun to give to poison snakes, etc., or any other mobile that might have a poison bite.

spec_fun_thief:

 This spec-fun causes the mobile to "steal" money from a player in the same room as the mobile. The player also receives a "You discover <mobile-name>'s hand's in your wallet!" when this happens to the him/her/it.

spec_knight1

This spec causes the mob to perform random skills from the following list:

  • kick - min level 0
  • trip - min level 10
  • disarm - min level 15
  • bash - min level 20
  • whirlwind - min level 35
  • lunge - min level 30

spec_knight2

This spec causes the mob to perform random skills from the following list:

  • bash - min level 10
  • whirlwind - min level 50
  • lunge - min level 35

spec_hero_quest

This spec causes the mob to perform random skills and cast random spells from the following list:

  • blizzard
  • ray of enfeeblement
  • prismatic spray
  • wind hammer
  • whirlwind


Mirkwood also has special functions for rooms. This function is called when a character enters the room (via walking, gate, portal, immortal transfer, goto, anything). Again, these functions must be written by Tomasin. Effects can be wide ranging.

The format for this command is:

R <room-vnum> <spec_enter_fun>

Currently only 1 'general' room enter function exists:

spec_pit_trap

 This function does 50 points of damage (pre sanc calculation), unless the character is flying.


Areas may also have special functions. These functions are called at update ticks. These functions are written by Tomasin.

The format for this command is

A <spec_area_fun>

The hurricane in the Ocean is an example of an area function.


Rooms may now have 'act' functions.. functions that are called every time a character or mobile does something in the room.

The format for this command is

C <room-vnum> <spec_act_fun>