home » builders » builder's lessons » mobile, object and room programs

Mobile, object and room programs

Otherwise known as mob progs, these programs are used to give life to your mobiles and your area in general. In the lessons to follow is a lesson for each type of program we have available for use on Forgotten Kingdoms. Many of the samples with real programs from the game. We will never release a whole area for download, but we will release parts to aid builders to learn how to code mob progs.

This particular lesson is not a lesson in how to write programs. This is a listing of what programs are available and a brief explanation of what they do. We will link to a lesson for each mud program type to give more detail on how to use them in your area.

Some programs will only work on mobiles, others only on objects and so on. The following tables list which programs will work for each of the three things that programs can be placed on, mobiles, objects and rooms.

Progs that work on mobiles

The following is a list of programs that will work on mobiles.

Trigger Triggering Variable Explanation
act_prog keyword / phrase Works for emotes socials actions bamfs
speech_prog keyword / phrase Works on says from same room as mob
rand_prog percentage randomly triggered based on percentile
fight_prog percentage random within a fight - percentile
hitprcnt_prog percentage percent is percentage of mob's max H.P.
greet_prog percentage entry that mob can see - by mob/player
entry_prog percentage when the mob itself enters a room
bribe_prog amount of gold when a player gives the mob money
death_prog percentage when the mob dies
script_prog   loops by line Hour triggers start
time_prog hour and minutes script prog - runs once on hour
hour_prog hour loops as Script for an hour from start
intercept_prog keyword when a player types a command
give_prog item vnum ivnum when character gives mobile certain object
arrival_prog percentage activates when mobile who is using mpwalkto arrives at destination
buy_prog item vnum activates when the mobile sells that vnum
injure_prog percentage activates when the mobile is injured

Progs that work on objects

The following list of programs will work on objects.

Trigger Triggering Variable Explanation
wear_prog percentage when a player wears the object
remove_prog percentage when a player removes the object
speech_prog keyword/phrase says or tells from same room as object
rand_prog percentage randomly triggered based on percentile
sac_prog percentage when a player sacrifices the object
zap_prog percentage when the player is zapped - alignment
get_prog percentage when a player gets the object
drop_prog percentage when a player drops the object
damage_prog percentage when the object is damaged
repair_prog percentage when the object is repaired
greet_prog percentage when a mob/player enters the room
exa_prog percentage when the object is Examined or Looked
push_prog percentage when a player pushes an object
pull_prog percentage when a player pulls an object
use_prog percentage See below for more information
intercept_prog keyword when a player types a command

Notes on the use_prog program

The use_prog will be executed when the item is used. To define what will trigger the use_prog, here is a list:

  • Wands - when you zap
  • Staves - when you brandish
  • Food/pills - when you eat
  • Blood/fountains/drink containers - when you drink
  • Lights/armour/weapons - when you wear/wield/hold
  • Potions - when you quaff

When the use_prog is executed you will not see the standard 'use message' (ie You quaff a violet potion). What you will will be any mpechoes placed in the program. Also, any mobprog commands can be used in use_prog.

**NOTE** The use_progs on lights, armour, and weapons are executed BEFORE the player wears/holds/wields any item. Therefore, a mpforce to remove the item will not work in the use_prog. You will have to use a wear_prog to accomplish this.

Room Programs

The following is a list of programs that will work in rooms.

act_prog emotes socials actions bamfs
speech_prog says or tells from same room as mob
rand_prog randomly triggered based on percentile
fight_prog random within a fight percentile
greet_prog entry that mob can see by mob/player
entry_prog when the mob itself enters a room
leave_prog when the PC leaves a room
death_prog when the mob dies
script_prog loops by line. Hour triggers start
time_prog script prog runs once on hour
hour_prog loops as Script for an hour from start