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

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