Difference between revisions of "Prog Section 7"

From Immwiki
Jump to: navigation, search
m (fixing formatting --Telelion)
Line 1: Line 1:
= If Checks =
+
=If Checks=
<i>Imagine all the things that had to occur, not only in his life, but in</i>
+
<i>Imagine all the things that had to occur, not only in his life, but in</i>
<i>everybody else's, to arrange it so on that particular night, the Big Bopper</i>
+
<i>everybody else's, to arrange it so on that particular night, the Big Bopper</i>
<i>would be in a  position to live or die depending on a flipping coin. I</i>
+
<i>would be in a  position to live or die depending on a flipping coin. I</i>
<i>became so obsessed with that idea that I gradually became capable of seeing</i>
+
<i>became so obsessed with that idea that I gradually became capable of seeing</i>
<i>the specifics of everybody's death."</i>
+
<i>the specifics of everybody's death."</i>
-- Clyde Bruckman, The X-files: Clyde Bruckman's Final Repose  
+
-- Clyde Bruckman, The X-files: Clyde Bruckman's Final Repose  
  
  
<b>CHARACTER ATTRIBUTE CHECKS:</b>
+
==CHARACTER ATTRIBUTE CHECKS==
If you're trying to find out something about an actor in your prog, from their  
+
: If you're trying to find out something about an actor in your prog, from their  
sex to the size of their wallet, this is the place to look. Pretty much every  
+
: sex to the size of their wallet, this is the place to look. Pretty much every  
check that looks at an actor should be in here.  
+
: check that looks at an actor should be in here.  
  
<b>Basic PC Attributes (i.e. stats):</b>
+
===Basic PC Attributes (i.e. stats)===
  
  <b>if ispc(var)</b>
+
<b>if ispc(var)</b>
  Returns true if the target is a PC, false if not.
+
Returns true if the target is a PC, false if not.
  
  <b>if isnpc(var)</b>
+
<b>if isnpc(var)</b>
  Returns true if the target is a NPC, false if not.
+
Returns true if the target is a NPC, false if not.
  
  <b>if name(var) == Name</b>
+
<b>if name(var) == Name</b>
  Does a straight comparison check between the name field value of the var and
+
Does a straight comparison check between the name field value of the var and
  the provided name. Returns true if they're equal, and false if not. Other  
+
the provided name. Returns true if they're equal, and false if not. Other  
  string operators can be used, such a /, which will cause the check to return true
+
string operators can be used, such a /, which will cause the check to return true
  if the "Name" specified is a substring of the name field.
+
if the "Name" specified is a substring of the name field.
  
  <b>if valname(var) == var2</b>
+
<b>if valname(var) == var2</b>
  Returns true if the name field value of the var is the same as the name value  
+
Returns true if the name field value of the var is the same as the name value  
  of var2.  
+
of var2.  
  
  <b>if ismale(var)</b>
+
<b>if ismale(var)</b>
  <b>if isfemale(var)</b>
+
<b>if isfemale(var)</b>
  <b>if isneuter(var)</b>
+
<b>if isneuter(var)</b>
  Returns true if the var is of the specified gender, and false if not.
+
Returns true if the var is of the specified gender, and false if not.
  
  <b>if sex(var) == #</b>
+
<b>if sex(var) == #</b>
  Returns true if the var is of the sex associated with the #, and false if not.  
+
Returns true if the var is of the sex associated with the #, and false if not.  
  Different numeric operators may also be used.
+
Different numeric operators may also be used.
  Numbers corresponding to sexes:
+
Numbers corresponding to sexes:
    Sexless: 0
+
:    Sexless: 0
    Male: 1
+
:    Male: 1
    Female: 2
+
:    Female: 2
  
  <b>if strength(var) == #</b>
+
<b>if strength(var) == #</b>
  <b>if dexterity(var) == #</b>
+
<b>if dexterity(var) == #</b>
  <b>if intelligence(var) == #</b>
+
<b>if intelligence(var) == #</b>
  <b>if constitution(var) == #</b>
+
<b>if constitution(var) == #</b>
  <b>if wisdom(var) == #</b>
+
<b>if wisdom(var) == #</b>
  <b>if charisma(var) == #</b>
+
<b>if charisma(var) == #</b>
  Returns true if the var's stat is equal to the #, false otherwise. Other numeric
+
Returns true if the var's stat is equal to the #, false otherwise. Other numeric
  operators can be substituted in at will.
+
operators can be substituted in at will.
  
  <b> if savesX(var) == #</b>
+
<b> if savesX(var) == #</b>
  Performs an in-game saves check, just like any spell. "X" is the type of effect, from the list below. # is the level of the effect being saved against.
+
Performs an in-game saves check, just like any spell. "X" is the type of effect, from the list below. # is the level of the effect being saved against.
  Returns true if var makes their save, false if they don't
+
Returns true if var makes their save, false if they don't
  [[DAM_NONE]]                0
+
[[DAM_NONE]]                0
  [[DAM_BASH]]                1
+
[[DAM_BASH]]                1
  [[DAM_PIERCE]]              2
+
[[DAM_PIERCE]]              2
  [[DAM_SLASH]]              3
+
[[DAM_SLASH]]              3
  [[DAM_FIRE]]                4
+
[[DAM_FIRE]]                4
  [[DAM_COLD]]                5
+
[[DAM_COLD]]                5
  [[DAM_LIGHTNING]]          6
+
[[DAM_LIGHTNING]]          6
  [[DAM_ACID]]                7
+
[[DAM_ACID]]                7
  [[DAM_POISON]]              8
+
[[DAM_POISON]]              8
  [[DAM_NEGATIVE]]            9
+
[[DAM_NEGATIVE]]            9
  [[DAM_HOLY]]                10
+
[[DAM_HOLY]]                10
  [[DAM_ENERGY]]              11
+
[[DAM_ENERGY]]              11
  [[DAM_MENTAL]]              12
+
[[DAM_MENTAL]]              12
  [[DAM_DISEASE]]            13
+
[[DAM_DISEASE]]            13
  [[DAM_DROWNING]]            14
+
[[DAM_DROWNING]]            14
  [[DAM_LIGHT]]              15
+
[[DAM_LIGHT]]              15
  [[DAM_OTHER]]              16
+
[[DAM_OTHER]]              16
  [[DAM_HARM]]                17
+
[[DAM_HARM]]                17
  [[DAM_CHARM]]              18
+
[[DAM_CHARM]]              18
  [[DAM_SOUND]]              19
+
[[DAM_SOUND]]              19
  [[DAM_ILLUSION]]            20
+
[[DAM_ILLUSION]]            20
  [[DAM_DEFILEMENT]]          21
+
[[DAM_DEFILEMENT]]          21
  
  <b>if isgood(var)</b>
+
<b>if isgood(var)</b>
  <b>if isneutral(var)</b>
+
<b>if isneutral(var)</b>
  <b>if isevil(var)</b>
+
<b>if isevil(var)</b>
  Returns true if the var's alignment is of the specified type, and false if not.
+
Returns true if the var's alignment is of the specified type, and false if not.
  
  <b>if islawful(var)</b>
+
<b>if islawful(var)</b>
  <b>if isbalanced(var)</b>
+
<b>if isbalanced(var)</b>
  <b>if ischaotic(var)</b>
+
<b>if ischaotic(var)</b>
  Returns true if the var's ethos is of the specified type, and false if not.  
+
Returns true if the var's ethos is of the specified type, and false if not.  
  
  <b>if size(var) == # or size</b>
+
<b>if size(var) == # or size</b>
  Returns true if the var's is the specified size. The right hand argument can
+
Returns true if the var's is the specified size. The right hand argument can
  be either a word or a number. The word (tiny, small, medium, large, huge, giant)
+
be either a word or a number. The word (tiny, small, medium, large, huge, giant)
  will be translated into a number, so all numeric operators can be substituted at  
+
will be translated into a number, so all numeric operators can be substituted at  
  will.
+
will.
  
  <b>if israce(var) == Race</b>
+
<b>if israce(var) == Race</b>
  Returns true if the var is of the specified race, and false if not. Race names  
+
Returns true if the var is of the specified race, and false if not. Race names  
  should not be abbrieviated.
+
should not be abbrieviated.
  
  <b>if class(var) == #</b>
+
<b>if class(var) == #</b>
  Returns true if the var is of the class which is associated with the number. Other  
+
Returns true if the var is of the class which is associated with the number. Other  
  numeric operators can also be used. Class Numbers:  
+
numeric operators can also be used. Class Numbers:  
    Water scholar: 0
+
:    Water scholar: 0
    Earth scholar: 1
+
:    Earth scholar: 1
    Void scholar: 2
+
:    Void scholar: 2
    Spirit scholar: 3
+
:    Spirit scholar: 3
    Air scholar: 4
+
:    Air scholar: 4
    Fire scholar: 5
+
:    Fire scholar: 5
    Water templar: 6
+
:    Water templar: 6
    Earth templar: 7
+
:    Earth templar: 7
    Void Templar: 8
+
:    Void Templar: 8
    Spirit templar: 9  
+
:    Spirit templar: 9  
    Air templar: 10
+
:    Air templar: 10
    Fire templar: 11
+
:    Fire templar: 11
    Thief: 12
+
:    Thief: 12
    Watcher: 13
+
:    Watcher: 13
    Assassin: 14
+
:    Assassin: 14
    Bandit: 15
+
:    Bandit: 15
    Fighter: 18
+
:    Fighter: 18
    Swordmaster: 19
+
:    Swordmaster: 19
    Barbarian: 20
+
:    Barbarian: 20
    Gladiator: 21  
+
:    Gladiator: 21  
    Ranger: 23
+
:    Ranger: 23
    Gleeman: 24
+
:    Gleeman: 24
    Bard: 25
+
:    Bard: 25
    Alchemist: 27
+
:    Alchemist: 27
    Psionicist: 28
+
:    Psionicist: 28
    Druid: 29  
+
:    Druid: 29  
  
  <b>if level(var) == #</b>
+
<b>if level(var) == #</b>
  Returns true if the var's trust level is equal to the provided number, and  
+
Returns true if the var's trust level is equal to the provided number, and  
  false if not. The difference between level and trust is only significant if  
+
false if not. The difference between level and trust is only significant if  
  you have plans to prog in ways to murder other immortals, though. Other  
+
you have plans to prog in ways to murder other immortals, though. Other  
  numeric operators can also be used.
+
numeric operators can also be used.
  
  <b>if isimmort(var)</b>
+
<b>if isimmort(var)</b>
  Returns true if the var has their trust level set beyond 51, and false if not.
+
Returns true if the var has their trust level set beyond 51, and false if not.
  
  <b>if hitprcnt(var) == #</b>
+
<b>if hitprcnt(var) == #</b>
  Returns true if the var's hit percentage (Current hit points[[/Max]] hit points,  
+
Returns true if the var's hit percentage (Current hit points[[/Max]] hit points,  
  all * 100) is equal to the specified #. Other numeric operators can be substituted.
+
all * 100) is equal to the specified #. Other numeric operators can be substituted.
  
  <b>if adrenaline(var) == #</b>
+
<b>if adrenaline(var) == #</b>
  Returns true if a character's adrenaline is equal to the specifed #, and false  
+
Returns true if a character's adrenaline is equal to the specifed #, and false  
  if not. Other numeric operators can be substituted in. Automatically returns false
+
if not. Other numeric operators can be substituted in. Automatically returns false
  if the var is an NPC. Just for reference, a character's adrenaline is set to 20  
+
if the var is an NPC. Just for reference, a character's adrenaline is set to 20  
  after attacking a PC, and 2 after attacking a mob.
+
after attacking a PC, and 2 after attacking a mob.
  
  <b>if position(var) == #</b>
+
<b>if position(var) == #</b>
  Returns true if the var is in the position associated with the provided #, and  
+
Returns true if the var is in the position associated with the provided #, and  
  false if not. Different numeric operators may also be used.  Position numbers:  
+
false if not. Different numeric operators may also be used.  Position numbers:  
    Dead: 0
+
:    Dead: 0
    Mortal: 1
+
:    Mortal: 1
    Incapacitated: 2
+
:    Incapacitated: 2
    Stunned: 3
+
:    Stunned: 3
    Sleeping: 4
+
:    Sleeping: 4
    Resting: 5
+
:    Resting: 5
    Sitting: 6
+
:    Sitting: 6
    Fighting: 7
+
:    Fighting: 7
    Standing: 8  
+
:    Standing: 8  
  
  <b>if goldamt(var) == #</b>
+
<b>if goldamt(var) == #</b>
  Returns true if the var has the specified amount of gold. Other numeric operators
+
Returns true if the var has the specified amount of gold. Other numeric operators
  can also be used.
+
can also be used.
  
  <b>if skill[vnum of skill](var) == #</b>
+
<b>if skill[vnum of skill](var) == #</b>
  This check returns true if the var's skill level is equal to the specified number,
+
This check returns true if the var's skill level is equal to the specified number,
  and false otherwise. For example, if skill192($n) == 100 would return true if $n  
+
and false otherwise. For example, if skill192($n) == 100 would return true if $n  
  had 100% in hide (which has a vnum of 192).
+
had 100% in hide (which has a vnum of 192).
  
  
<b>Affects[[/Status]] Checks:</b>
+
==Affect/Status Checks==
  
  <b>if isbitset(var) == Bit #</b>
+
<b>if isbitset(var) == Bit #</b>
  Returns true if the var's bit # is true, and false if not. Should be confined to
+
Returns true if the var's bit # is true, and false if not. Should be confined to
  PC's.
+
PC's.
  
  <b>if iscriminal(var)</b>
+
<b>if iscriminal(var)</b>
  Returns true if the var is a criminal, and false if not. Should be confined to  
+
Returns true if the var is a criminal, and false if not. Should be confined to  
  PC's, for obvious reasons.
+
PC's, for obvious reasons.
  
  <b>if inhouse(var) == House</b>
+
<b>if inhouse(var) == House</b>
  Returns true if the var is in the specified house. House names should be singular,
+
Returns true if the var is in the specified house. House names should be singular,
  and unabbrieviated.
+
and unabbrieviated.
  
  <b>if isinhouse(var)</b>
+
<b>if isinhouse(var)</b>
  Returns true if the var is marked as being of the same house as the room he is in
+
Returns true if the var is marked as being of the same house as the room he is in
(i.e. a Raider standing in the Raider Canyon).
+
: (i.e. a Raider standing in the Raider Canyon).
  
  <b>if snaffected(var) == vnum of spell affect</b>
+
<b>if snaffected(var) == vnum of spell affect</b>
  Returns true if the var is affected by the affect, specified by the given vnum. The
+
Returns true if the var is affected by the affect, specified by the given vnum. The
  vnum should be greater than 0. To use this check with an object, simply leave the  
+
vnum should be greater than 0. To use this check with an object, simply leave the  
  var field blank.
+
var field blank.
  
  <b>if isaffected(var) == Bit number of the affect</b>
+
<b>if isaffected(var) == Bit number of the affect</b>
  Returns true if the var is affected by the affect, specified by the bit number.  
+
Returns true if the var is affected by the affect, specified by the bit number.  
  Genuinely scorned since the advent of the much simpler snaffected, this could still
+
Genuinely scorned since the advent of the much simpler snaffected, this could still
  be useful if you want to target multiple affects that all use the same bit, like  
+
be useful if you want to target multiple affects that all use the same bit, like  
  flight and its variants.
+
flight and its variants.
  
  <b>if isghost(var)</b>
+
<b>if isghost(var)</b>
  Returns true if the var is a ghost, and false if not. Should probably be used on any
+
Returns true if the var is a ghost, and false if not. Should probably be used on any
  progs which would ordinarily do brutal things to a person.
+
progs which would ordinarily do brutal things to a person.
  
  <b>if isastral(var)</b>
+
<b>if isastral(var)</b>
  Returns true if the var is affected by astral projection, and false if not.
+
Returns true if the var is affected by astral projection, and false if not.
  
  <b>if isflying(var)</b>
+
<b>if isflying(var)</b>
  Returns true if the var is flying. This includes all forms of flight, including  
+
Returns true if the var is flying. This includes all forms of flight, including  
  levitation, mass flight, etc.
+
levitation, mass flight, etc.
  
  <b>if hasboat(var)</b>
+
<b>if hasboat(var)</b>
  Returns true if var has an item of type boat in their inventory.
+
Returns true if var has an item of type boat in their inventory.
  
  <b>if iswizi(var)</b>
+
<b>if iswizi(var)</b>
  Returns true if the var is wizi, false if not.
+
Returns true if the var is wizi, false if not.
  
  <b>if isindoors(var)</b>
+
<b>if isindoors(var)</b>
  Returns true if the room the var is in is flagged with the "indoors" flag, and false
+
Returns true if the room the var is in is flagged with the "indoors" flag, and false
  if not. Keep in mind that as of this moment, this check only works for the room flag
+
if not. Keep in mind that as of this moment, this check only works for the room flag
  "indoors." It does not check for the room's sector, so it will still return false even
+
"indoors." It does not check for the room's sector, so it will still return false even
  if the sector is "inside."
+
if the sector is "inside."
  
  <b>if isfight(var) == name</b>
+
<b>if isfight(var) == name</b>
  <b>if isfighting(var) == name</b>
+
<b>if isfighting(var) == name</b>
  The same code with two different names, these return true if the var is fighting the  
+
The same code with two different names, these return true if the var is fighting the  
  mob or PC with the specified name, and false if not. The != operator can also be used  
+
mob or PC with the specified name, and false if not. The != operator can also be used  
  with this check. If used without a name and operator, then the check will simply check
+
with this check. If used without a name and operator, then the check will simply check
  whether or not the var is fighting at all.
+
whether or not the var is fighting at all.
  
  <b>if tanking(var)</b>
+
<b>if tanking(var)</b>
  Returns true if the var is tanking something, and false if not. Common sense dictates
+
Returns true if the var is tanking something, and false if not. Common sense dictates
  that this should be restricted to situations where the var is fighting.
+
that this should be restricted to situations where the var is fighting.
  
  <b>if istracking(var)</b>
+
<b>if istracking(var)</b>
  Only to be called from a mob, this returns true if the mob is tracking the var, and  
+
Only to be called from a mob, this returns true if the mob is tracking the var, and  
  false if not.
+
false if not.
  
  <b>if istrack(var)</b>
+
<b>if istrack(var)</b>
  Returns true if the var (which should probably be referencing a mob) is tracking, and
+
Returns true if the var (which should probably be referencing a mob) is tracking, and
  false if not.
+
false if not.
  
  <b>if ischarmed(var)</b>
+
<b>if ischarmed(var)</b>
  Returns true if the var is affected by any form of charm, and false if not.  
+
Returns true if the var is affected by any form of charm, and false if not.  
  
  <b>if ismaster(var)</b>
+
<b>if ismaster(var)</b>
  To be called only from a mob, this returns true if the var is the mob's master, and  
+
To be called only from a mob, this returns true if the var is the mob's master, and  
  false if not.
+
false if not.
  
  <b>if isfollow(var)</b>
+
<b>if isfollow(var)</b>
  Returns true if both a) var is following a person A, and b) var is in the same room
+
Returns true if both a) var is following a person A, and b) var is in the same room
  as person A.
+
as person A.
  
  <b>if isgroup(var) & var2</b>
+
<b>if isgroup(var) & var2</b>
  Returns true if var and var2 are grouped, false if not.
+
Returns true if var and var2 are grouped, false if not.
  
  <b>if isrange(var) == var2</b>
+
<b>if isrange(var) == var2</b>
  Returns true if var is in var2's PK range, and false otherwise.
+
Returns true if var is in var2's PK range, and false otherwise.
  
  <b>if cansee(var) == var2</b>
+
<b>if cansee(var) == var2</b>
  Returns true if var can see var2, and false if not.
+
Returns true if var can see var2, and false if not.
  
  <b>if hastrait([var]) == <traitname></b>
+
<b>if hastrait([var]) == <traitname></b>
  This if check returns true if the is a PC and has the trait specified by traitname.
+
This if check returns true if the is a PC and has the trait specified by traitname.
  
  <b>if lagged(var)</b>
+
<b>if lagged(var)</b>
  If lagged returns true if a pc currently has a wait state of greater than zero. In  
+
If lagged returns true if a pc currently has a wait state of greater than zero. In  
  general, this is true if the pc is currently bashed, busy casting a spell, or mplagged.
+
general, this is true if the pc is currently bashed, busy casting a spell, or mplagged.
  
  <b>if hassymbol(var) == #</b>
+
<b>if hassymbol(var) == #</b>
  This if check is used to see if the target has a particular void scholar symbol. Here,
+
This if check is used to see if the target has a particular void scholar symbol. Here,
  the argument is the last two digits of the symbol’s vnum.
+
the argument is the last two digits of the symbol’s vnum.
  
  <b>if language(var) == <language></b>
+
<b>if language(var) == <language></b>
  This if check returns true if the target variable is speaking the given language. Here  
+
This if check returns true if the target variable is speaking the given language. Here  
  language is just one of the selected race names, with the exception of the ch’taren,  
+
language is just one of the selected race names, with the exception of the ch’taren,  
  who are denoted by "chtaren" (to spare the difficulty of parsing single quotes).
+
who are denoted by "chtaren" (to spare the difficulty of parsing single quotes).
  
  <b>if isanimal(var)</b>
+
<b>if isanimal(var)</b>
  This if check returns true if the target is [[ACT_ANIMAL]].
+
This if check returns true if the target is [[ACT_ANIMAL]].
  
  <b>if haspath(npc)</b>
+
<b>if haspath(npc)</b>
  If haspath returns true if the target npc has a recorded path, as generated by the
+
If haspath returns true if the target npc has a recorded path, as generated by the
  mppath command.
+
mppath command.
  
  <b>if isfriend(<target>) [== faction number]</b>
+
<b>if isfriend(<target>) [== faction number]</b>
  <b>if isenemy(<target>) [== faction number]</b>
+
<b>if isenemy(<target>) [== faction number]</b>
  Returns true if the target is a friend (for isfriend) or enemy (for isenemy)
+
Returns true if the target is a friend (for isfriend) or enemy (for isenemy)
  of the given faction.  If the faction number is ommited, it uses the faction
+
of the given faction.  If the faction number is ommited, it uses the faction
  of the mob performing the check.
+
of the mob performing the check.
  
  <b>if acctpoints(var) == #</b>
+
<b>if acctpoints(var) == #</b>
  Returns true if the target has that many account points.
+
Returns true if the target has that many account points.
  
<b>Memory Checks:</b>
+
==Memory Checks==
This section is fairly self-explanatory. If you've got to check up the slots on anything,
+
: This section is fairly self-explanatory. If you've got to check up the slots on anything,
be it bits, focuses, or mpvalues, this is the if-check section for you.  
+
: be it bits, focuses, or mpvalues, this is the if-check section for you.  
  
  <b>if isbitset(var) == Bit #</b>
+
<b>if isbitset(var) == Bit #</b>
  Returns true if the var's bit # is true, and false if not. Should be confined to PC's.
+
Returns true if the var's bit # is true, and false if not. Should be confined to PC's.
  
  <b>if mobvcheck(var) == #</b>
+
<b>if mobvcheck(var) == #</b>
  Used in conjunction with mob memory, this check returns true if the value the mob  
+
Used in conjunction with mob memory, this check returns true if the value the mob  
  associates with the var is equal to the #. Of course, other numeric operators may be
+
associates with the var is equal to the #. Of course, other numeric operators may be
  used. Keep in mind that unlike bits, mob memory is stored on the mob itself, so if it
+
used. Keep in mind that unlike bits, mob memory is stored on the mob itself, so if it
  dies, all such memory will be cleared.
+
dies, all such memory will be cleared.
  
  <b>if value(value slot) == #</b>
+
<b>if value(value slot) == #</b>
  <b>if mobvalue(mob slot) == #</b>
+
<b>if mobvalue(mob slot) == #</b>
  <b>if objvalue(obj slot) == #</b>
+
<b>if objvalue(obj slot) == #</b>
  <b>if roomvalue(room slot) == #</b>
+
<b>if roomvalue(room slot) == #</b>
 
+
Returns true if the # is equal to the value held by the slot. Slots number from
  Returns true if the # is equal to the value held by the slot. Slots number from
+
0 to 9, and can be set with the mpvalue commands. Other numeric operators can be  
  0 to 9, and can be set with the mpvalue commands. Other numeric operators can be  
+
substituted.  Note that "if value" (a new and improved command) works on a rooms,
  substituted.  Note that "if value" (a new and improved command) works on a rooms,
+
mobs, or objects.
  mobs, or objects.
+
  
 
    
 
    
  <b>if remembers(var)</b>
+
<b>if remembers(var)</b>
  This checks whether or not a player has been stored within a mob's memory, via  
+
This checks whether or not a player has been stored within a mob's memory, via  
  the mpremember command.
+
the mpremember command.
  
  <b>if isfocused(var)</b>
+
<b>if isfocused(var)</b>
  Returns true if the var is focused on something, and false if not. In the case of
+
Returns true if the var is focused on something, and false if not. In the case of
  objects and rooms, just leave the var field blank.  
+
objects and rooms, just leave the var field blank.  
  
  
<b>Environmental Checks:</b>
+
==Environmental Checks==
This section deals primarily with if checks that describe the area surrounding the  
+
: This section deals primarily with if checks that describe the area surrounding the  
actor, otherwise known as the environment.  
+
: actor, otherwise known as the environment.  
  
  
  <b>if isanypcarea()</b>
+
<b>if isanypcarea()</b>
  Returns true if there are any PC's in the area, and false if not.
+
Returns true if there are any PC's in the area, and false if not.
  
  <b>if isanypchere(var)</b>
+
<b>if isanypchere(var)</b>
  Returns true if there are any PC's in the room that the prog is called from, and
+
Returns true if there are any PC's in the room that the prog is called from, and
  false if not.
+
false if not.
  
  <b>if isanynpchere(var)</b>
+
<b>if isanynpchere(var)</b>
  Returns true if there are any NPC's in the room that the prog is called from, and
+
Returns true if there are any NPC's in the room that the prog is called from, and
  false if not.
+
false if not.
  
  
  
  <b>if isanyobjere(var)</b>
+
<b>if isanyobjere(var)</b>
  Returns true if there are any objects in the room that the prog is called from, and
+
Returns true if there are any objects in the room that the prog is called from, and
  false if not.
+
false if not.
  
  <b>if objhere(vnum of object)</b>
+
<b>if objhere(vnum of object)</b>
  Checks whether or not the object of the specified vnum is in the same room as the  
+
Checks whether or not the object of the specified vnum is in the same room as the  
  calling mob/object.
+
calling mob/object.
  
  <b>if mobhere(vnum of mob)</b>
+
<b>if mobhere(vnum of mob)</b>
  Returns true if the calling mob/object is in the same room as the specified mob, and  
+
Returns true if the calling mob/object is in the same room as the specified mob, and  
  false if not.
+
false if not.
  
  <b>if ishere(var)</b>
+
<b>if ishere(var)</b>
  This check returns true if the calling mob/object is in the same room as the var, and
+
This check returns true if the calling mob/object is in the same room as the var, and
  false if not.
+
false if not.
  
  <b>if inroom(var) == vnum of room</b>
+
<b>if inroom(var) == vnum of room</b>
  Returns true if the var or calling object is in the room specified by the vnum. Other  
+
Returns true if the var or calling object is in the room specified by the vnum. Other  
  numeric operators can be substituted in. If called from an object, leave the var field
+
numeric operators can be substituted in. If called from an object, leave the var field
  blank. The if check will return whether or not the calling object is in the specified room.
+
blank. The if check will return whether or not the calling object is in the specified room.
  
  <b>if inarea(var)</b>
+
<b>if inarea(var)</b>
  Returns true if the var is in the same area as the calling mob/object.
+
Returns true if the var is in the same area as the calling mob/object.
  
  <b>if isopen(var) == # or Direction</b>
+
<b>if isopen(var) == # or Direction</b>
  Returns true if there are no closed doors to the var's specified direction, and false  
+
Returns true if there are no closed doors to the var's specified direction, and false  
  if not. If this check is called by an object, then leave the var field blank. Note that
+
if not. If this check is called by an object, then leave the var field blank. Note that
  the way this is phrased means that the path just has to be open, there does not have to
+
the way this is phrased means that the path just has to be open, there does not have to
  be an actual door in the way. var can also be an object. List of numbers that correspond
+
be an actual door in the way. var can also be an object. List of numbers that correspond
  to directions:
+
to directions:
    North 0
+
:    North 0
    East 1
+
:    East 1
    South 2
+
:    South 2
    West 3
+
:    West 3
    Up 4
+
:    Up 4
    Down 5  
+
:    Down 5  
  
  <b>if isseason() == # or season</b>
+
<b>if isseason() == # or season</b>
  Returns true if the current season is the same as the one specified. Names will be  
+
Returns true if the current season is the same as the one specified. Names will be  
  converted automatically into their numeric equivalents, so you can feel free to use an  
+
converted automatically into their numeric equivalents, so you can feel free to use an  
  operator other than ==. List of numbers that correspond to the seasons:  
+
operator other than ==. List of numbers that correspond to the seasons:  
    spring 0
+
:    spring 0
    summer 1
+
:    summer 1
    autumn 2
+
:    autumn 2
    winter 3  
+
:    winter 3  
  
  <b>if isphase() == #</b>
+
<b>if isphase() == #</b>
  Unfortunately, this will only check for the phases of Lunus. Returns true if Lunus's
+
Unfortunately, this will only check for the phases of Lunus. Returns true if Lunus's
  current phase is equivalent to the specified number. Note that there is no text  
+
current phase is equivalent to the specified number. Note that there is no text  
  conversion, so you'll have to plot this out yourself. Since it's working with numbers,
+
conversion, so you'll have to plot this out yourself. Since it's working with numbers,
  other numerical operators should be accepted without difficulty. List of numbers
+
other numerical operators should be accepted without difficulty. List of numbers
  corresponding to the phases of the moon:  
+
corresponding to the phases of the moon:  
    Waning gibbous in the sky 0
+
:    Waning gibbous in the sky 0
    Waning in the sky 1
+
:    Waning in the sky 1
    Waning crescent in the sky 2
+
:    Waning crescent in the sky 2
    Currently new 3  
+
:    Currently new 3  
    Waxing crescent in the sky 4
+
:    Waxing crescent in the sky 4
    Waxing in the sky 5
+
:    Waxing in the sky 5
    Waxing gibbous in the sky 6
+
:    Waxing gibbous in the sky 6
    Currently full 7  
+
:    Currently full 7  
  
  <b>if islight()</b>
+
<b>if islight()</b>
  Returns true if the sun is currently up. The actual hours vary from season to season.
+
Returns true if the sun is currently up. The actual hours vary from season to season.
  
  <b>if isday() == #</b>
+
<b>if isday() == #</b>
  Returns true if # is equal to the day of the month. Other numeric operators can be
+
Returns true if # is equal to the day of the month. Other numeric operators can be
  substituted in.  
+
substituted in.  
  
  <b>if isdayofweek() == #</b>
+
<b>if isdayofweek() == #</b>
  0 - Lyrensday
+
0 - Lyrensday
  1 - Iolenday
+
1 - Iolenday
  2 - Thelansday
+
2 - Thelansday
  3 - Endenday
+
3 - Endenday
  4 - Nimensday
+
4 - Nimensday
  5 - Thethelsday
+
5 - Thethelsday
  6 - Evenday
+
6 - Evenday
  
  <b>if istime() == # </b>
+
<b>if istime() == # </b>
  Returns true if # is equal to the current hour, numbering from 0 to 23. Other numeric
+
Returns true if # is equal to the current hour, numbering from 0 to 23. Other numeric
  operators can be substituted in.
+
operators can be substituted in.
  
  <b>if roomflag(var) == <room flag name></b>
+
<b>if roomflag(var) == <room flag name></b>
  This if check returns true if the room has the flag specified. Valid room flags include:
+
This if check returns true if the room has the flag specified. Valid room flags include:
  dark, nogate, no_mob, indoors, nosum_to, nosum_from, noneforyou, vault, noyell, private,
+
dark, nogate, no_mob, indoors, nosum_to, nosum_from, noneforyou, vault, noyell, private,
  safe, solitary, pet_shop, no_recall, imp_only, gods_only, heroes_only, newbies_only, law,
+
safe, solitary, pet_shop, no_recall, imp_only, gods_only, heroes_only, newbies_only, law,
  nowhere, nomagic, guild, noweather, uberdark, power_nexus, rough, has_water
+
nowhere, nomagic, guild, noweather, uberdark, power_nexus, rough, has_water
 
   
 
   
  <b>if sector(var) == <sector name></b>
+
<b>if sector(var) == <sector name></b>
  This if check returns true if the target is located in the sector with the specified name.
+
This if check returns true if the target is located in the sector with the specified name.
  Valid sectors include:  
+
Valid sectors include:  
  inside, city, field, forest, hills, mountain, swim, noswim, air, desert, underwater,  
+
inside, city, field, forest, hills, mountain, swim, noswim, air, desert, underwater,  
  underground, road, swamp.  
+
underground, road, swamp.  
  
  
<b>Item related:</b>
+
==Item related==
The following if-checks are used to describe items, or their relation to the actor.  
+
: The following if-checks are used to describe items, or their relation to the actor.  
  
  <b>if incontainer(vnum)</b>
+
<b>if incontainer(vnum)</b>
  Returns true if object is inside the container with prog. If vnum is omitted, returns  
+
Returns true if object is inside the container with prog. If vnum is omitted, returns  
  true if container contains anything if vnum is omitted. Obviously, to be used with  
+
true if container contains anything if vnum is omitted. Obviously, to be used with  
  progs on containers.
+
progs on containers.
  
  <b>if isoverlimit(vnum of object)</b>
+
<b>if isoverlimit(vnum of object)</b>
  Used to check an item's limits for various item loading progs. Returns true if the  
+
Used to check an item's limits for various item loading progs. Returns true if the  
  current number of the item is greater than the item limit.
+
current number of the item is greater than the item limit.
  
 
   [ 34] Transmitt: Limit bugs on your progs.
 
   [ 34] Transmitt: Limit bugs on your progs.
Line 482: Line 481:
 
   - tm
 
   - tm
  
  <b>if iswielding(var) == vnum of the object</b>
+
<b>if iswielding(var) == vnum of the object</b>
  A bit of a misnomer, this returns true if the var is wearing the specified object,
+
A bit of a misnomer, this returns true if the var is wearing the specified object,
  and false if not. As such, the vnum does not have to be restricted merely to weapons,
+
and false if not. As such, the vnum does not have to be restricted merely to weapons,
  but can be applied to any item that can be worn.
+
but can be applied to any item that can be worn.
  
  <b>if iscarrying(var) == vnum of the object</b>
+
<b>if iscarrying(var) == vnum of the object</b>
  Returns true if the var is carrying the specified object, and false if not. This
+
Returns true if the var is carrying the specified object, and false if not. This
  includes everything in the iswielding check, and further goes through the var's  
+
includes everything in the iswielding check, and further goes through the var's  
  inventory.
+
inventory.
  
  <b>if isowner(var)</b>
+
<b>if isowner(var)</b>
  <b>if isheld(var)</b>
+
<b>if isheld(var)</b>
  Restricted to obj progs, this is predominantly used in verb progs to make sure  
+
Restricted to obj progs, this is predominantly used in verb progs to make sure  
  that only the person who actually has the object is activating the verb. These  
+
that only the person who actually has the object is activating the verb. These  
  checks will return true if the var is the owner of the object, and false if not.
+
checks will return true if the var is the owner of the object, and false if not.
  Keep in mind that they are identical, meaning that isheld is a bit of a misnomer.
+
Keep in mind that they are identical, meaning that isheld is a bit of a misnomer.
  
  <b>if isworn(var)</b>
+
<b>if isworn(var)</b>
  Isworn returns true if the calling object is being worn by the specified var,  
+
Isworn returns true if the calling object is being worn by the specified var,  
  and false if not. Isworn should only be called from an object.
+
and false if not. Isworn should only be called from an object.
  
  <b>if iswearslotfull(var) == #</b>
+
<b>if iswearslotfull(var) == #</b>
  Returns true if the wear slot, specified by the #, is full. Here are the slot  
+
Returns true if the wear slot, specified by the #, is full. Here are the slot  
  numbers. Slot number is from 1-22.  
+
numbers. Slot number is from 1-22.  
    0: Light
+
:    0: Light
    1: Left finger
+
:    1: Left finger
    2: Right finger
+
:    2: Right finger
    3: Neck1
+
:    3: Neck1
    4: Neck2  
+
:    4: Neck2  
    5: Torso
+
:    5: Torso
    6: Head
+
:    6: Head
    7: Legs
+
:    7: Legs
    8: Feet
+
:    8: Feet
    9: Hands
+
:    9: Hands
    10: Arms
+
:    10: Arms
    11: Shield
+
:    11: Shield
    12: Body
+
:    12: Body
    13: Waist
+
:    13: Waist
    14: Wrist
+
:    14: Wrist
    15: Wrist
+
:    15: Wrist
    16: Wielded
+
:    16: Wielded
    17: Held
+
:    17: Held
    18: Floating
+
:    18: Floating
    19: Dual wielded
+
:    19: Dual wielded
    20: Branded
+
:    20: Branded
    21: Concealed
+
:    21: Concealed
    22: Concealed  
+
:    22: Concealed  
 
    
 
    
  <b>if objtype() == #
+
<b>if objtype() == #
  Returns true if the calling object is of the type specified by the number.  
+
Returns true if the calling object is of the type specified by the number.  
  Objtype numbers:
+
Objtype numbers:
    Light: 1
+
:    Light: 1
    Scroll: 2
+
:    Scroll: 2
    Wand: 3
+
:    Wand: 3
    Staff: 4
+
:    Staff: 4
    Weapon: 5
+
:    Weapon: 5
    Treasure: 8
+
:    Treasure: 8
    Armor: 9
+
:    Armor: 9
    Potion: 10
+
:    Potion: 10
    Clothing: 11
+
:    Clothing: 11
    Furniture: 12
+
:    Furniture: 12
    Trash: 13
+
:    Trash: 13
    Container: 15
+
:    Container: 15
    Drin Container: 17
+
:    Drink Container: 17
    Key: 18
+
:    Key: 18
    Food: 19
+
:    Food: 19
    Money: 20
+
:    Money: 20
    Boat: 22
+
:    Boat: 22
    NPC Corpse: 23
+
:    NPC Corpse: 23
    PC Corpse: 24
+
:    PC Corpse: 24
    Fountain: 25
+
:    Fountain: 25
    Pill: 26
+
:    Pill: 26
    Protect: 27
+
:    Protect: 27
    Map: 28
+
:    Map: 28
    Potal: 29
+
:    Potal: 29
    Warp Stone: 30
+
:    Warp Stone: 30
    Room Key: 31
+
:    Room Key: 31
    Gem: 32
+
:    Gem: 32
    Jewelry: 33
+
:    Jewelry: 33
    Jukebox: 34
+
:    Jukebox: 34
    Instrument: 35
+
:    Instrument: 35
    Net: 36
+
:    Net: 36
    Arrow: 37
+
:    Arrow: 37
    Bow: 38
+
:    Bow: 38
 
   
 
   
  <b>if objval0() == #</b>
+
<b>if objval0() == #</b>
  <b>if objval1() == #</b>
+
<b>if objval1() == #</b>
  <b>if objval2() == #</b>
+
<b>if objval2() == #</b>
  <b>if objval3() == #</b>
+
<b>if objval3() == #</b>
  Returns true if the object's v(0-3) slot is equal to the specified number. Other  
+
Returns true if the object's v(0-3) slot is equal to the specified number. Other  
  numeric operators can also be used.
+
numeric operators can also be used.
  
  <b>if material() == Material type</b>
+
<b>if material() == Material type</b>
  Primarily for use in a give_prog, which will automatically reference the given object.
+
Primarily for use in a give_prog, which will automatically reference the given object.
  Returns true if the given object is of the specified material, and false if not.
+
Returns true if the given object is of the specified material, and false if not.
  
  <b>if perminvis([var])</b>
+
<b>if perminvis([var])</b>
  If perminvis returns true if the target object is permanently invisible. If used in
+
If perminvis returns true if the target object is permanently invisible. If used in
  a give_prog, a blank argument can be specified, and it will default to targeting the
+
a give_prog, a blank argument can be specified, and it will default to targeting the
  object which triggers the give_prog.
+
object which triggers the give_prog.
  
  <b>if recentowner([var]) == <name></b>
+
<b>if recentowner([var]) == <name></b>
  This if check returns true if the name specified was a recent owner of a target. If  
+
This if check returns true if the name specified was a recent owner of a target. If  
  used with a give_prog, no argument is needed, as it will default to targetting the
+
used with a give_prog, no argument is needed, as it will default to targetting the
  triggering object of the prog.
+
triggering object of the prog.
  
  <b>if isunderlimit(<vnum>)</b>
+
<b>if isunderlimit(<vnum>)</b>
  This ifcheck determines, well, if the eq is under limit.  Useful for alternative ways of  
+
This ifcheck determines, well, if the eq is under limit.  Useful for alternative ways of  
  loading limited equipment.
+
loading limited equipment.
  
  <b>if objfrom(var) == <animal|celestial></b>
+
<b>if objfrom(var) == <animal|celestial></b>
  This if check determines whether the target object is a part from an animal or a  
+
This if check determines whether the target object is a part from an animal or a  
  celestial being. Originally designed for use with demon payments, it may find other
+
celestial being. Originally designed for use with demon payments, it may find other
  application. When used in a give_prog, a blank target can be substituted, and it will
+
application. When used in a give_prog, a blank target can be substituted, and it will
  default to using the trigger object for the give_prog.
+
default to using the trigger object for the give_prog.
  
  <b>if fountainhere()</b>
+
<b>if fountainhere()</b>
  Checks if there's a fountain here.  Please use with with a var, as I think it crashes
+
Checks if there's a fountain here.  Please use with with a var, as I think it crashes
  us without one.  This does not currently work with objects.
+
us without one.  This does not currently work with objects.
  
  <b>if level41corpsehere()</b>
+
<b>if level41corpsehere()</b>
  This if check returns true if a pc corpse of level 41 or higher is here.
+
This if check returns true if a pc corpse of level 41 or higher is here.
  
  <b>if number([var]) == <vnum></b>
+
<b>if number([var]) == <vnum></b>
  This if check returns true if the target is of the given vnum. It can also be used  
+
This if check returns true if the target is of the given vnum. It can also be used  
  without an argument in conjunction with a give_prog, in which case it will default  
+
without an argument in conjunction with a give_prog, in which case it will default  
  to targetting on the give_prog’s trigger.
+
to targetting on the give_prog’s trigger.
  
  
<b>Miscellaneous:</b>
+
==Miscellaneous==
  
  <b>if rand(#)</b>
+
<b>if rand(#)</b>
  Generates a random number between 1 and 100, returning true if it is less than the #,
+
Generates a random number between 1 and 100, returning true if it is less than the #,
  and false if it is not.
+
and false if it is not.
  
<b>String checking:</b>
+
===String checking===
  
  <b>if compstr(#) == arg</b>
+
<b>if compstr(#) == arg</b>
  This takes in the character's input, and checks to see if the #th word is equivalent
+
This takes in the character's input, and checks to see if the #th word is equivalent
  to the arg. Used primarily for verb_progs, it's advised that the operator be  
+
to the arg. Used primarily for verb_progs, it's advised that the operator be  
  restricted to == and !=.  
+
restricted to == and !=.  
  
  <b>if compx() == arg</b>
+
<b>if compx() == arg</b>
  This checks to see if the arg is anywhere within the string. Again, restrict yourself
+
This checks to see if the arg is anywhere within the string. Again, restrict yourself
  to == and !=.  
+
to == and !=.  
  
  <b>if regex() == <regular expression></b>
+
<b>if regex() == <regular expression></b>
  Returns true if the text ($x) variable is matched by the regular expression.  Those of
+
Returns true if the text ($x) variable is matched by the regular expression.  Those of
  you who don't know what a 'regular expression' is probably won't find too much use for
+
you who don't know what a 'regular expression' is probably won't find too much use for
  it, but it should be very useful for those who do.  
+
it, but it should be very useful for those who do.  
  
<b>Junk:</b>
+
===Junk===
  
if demonstate() == #</b>
+
<b>if demonstate() == #</b>
Ashurian madness. Used for greater demon crap, somehow. Don't ask me.
+
: Ashurian madness. Used for greater demon crap, somehow. Don't ask me.
  
if hasrelief(var)</b>
+
<b>if hasrelief(var)</b>
An antiquated check for the Raider vault items. It checks to see if the var is holding
+
: An antiquated check for the Raider vault items. It checks to see if the var is holding
on to the four items. There's  pretty much no reason to learn this check.
+
: on to the four items. There's  pretty much no reason to learn this check.
  
if isweather() == #</b>
+
<b>if isweather() == #</b>
Currently broken. Will automatically return false until further notice.  
+
: Currently broken. Will automatically return false until further notice.  
  
if isexists()
+
<b>if isexists()</b>
Broken, do not use.
+
: Broken, do not use.
  
 
[[category: Leviticus]]
 
[[category: Leviticus]]

Revision as of 02:23, 5 May 2011

If Checks

Imagine all the things that had to occur, not only in his life, but in everybody else's, to arrange it so on that particular night, the Big Bopper would be in a position to live or die depending on a flipping coin. I became so obsessed with that idea that I gradually became capable of seeing the specifics of everybody's death." -- Clyde Bruckman, The X-files: Clyde Bruckman's Final Repose


CHARACTER ATTRIBUTE CHECKS

If you're trying to find out something about an actor in your prog, from their
sex to the size of their wallet, this is the place to look. Pretty much every
check that looks at an actor should be in here.

Basic PC Attributes (i.e. stats)

if ispc(var)

Returns true if the target is a PC, false if not.

if isnpc(var)

Returns true if the target is a NPC, false if not.

if name(var) == Name

Does a straight comparison check between the name field value of the var and
the provided name. Returns true if they're equal, and false if not. Other
string operators can be used, such a /, which will cause the check to return true
if the "Name" specified is a substring of the name field.

if valname(var) == var2

Returns true if the name field value of the var is the same as the name value
of var2.

if ismale(var) if isfemale(var) if isneuter(var)

Returns true if the var is of the specified gender, and false if not.

if sex(var) == #

Returns true if the var is of the sex associated with the #, and false if not.
Different numeric operators may also be used.
Numbers corresponding to sexes:
Sexless: 0
Male: 1
Female: 2

if strength(var) == # if dexterity(var) == # if intelligence(var) == # if constitution(var) == # if wisdom(var) == # if charisma(var) == #

Returns true if the var's stat is equal to the #, false otherwise. Other numeric
operators can be substituted in at will.

if savesX(var) == #

Performs an in-game saves check, just like any spell. "X" is the type of effect, from the list below. # is : the level of the effect being saved against.
Returns true if var makes their save, false if they don't
DAM_NONE 0
DAM_BASH 1
DAM_PIERCE 2
DAM_SLASH 3
DAM_FIRE 4
DAM_COLD 5
DAM_LIGHTNING 6
DAM_ACID 7
DAM_POISON 8
DAM_NEGATIVE 9
DAM_HOLY 10
DAM_ENERGY 11
DAM_MENTAL 12
DAM_DISEASE 13
DAM_DROWNING 14
DAM_LIGHT 15
DAM_OTHER 16
DAM_HARM 17
DAM_CHARM 18
DAM_SOUND 19
DAM_ILLUSION 20
DAM_DEFILEMENT 21

if isgood(var) if isneutral(var) if isevil(var)

Returns true if the var's alignment is of the specified type, and false if not.

if islawful(var) if isbalanced(var) if ischaotic(var)

Returns true if the var's ethos is of the specified type, and false if not.

if size(var) == # or size

Returns true if the var's is the specified size. The right hand argument can
be either a word or a number. The word (tiny, small, medium, large, huge, giant)
will be translated into a number, so all numeric operators can be substituted at
will.

if israce(var) == Race

Returns true if the var is of the specified race, and false if not. Race names
should not be abbrieviated.

if class(var) == #

Returns true if the var is of the class which is associated with the number. Other
numeric operators can also be used. Class Numbers:
Water scholar: 0
Earth scholar: 1
Void scholar: 2
Spirit scholar: 3
Air scholar: 4
Fire scholar: 5
Water templar: 6
Earth templar: 7
Void Templar: 8
Spirit templar: 9
Air templar: 10
Fire templar: 11
Thief: 12
Watcher: 13
Assassin: 14
Bandit: 15
Fighter: 18
Swordmaster: 19
Barbarian: 20
Gladiator: 21
Ranger: 23
Gleeman: 24
Bard: 25
Alchemist: 27
Psionicist: 28
Druid: 29

if level(var) == #

Returns true if the var's trust level is equal to the provided number, and
false if not. The difference between level and trust is only significant if
you have plans to prog in ways to murder other immortals, though. Other
numeric operators can also be used.

if isimmort(var)

Returns true if the var has their trust level set beyond 51, and false if not.

if hitprcnt(var) == #

Returns true if the var's hit percentage (Current hit points/Max hit points,
all * 100) is equal to the specified #. Other numeric operators can be substituted.

if adrenaline(var) == #

Returns true if a character's adrenaline is equal to the specifed #, and false
if not. Other numeric operators can be substituted in. Automatically returns false
if the var is an NPC. Just for reference, a character's adrenaline is set to 20
after attacking a PC, and 2 after attacking a mob.

if position(var) == #

Returns true if the var is in the position associated with the provided #, and
false if not. Different numeric operators may also be used. Position numbers:
Dead: 0
Mortal: 1
Incapacitated: 2
Stunned: 3
Sleeping: 4
Resting: 5
Sitting: 6
Fighting: 7
Standing: 8

if goldamt(var) == #

Returns true if the var has the specified amount of gold. Other numeric operators
can also be used.

if skill[vnum of skill](var) == #

This check returns true if the var's skill level is equal to the specified number,
and false otherwise. For example, if skill192($n) == 100 would return true if $n
had 100% in hide (which has a vnum of 192).


Affect/Status Checks

if isbitset(var) == Bit #

Returns true if the var's bit # is true, and false if not. Should be confined to
PC's.

if iscriminal(var)

Returns true if the var is a criminal, and false if not. Should be confined to
PC's, for obvious reasons.

if inhouse(var) == House

Returns true if the var is in the specified house. House names should be singular,
and unabbrieviated.

if isinhouse(var)

Returns true if the var is marked as being of the same house as the room he is in
(i.e. a Raider standing in the Raider Canyon).

if snaffected(var) == vnum of spell affect

Returns true if the var is affected by the affect, specified by the given vnum. The
vnum should be greater than 0. To use this check with an object, simply leave the
var field blank.

if isaffected(var) == Bit number of the affect

Returns true if the var is affected by the affect, specified by the bit number.
Genuinely scorned since the advent of the much simpler snaffected, this could still
be useful if you want to target multiple affects that all use the same bit, like
flight and its variants.

if isghost(var)

Returns true if the var is a ghost, and false if not. Should probably be used on any
progs which would ordinarily do brutal things to a person.

if isastral(var)

Returns true if the var is affected by astral projection, and false if not.

if isflying(var)

Returns true if the var is flying. This includes all forms of flight, including
levitation, mass flight, etc.

if hasboat(var)

Returns true if var has an item of type boat in their inventory.

if iswizi(var)

Returns true if the var is wizi, false if not.

if isindoors(var)

Returns true if the room the var is in is flagged with the "indoors" flag, and false
if not. Keep in mind that as of this moment, this check only works for the room flag
"indoors." It does not check for the room's sector, so it will still return false even
if the sector is "inside."

if isfight(var) == name if isfighting(var) == name

The same code with two different names, these return true if the var is fighting the
mob or PC with the specified name, and false if not. The != operator can also be used
with this check. If used without a name and operator, then the check will simply check
whether or not the var is fighting at all.

if tanking(var)

Returns true if the var is tanking something, and false if not. Common sense dictates
that this should be restricted to situations where the var is fighting.

if istracking(var)

Only to be called from a mob, this returns true if the mob is tracking the var, and
false if not.

if istrack(var)

Returns true if the var (which should probably be referencing a mob) is tracking, and
false if not.

if ischarmed(var)

Returns true if the var is affected by any form of charm, and false if not.

if ismaster(var)

To be called only from a mob, this returns true if the var is the mob's master, and
false if not.

if isfollow(var)

Returns true if both a) var is following a person A, and b) var is in the same room
as person A.

if isgroup(var) & var2

Returns true if var and var2 are grouped, false if not.

if isrange(var) == var2

Returns true if var is in var2's PK range, and false otherwise.

if cansee(var) == var2

Returns true if var can see var2, and false if not.

if hastrait([var]) == <traitname>

This if check returns true if the is a PC and has the trait specified by traitname.

if lagged(var)

If lagged returns true if a pc currently has a wait state of greater than zero. In
general, this is true if the pc is currently bashed, busy casting a spell, or mplagged.

if hassymbol(var) == #

This if check is used to see if the target has a particular void scholar symbol. Here,
the argument is the last two digits of the symbol’s vnum.

if language(var) == <language>

This if check returns true if the target variable is speaking the given language. Here
language is just one of the selected race names, with the exception of the ch’taren,
who are denoted by "chtaren" (to spare the difficulty of parsing single quotes).

if isanimal(var)

This if check returns true if the target is ACT_ANIMAL.

if haspath(npc)

If haspath returns true if the target npc has a recorded path, as generated by the
mppath command.

if isfriend(<target>) [== faction number] if isenemy(<target>) [== faction number]

Returns true if the target is a friend (for isfriend) or enemy (for isenemy)
of the given faction. If the faction number is ommited, it uses the faction
of the mob performing the check.

if acctpoints(var) == #

Returns true if the target has that many account points.

Memory Checks

This section is fairly self-explanatory. If you've got to check up the slots on anything,
be it bits, focuses, or mpvalues, this is the if-check section for you.

if isbitset(var) == Bit #

Returns true if the var's bit # is true, and false if not. Should be confined to PC's.

if mobvcheck(var) == #

Used in conjunction with mob memory, this check returns true if the value the mob
associates with the var is equal to the #. Of course, other numeric operators may be
used. Keep in mind that unlike bits, mob memory is stored on the mob itself, so if it
dies, all such memory will be cleared.

if value(value slot) == # if mobvalue(mob slot) == # if objvalue(obj slot) == # if roomvalue(room slot) == #

Returns true if the # is equal to the value held by the slot. Slots number from
0 to 9, and can be set with the mpvalue commands. Other numeric operators can be
substituted. Note that "if value" (a new and improved command) works on a rooms,
mobs, or objects.


if remembers(var)

This checks whether or not a player has been stored within a mob's memory, via
the mpremember command.

if isfocused(var)

Returns true if the var is focused on something, and false if not. In the case of
objects and rooms, just leave the var field blank.


Environmental Checks

This section deals primarily with if checks that describe the area surrounding the
actor, otherwise known as the environment.


if isanypcarea()

Returns true if there are any PC's in the area, and false if not.

if isanypchere(var)

Returns true if there are any PC's in the room that the prog is called from, and
false if not.

if isanynpchere(var)

Returns true if there are any NPC's in the room that the prog is called from, and
false if not.


if isanyobjere(var)

Returns true if there are any objects in the room that the prog is called from, and
false if not.

if objhere(vnum of object)

Checks whether or not the object of the specified vnum is in the same room as the
calling mob/object.

if mobhere(vnum of mob)

Returns true if the calling mob/object is in the same room as the specified mob, and
false if not.

if ishere(var)

This check returns true if the calling mob/object is in the same room as the var, and
false if not.

if inroom(var) == vnum of room

Returns true if the var or calling object is in the room specified by the vnum. Other
numeric operators can be substituted in. If called from an object, leave the var field
blank. The if check will return whether or not the calling object is in the specified room.

if inarea(var)

Returns true if the var is in the same area as the calling mob/object.

if isopen(var) == # or Direction

Returns true if there are no closed doors to the var's specified direction, and false
if not. If this check is called by an object, then leave the var field blank. Note that
the way this is phrased means that the path just has to be open, there does not have to
be an actual door in the way. var can also be an object. List of numbers that correspond
to directions:
North 0
East 1
South 2
West 3
Up 4
Down 5

if isseason() == # or season

Returns true if the current season is the same as the one specified. Names will be
converted automatically into their numeric equivalents, so you can feel free to use an
operator other than ==. List of numbers that correspond to the seasons:
spring 0
summer 1
autumn 2
winter 3

if isphase() == #

Unfortunately, this will only check for the phases of Lunus. Returns true if Lunus's
current phase is equivalent to the specified number. Note that there is no text
conversion, so you'll have to plot this out yourself. Since it's working with numbers,
other numerical operators should be accepted without difficulty. List of numbers
corresponding to the phases of the moon:
Waning gibbous in the sky 0
Waning in the sky 1
Waning crescent in the sky 2
Currently new 3
Waxing crescent in the sky 4
Waxing in the sky 5
Waxing gibbous in the sky 6
Currently full 7

if islight()

Returns true if the sun is currently up. The actual hours vary from season to season.

if isday() == #

Returns true if # is equal to the day of the month. Other numeric operators can be
substituted in.

if isdayofweek() == #

0 - Lyrensday
1 - Iolenday
2 - Thelansday
3 - Endenday
4 - Nimensday
5 - Thethelsday
6 - Evenday

if istime() == #

Returns true if # is equal to the current hour, numbering from 0 to 23. Other numeric
operators can be substituted in.

if roomflag(var) == <room flag name>

This if check returns true if the room has the flag specified. Valid room flags include:
dark, nogate, no_mob, indoors, nosum_to, nosum_from, noneforyou, vault, noyell, private,
safe, solitary, pet_shop, no_recall, imp_only, gods_only, heroes_only, newbies_only, law,
nowhere, nomagic, guild, noweather, uberdark, power_nexus, rough, has_water

if sector(var) == <sector name>

This if check returns true if the target is located in the sector with the specified name.
Valid sectors include:
inside, city, field, forest, hills, mountain, swim, noswim, air, desert, underwater,
underground, road, swamp.


Item related

The following if-checks are used to describe items, or their relation to the actor.

if incontainer(vnum)

Returns true if object is inside the container with prog. If vnum is omitted, returns
true if container contains anything if vnum is omitted. Obviously, to be used with
progs on containers.

if isoverlimit(vnum of object)

Used to check an item's limits for various item loading progs. Returns true if the
current number of the item is greater than the item limit.
 [ 34] Transmitt: Limit bugs on your progs.
 Fri Nov 11 08:02:42 2005
 To: immortal
 The overlimit bugs on your progs:
 If isoverlimit(obj_vnum) returns false if there is no limit on the object or
 the current number of objects in circulation is less than or equal to the
 limit of the object.  What this means: if the limit of the object is 5, it
 will return false if there are 5 of the object in circulation.  If you're
 using this to do nothing if it returns true, and otherwise load the object,
 you will end up with one more item than the limit in circulation.  
 The solution is to use if isunderlimit(obj_vnum).  This returns true if the
 number of items currently in circulation is less than the limit of the item.
 Otherwise it return false.  So replace your overlimit checks with underlimit
 checks on mobs like Mindilast and the peddler.  
 For example:
 Instead of:
 if isoverlimit(obj_vnum)
 else
 mpoload obj_vnum
 endif
 use:
 if isunderlimit(obj_vnum)
 mpoload obj_vnum
 endif
 - tm

if iswielding(var) == vnum of the object

A bit of a misnomer, this returns true if the var is wearing the specified object,
and false if not. As such, the vnum does not have to be restricted merely to weapons,
but can be applied to any item that can be worn.

if iscarrying(var) == vnum of the object

Returns true if the var is carrying the specified object, and false if not. This
includes everything in the iswielding check, and further goes through the var's
inventory.

if isowner(var) if isheld(var)

Restricted to obj progs, this is predominantly used in verb progs to make sure
that only the person who actually has the object is activating the verb. These
checks will return true if the var is the owner of the object, and false if not.
Keep in mind that they are identical, meaning that isheld is a bit of a misnomer.

if isworn(var)

Isworn returns true if the calling object is being worn by the specified var,
and false if not. Isworn should only be called from an object.

if iswearslotfull(var) == #

Returns true if the wear slot, specified by the #, is full. Here are the slot
numbers. Slot number is from 1-22.
0: Light
1: Left finger
2: Right finger
3: Neck1
4: Neck2
5: Torso
6: Head
7: Legs
8: Feet
9: Hands
10: Arms
11: Shield
12: Body
13: Waist
14: Wrist
15: Wrist
16: Wielded
17: Held
18: Floating
19: Dual wielded
20: Branded
21: Concealed
22: Concealed

if objtype() == #

Returns true if the calling object is of the type specified by the number.
Objtype numbers:
Light: 1
Scroll: 2
Wand: 3
Staff: 4
Weapon: 5
Treasure: 8
Armor: 9
Potion: 10
Clothing: 11
Furniture: 12
Trash: 13
Container: 15
Drink Container: 17
Key: 18
Food: 19
Money: 20
Boat: 22
NPC Corpse: 23
PC Corpse: 24
Fountain: 25
Pill: 26
Protect: 27
Map: 28
Potal: 29
Warp Stone: 30
Room Key: 31
Gem: 32
Jewelry: 33
Jukebox: 34
Instrument: 35
Net: 36
Arrow: 37
Bow: 38

<b>if objval0() == # if objval1() == # if objval2() == # if objval3() == #

Returns true if the object's v(0-3) slot is equal to the specified number. Other
numeric operators can also be used.

if material() == Material type

Primarily for use in a give_prog, which will automatically reference the given object.
Returns true if the given object is of the specified material, and false if not.

if perminvis([var])

If perminvis returns true if the target object is permanently invisible. If used in
a give_prog, a blank argument can be specified, and it will default to targeting the
object which triggers the give_prog.

if recentowner([var]) == <name>

This if check returns true if the name specified was a recent owner of a target. If
used with a give_prog, no argument is needed, as it will default to targetting the
triggering object of the prog.

if isunderlimit(<vnum>)

This ifcheck determines, well, if the eq is under limit. Useful for alternative ways of
loading limited equipment.

if objfrom(var) == <animal|celestial>

This if check determines whether the target object is a part from an animal or a
celestial being. Originally designed for use with demon payments, it may find other
application. When used in a give_prog, a blank target can be substituted, and it will
default to using the trigger object for the give_prog.

if fountainhere()

Checks if there's a fountain here. Please use with with a var, as I think it crashes
us without one. This does not currently work with objects.

if level41corpsehere()

This if check returns true if a pc corpse of level 41 or higher is here.

if number([var]) == <vnum>

This if check returns true if the target is of the given vnum. It can also be used
without an argument in conjunction with a give_prog, in which case it will default
to targetting on the give_prog’s trigger.


Miscellaneous

if rand(#)

Generates a random number between 1 and 100, returning true if it is less than the #,
and false if it is not.

String checking

if compstr(#) == arg

This takes in the character's input, and checks to see if the #th word is equivalent
to the arg. Used primarily for verb_progs, it's advised that the operator be
restricted to == and !=.

if compx() == arg

This checks to see if the arg is anywhere within the string. Again, restrict yourself
to == and !=.

if regex() == <regular expression>

Returns true if the text ($x) variable is matched by the regular expression. Those of
you who don't know what a 'regular expression' is probably won't find too much use for
it, but it should be very useful for those who do.

Junk

if demonstate() == #

Ashurian madness. Used for greater demon crap, somehow. Don't ask me.

if hasrelief(var)

An antiquated check for the Raider vault items. It checks to see if the var is holding
on to the four items. There's pretty much no reason to learn this check.

if isweather() == #

Currently broken. Will automatically return false until further notice.

if isexists()

Broken, do not use.