giveexp

giveexp <creature> <int>

Grant experience to a creature.

The creature gains the given amount of experience, which may trigger the normal level-gain behavior. A negative amount removes experience.

Arguments

Returns

null. Like the other action commands, a successful giveexp in the handle phase suppresses the event's default action.

Examples

after command (say) {
  giveexp $actor 100
}

The actor gains 100 experience. The script compiles and runs to completion.

handle command (quest) {
  require [isplayer $actor]
  giveexp $actor 5000
  do "say Well done, $actor."
}

A quest reward: only players receive the experience (see require and isplayer), and the owner congratulates the actor.

See also