Manual:DIL Manual/UNIT ST PC

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:24, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

UNIT_ST_PC

Constant (integer, vme.h: 0x02).

A player character. u.type == UNIT_ST_PC is true for a player, also one who is switched into a monster (the monster itself stays UNIT_ST_NPC). The type of a unit is in its type field; the four unit types are bits, so they can be combined with |.

Fields

Players have the fields of all characters (see UNIT_ST_PC and UNIT_ST_NPC) and these, which only players have: acc_balance, acc_total, ability_costs, ability_levels, ability_points, birth, crimes, drunk, editing, full, guild, hometown, idx, info, lastroom, lifespan, pcflags, playtime, profession, prompt, quests, skill_costs, skill_levels, skill_points, skills, spell_costs, spell_levels, thirst, vlevel, weapon_costs, weapon_levels.

Notes

Example

dilbegin hungry(pc : unitptr);
code
{
   if (pc.type != UNIT_ST_PC)
      return;
   if (pc.full < 4)
      sendtext("Your stomach rumbles.<br/>", pc);
   return;
}
dilend

Tells a player who is getting hungry; full exists only on players.

See also