Mobile Special Procedures
Special procedures are added in a manner similar to mob speech.
<SPECIAL>
<procedure_name> <probability> <terminator bit> <special number>
</SPECIAL>
The procedure name is taken from one of the procedures below, with a short description.
Probability is the percentage chance that the procedure will trigger, either per command/combat round (for normal procedures), or each time the mob receives damage (for combat procedures).
The terminator bit, if set to 1, halts the handling of further procedures if the current procedure triggers.
The special number is used by certain procedures to handle operation, and will be listed in each procedure.
Normal Procedures:
Below is a list of the special procedures available. Please note that MOB_DEFENDER will require additional code to be implemented before it will work with your mob.
ARMY
This procedure causes the mob to initiate a fight by going berserk if a certain number of non-Immortal players are in the room. The special number is used to determine the maximum number of allowed players before the procedure fires; a value of 0 indicates the default of the mob level divided by 4, rounded down to the integer. For example, a value of 4 would cause trigger with 5 people in the room.
ASSIST_MOB, ASSIST_PLAYER
The mob will assist either mobs, or players, regardless of alignment (unlike the GUARD flag, which checks for alignment). The special number is unused for ASSIST_PLAYER, and should be set to 0. For ASSIST_MOB, the special number is the mob to be assisted. For example, a mob that would assist Siawyn (mob vnum 4448) would have ‘ASSIST_MOB 100 1 4448’.
CASTLE_GUARD
CLEANING
COWARD
The mob will flee while under attack, if under the special number value percentage of hit points. Useful for memory mobs or to really annoy rangers. Note that setting the special number too high will cause the mob to flee constantly, and a value of 0 is the same as a value of 100.
DISTANCE_DAM
A mob with this procedure will damage players outside of the room, such as the dragons’ breath weapons, Sagittarius’ arrows, and so on. Usage is ‘DISTANCE_DAM 100 0 0’.
DRAIN_MANA_ON_DEATH, EXPLODE_ON_DEATH, GAIN_EXP_ON_DEATH
The mob will either drain the mana of, explode on, or grant additional experience to the person striking the killing blow. The special number is the amount of mana drain, explosion damage, or experience gained. For example, a mob that would do 100 damage when it was killed, would have ‘EXPLODE_ON_DEATH 100 1 100’.
ENTROPY_RANDOM, ENTROPY_TANK
The mob will ‘entropy’ players fighting it, removing all spell affects and inflict damage. ENTROPY_TANK affects only the player the mob is hitting, while ENTROPY_RANDOM will has a chance of being inflicted upon anyone that is attacking the mob.
GATE_IN_MOB
The mob will load a mob in the room it is in during combat. The special number is the vnum of the mob to be loaded. So, if a mob was sick of being picked on and wanted to bring everyone’s favorite cuddly little nameless horror every few rounds to play, too, it would have ‘GATE_IN_MOB 33 1 18004’.
GEN_BLOCK_(Direction)
This procedure causes the mob to block off players and mobs in the direction listed. The directions are listed in the shorthand format (n, e, s, w, u, d, ne, nw, se, sw). Mobs with this procedure can be used to block parts of areas (as in Rhyoden or Ravenna), or block off areas that are being used for quests (such as the ‘quest’ mobs).
HATES_CLERIC, HATES_MAGE
This procedure manifests itself as the acid breath that certain mobs spit onto clerics and mages, as well as the word of death thrown back at mages by some mobs. The special number is unused.
HEALER
The mob with this procedure will heal players low on hit points. An example of this is the Obi-Wan statue in Midgaard. Usage is ‘HEALER 100 0 0’.
HELL_NYMPH
This procedure causes the mob to check if players in a room are affected by spells, ‘unaffect’ them (removing all the affectations), and then the mob self-purges, disappearing from the room.
LOAD_ITEM_ON_DEATH, LOAD_MOB_ON_DEATH
The mob will load either an item or a mob when killed. The special number is the vnum of the mob or object to be loaded. This can be used to load items that you do not wish to be stolen, located, or viewed in inventory, or to cause another mob to show up to ‘avenge’ the death of the first.
but see,
jedimud.proboards25.com/index.cgi?board=ZoneDiscussion&action=display&thread=396MASTER_PROC
The mob with the master procedure will heal mobs with the slave procedure in the same room.
MOB_AREA_ATTACK
The mob will use area attack spells, such as ice storm, meteor swarm, and so on during combat. The special number is not used.
MOB_CLERIC
The mob will use clerical spells in combat, such as sanctuary, heal, dispel good/evil, harm, and petrification. The level of the mob will determine the spells cast.
MOB_CRYO
The mob acts as a cryogenecist.
MOB_DEFENDER
This procedure is now mostly defunct, having been split into several of the other procedures. It requires special coding for each mob, and is used to change the procedures that mobs will have when certain items (such as Jupiter’s Lightningbolt or the Mark IV Phaser Rifle) are loaded. Speak with an implementor prior to setting this procedure.
MOB_DEMON
MOB_ENERGY_DRAIN
MOB_MAGE
The mob will use mage spells in combat, such as color spray, burning hands, chill touch, shocking grasp, fireball, and disintegrate.
MOB_NINJA
The mob will kick, hurl, stun, and eagle claw while in combat.
MOB_SNAKE
The mob will ‘bite’ players, usually causing a poisonous effect.
MOB_THIEF
The mob will steal gold from players in the same room.
MOB_USE_HELD
MOB_WARRIOR
The mob will kick, bash, pummel, pound, and grapple in combat with players and mobs.
PLAGUE
The mob will infect the player with a fatal disease, causing a rapid loss of hit points until restore is cast upon the player or until the player dies.
PURGE_PET
The mob will purge mobiles that are fighting it, causing all equipment carried by them to fall to the ground. If the mob level is greater than 30, it will instead be ‘slammed against the wall’ or thrown out of the room, thus stopping the fight.
SLAVE_PROC
The slave mob will rescue a master mob, whose vnum is the special number of the procedure. For example, a mob that rescued those cuddly little horrors would have ‘SLAVE_PROC 100 0 18004’. If the horror had a MASTER_PROC, it would then heal the slave mobs that rescued it.
UNAFFECTS_SELF
The mob will unaffect itself when harmful spell effects are present, such as slow, fumble, blind, or poison. An example of a mob with this proc would be Jupiter, on the mountaintop in Rome.
VAMPIRE
WRAITH
Combat Procedures:
The combat procedures deal almost entirely with how the mob takes damage from certain types, for example, taking extra damage from fire and being immune to cold. Once again, you must pay attention to the order in which these are processed, since damage gets passed through the procedures in order. Examples will follow to clarify how this can complicate things.
CAP_(Damage Type)
This procedure caps the damage taken from the specified damage type to a certain maximum value. The special number is the maximum amount of damage that the mob will take, after sanctuary, from the specified attack type.
HEAL_FROM_(Damage Type)
This procedure is used for mobs which heal from certain types of damage, such as using fire on a fire elemental. The special number is the percentage of damage healed from the attack. Note that this procedure will also cap damage to 0 from that damage type.
REDUCE_(Damage Type)
This procedure is used to modify the damage taken by a mob from the damage type. The special number is the percentage that the damage is reduced by, and the number can be negative (to increase damage).
REFLECT_(Damage Type)
This procedure reflects damage back at the attacker. The special number is a percentage of the damage taken by the mob which is redirected back to the attacker, in some retaliatory strike. Note that the damage reflected back onto the attacker bypasses sanctuary, orb, and other protective spells, but it cannot kill the attacker all by itself.
REFLECT_MANA_(Damage Type)
This procedure works like the REFLECT_ procedure listed above, however, instead of reducing hit points, it will reduce mana instead.
RESIST_(Damage Type)
This procedure reduces the damage taken by the mob by a specified amount, instead of a percentage - for example, a mob that takes 20 less damage from spells. The special number is the amount that the damage is reduced by.
Damage Types
Some of the procedures above list a damage type (ex: REFLECT_, HEAL_FROM_, etc.). For these procedures, the following damage types are listed, with examples of what is covered by them. Note when listing these procedures, they are handled in order listed by the code, and so the most general should be listed last, while the more limiting procedures are listed earlier with terminator bits to keep them from interfering (samples are below to explain better).
Damage Type
Affected damage
BACKSTAB
Backstab and Circle damage
COLD
Chill Touch, Ice Storm
COMBAT_NORMAL
All weapon types
COMBAT_PROC
Kick, Bash, Punch, Pummel, Berserk, Hurl, Stun Touch, Iron Fist, Eagle Claw, BACKSTAB
EARTH
Disintegrate, Earthquake, Meteor Swarm, Petrification
ELECTRIC
Call Lightning, Energy Drain, Lightning Bolt, Shocking Grasp
FIRE
Burning Hands, Fireblast, Fireball, Flamestrike
NUKE
Fission Bomb, Atomic Blast, Thermonuclear Holocaust
PSIONIC
Choking Claw, Brain Implosion, Searing Gaze, Force Lightning
DIVINE
Dispel Evil/Good, Cause Light/Serious/Critic, Harm
MAGIC
Color Spray, Magic Missile, Slay, Word of Death, COLD, FIRE, EARTH, ELECTRIC, NUKE, and PSIONIC
PHYSICAL
Any COMBAT_NORMAL or COMBAT_PROC
Special Procedure Examples:
Some examples to help illustrate how the combat procedures interact with each other, and the important of order when writing them, follow:
For a mob that takes double damage from fire, half damage from cold and electricity, and is immune to other magical attacks, you may see the following:
<SPECIAL>
RESIST_FIRE 100 1 -100
RESIST_COLD 100 1 50
RESIST_ELECTRIC 100 1 50
RESIST_MAGIC 100 1 100
</SPECIAL>
In order, this list of procedures checks to see if it is fire damage, and if so it reduces it by -100% (doubling it). If it was fire damage, it then stops. If it was cold or electricity, it reduces the damage by 50% (halving it). Then, if either of those procedures worked, it will stop. After all of this, it reduces all other magical based attacks by 100%. Note that if the terminator bit was not set in the first three, the mob would take no damage from the attacks, since MAGIC covers FIRE, COLD, and ELECTRIC, and the last procedure would effectively cancel the others out. If the RESIST_MAGIC came first, the same would also happen, with or without the terminator bit set.
You can see from the above example how the terminator bit could cause problems if ignored and the general damage types (MAGIC and PHYSICAL) should come after the specific types for most purposes. The following list of procedures is an example of how NOT to set up mob procedures:
<SPECIAL>
REFLECT_PHYSICAL 100 0 50
HEAL_FROM_PHYSICAL 100 1 100
REFLECT_MANA_MAGIC 100 0 100
REFLECT_MAGIC 100 0 50
CAP_MAGIC 100 1 0
</SPECIAL>
Again, please do not use this combination of procedures. It is an example and used to illustrate how order can effect the procedures. This mob reflects all non-psionic, non-divine damage back upon the attacker, reflecting spell damage on the caster’s mana as well as hit points. Half of the damage the mob takes (after sanctuary) is reflected back on the attackers hit points, and afterwards, the mob either heals (from physical damage) or ignores the damage (by capping magical damage to 0). So, if a warrior hits the mob for 40 points of damage, the player will take 20, and the mob will gain 40 hit points. If a mage casts a Word of Death spell that does 500 damage, 250 damage will reflect back upon the mage, the mob will take 0 damage (due to the cap), and it will cost 650 mana (150 to cast the word of death, plus 500 for the reflected damage to the mana).
However, if you were to put the CAP_MAGIC in front of the reflects, terminator bit set or not, it would negate the other procedures, since the damage reflected would already be reduced to 0. Since the HEAL_FROM procedure also caps damage to 0, placing it before the reflection would negate it as well. Now admittedly, the mob would still be difficult to damage, but the overall pain of the procedures is greatly reduced by the arrangement.