spell
spell <creature> <int level> <spell-name>
Cast a spell on a creature at a given level.
The spell takes effect as if cast at <level>. When the owner is a
mobile it is the caster; from a room or object script the target casts the
spell on itself (a caster is required).
Arguments
<creature>— the target of the spell.<int level>— the caster level. It is capped at the system maximum; a level above the cap is a run-time error.<spell-name>— the spell to cast, named as a string (for examplearmor,"cure light"). An unrecognized name is a run-time error.
Returns
null. Like the other action commands, a
successful spell in the handle phase suppresses the event's default
action.
Examples
after command (say) {
spell $actor 10 armor
}
The mob casts armor on the actor at level 10. The script compiles and runs to completion (the spell's full effect depends on the target and the world state).
handle command (quest) {
spell $actor 30 "cure light"
}
When someone uses the quest command, the owner casts cure light on
them.
See also
damage— apply raw damage of a named type without a full spell cast.giveexp— grant experience.- Strings and interpolation · Handlers, events, and phases