ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]
:toc: left
:toclevels: 5

= Mission

This module adds a simple mission system.

== Extension

=== User

[source,lua]
----
self.mission
self.mission_step

-- start a mission for a player
--- mission: 
---- name: mission name
---- steps: ordered list of
----- text: (html)
----- position: {x,y,z}
----- radius: (optional) area radius (affect default PoI)
----- height: (optional) area height (affect default PoI)
----- onenter: see Map.User:setArea
----- onleave: (optional) see Map.User:setArea
----- map_entity: (optional) a simple PoI by default
User:startMission(mission)

-- end the current player mission step
User:nextMissionStep()

-- stop the player mission
User:stopMission()

-- check if the player has a mission
User:hasMission()
----

=== Server

[source,lua]
----
self.cfg
----

.Events
[horizontal]
`playerMissionStart(user)`:: called when the player start a mission (the mission data is attached to the player at the beginning of the call)
`playerMissionStep(user)`:: called when the player start a new mission step
`playerMissionStop(user)`:: called when the player stop the mission (the mission data is still attached to the player at the beginning of the call)
