mobflag
mobflag <+|-> <flags>
Set or clear NPC action flags on the owner mobile.
Action flags control a mob's standing behavior — whether it stands guard,
attacks on sight, helps its allies, picks up loot, and so on. mobflag
toggles those flags on the owner at run time, letting a script change how
the mob behaves from then on.
Arguments
<+|->— a string:+sets (turns on) the flags,-clears them.<flags>— a string of one or more space-separated flag names, for examplesentinel,aggressive,scavenger,wimpy, orhelper. Names are matched case-insensitively; unrecognized names are ignored.
A few structural flags cannot be changed this way (special, the
is-NPC marker, and pet); attempts to set or clear them are silently
dropped.
Returns
null. Like the other action commands, a
successful mobflag in the handle phase suppresses the event's default
action.
Owner
The owner must be a mobile. For any other owner the command does nothing.
Examples
after command (say) {
mobflag + sentinel
}
This makes the owner a sentinel, so it stops wandering and stays put.
Clear flags with -, and list several at once:
after command (say) {
mobflag - "aggressive wimpy"
}
This turns off both the aggressive and wimpy behaviors in one call.
See also
ldesc— change the line others see the mob standing in.ismob— test whether a creature is an NPC.- Handlers, events, and phases