class

class <creature>

The class name of a creature.

For a player this is their chosen class; for an NPC it is the mobile's class slot (often the literal Mobile).

Arguments

Returns

A string — the class name (for example Mobile, Mage, Cleric).

Examples

after command (say) {
  do "say You are a [class $actor]."
}

When the actor is the mob Puff, [class $actor] evaluates to Mobile, and the mob says "You are a Mobile."

Because the result is a string, compare it case-insensitively with streqi:

before command (enter) {
  require [streqi [class $actor] "Mage"]
}

This guard lets the handler run only for mages; otherwise the script advances to the next matching handler (see require).

See also