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
<creature>— the creature to receive the experience.<int>— the amount of experience to grant. Very large awards are logged to the zone error log.
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
damage,spell— other creature-affecting actions.level— read a creature's current level.- Handlers, events, and phases