CHARACTER VARIABLES

From AddictHelp
Jump to navigation Jump to search

For details on how to use variables, please see the schelp for VARIABLES.

Character variables are as follows:

    name      The character's name.
    inventory The first object in the characters inventory
    alias     A mob's alias list, returns nothing if PC
    casting   1/0 (true/false if the character is casting a spell)
    idnum     Database idnum of character
    level     The character's current level.
    gold      The amount of gold on hand.
    align     The characters alignmen.
    clan      The characters clan, returns as "no_clan" if not a clan 
              member.
    clanrank  Numeric value of the characters clan rank.
    clanrankname  Name of the characters clan rank.
    remorts   Number of times character has remorted.
    next_in_room  Detailed in RECALL DEVICES
    sex       The character's sex, as a string (MALE, FEMALE, or NEUTRAL).
    himher    returns "him" if actor is male, or "her" if actor is female.
    hisher    returns "his" if actor is male, or "her" if actor is female.
    heshe     returns "he" if actor is male, or "she" if actor is female.
    canbeseen In mob scripts only, returns 1 if the mob can see the actor,
              returns 0 if it cannot.
    class     The character's class, as a string.
    race      The character's race, as a string.
    vnum      The character's virtual number.  -1 for PCs.
    sound     The character has MSP sound turned on.
    str       The character's strength
    stradd    The character's "stradd".
    dex       The character's dexterity.
    con       The character's constitution.
    int       The character's intelligence.
    wis       The character's wisdom.
    cha       The character's charisma.
    hp        The character's current hit points
    maxhp     The character's max hit points
    move      The character's current moves
    maxmove   The character's max moves
    mana      The character's current mana
    maxmana   The character's max mana
    psp       The character's current PSP's
    maxpsp    The character's max PSP's
    room      The vnum of the room the character is in.
    master    The person the character is following, or 0.
    hometown  Name of the character's hometown.
    pos       The position the character is in:
                    Dead
                    Mortally wounded
                    Incapacitated
                    Stunned
                    Sleeping
                    Resting
                    Sitting
                    Fighting
                    Standing
    inroom          This returns a pointer to the room the character is in.
                    The intended use for this variable is to assign it to
                    another variable and reference the new variable.
                    
For example:

                        set myroom %actor.inroom%
                        if (%myroom.dark%)
                          ...
                        end

    eq(position)    This is a new concept as well as inroom.  If you want
                    to see if someone is wearing armor, you would do 
                    something like this:
                        set armor %actor.eq(body)%
                       if (%armor%)
                         echo %actor.name% is wearing %body.shortdesc%.
                       else
                         echo %actor.name% is nekked.
                       end
                   Valid positions are:  finger, neck, body, head, face,
                       ear, legs, feet, hands, arms, shield, about, waist,
                       wrist.
                   To access the second finger position or wield and hold 
                   you must use the number that represents that wear 
                   position.  The chart is as follows:

                    Position     Number
                    ====================
                       LIGHT      0
                       FINGER_R   1
                       FINGER_L   2
                       NECK_1     3
                       NECK_2     4
                       BODY       5
                       HEAD       6
                       FACE       7
                       EAR_R      8
                       EAR_L      9
                       LEGS      10
                       FEET      11
                       HANDS     12
                       ARMS      13
                       SHIELD    14
                       ABOUT     15
                       WAIST     16
                       WRIST_R   17
                       WRIST_L   18
                       WIELD     19
                       HOLD      20

    fighting        Returns a pointer to who the character is fighting, so
                    you can then treat it as another character.
                  
 Example:
                     set victim %actor.fighting%
                     if (%victim%)
                       pthb %victim%
                     end

   Some variables are used to CHANGE the value of a character, for example
   a line in a script that simply has:
               %actor.set.mana(10)%
   will modify that characters mana to be 10.  Valid variables are:
   set.hp
   set.mana
   set.psp
   set.move
   set.align
   set.pos
   set.align    
(negative numbers can be used for these to subtract)
   add.mana
   add.psp
   add.move
   add.align
   add.drunk
   add.thirsty
   add.full
   add.quest_points
   
   These are going to be phased out.
   room.name       The name of the room the character is in.
   room.godrooom   The room has a godroom flag
   room.dark       The room has a dark flag
   room.death      The room has a death flag
   room.nomob      The room has a nomob flag
   room.indoors    The room has a indoors flag
   room.peaceful   The room has a peaceful flag
   room.soundproof The room has a soundproof flag
   room.notrack    The room has a notrack flag
   room.nomagic    The room has a nomagic flag
   room.house      The room has a house flag
   room.norecall   The room has a recall flag
   room.nosummon   The room has a nosummon flag
   room.crimeok    The room has a crimeok flag
   room.store      The room has a store flag

resist(resist name)
   Valid values for "resist name" are below
       fire       cold         elec         energy
       blunt      pierce       slash        acid
       poison     drain        sleep        charm
       hold       non_magic    radiation    sun
       earth      water        psychic      sonic
       disease    holy         shadow       wind
       moon

See also: VARIABLES, ROOM VARIABLES, OBJECT VARIABLES, SPECIAL VARIABLES