Arenas
constArenas:object
Defined in: server/api.d.ts:3259
The Overland’s combat arenas (the game’s Combat Challenges), run on the server so every player fights the same waves. Arenas.start loads the arena’s walls and cover for every client near it, then spawns its five waves and their reinforcements as shared NPCs. Independent of World.setEncounterPolicy: the game’s own arena spawner never runs, and the totem that would start it locally is removed. Events: arenaStarted, arenaWaveStarted, arenaWaveCleared, arenaCompleted, arenaEnded.
Type Declaration
Section titled “Type Declaration”enabled
Section titled “enabled”
readonlyenabled:boolean
Whether arenas can run. Default true.
get(
id): {id:string;killed:number;npcs:NPC[];players:Player[];radius:number;reward:string;state:"idle"|"starting"|"wave"|"intermission"|"completed";total:number;wave:number;waves:number;x:number;y:number;z:number; } |null
One arena, or null for an unknown id.
Parameters
Section titled “Parameters”string
An arena id from getAll.
Returns
Section titled “Returns”{ id: string; killed: number; npcs: NPC[]; players: Player[]; radius: number; reward: string; state: "idle" | "starting" | "wave" | "intermission" | "completed"; total: number; wave: number; waves: number; x: number; y: number; z: number; } | null
getAll()
Section titled “getAll()”getAll():
object[]
Every arena. x/y/z is its centre and radius how far from it a player counts as in it. wave is the current one, 0 before the first; killed and total count its enemies, reinforcements included. npcs are the live enemies and players those in the arena. reward is the item the game grants for completing it.
Returns
Section titled “Returns”object[]
getRewardPolicy()
Section titled “getRewardPolicy()”getRewardPolicy():
object
What arena enemies pay, with the server default and built-in values filled in.
Returns
Section titled “Returns”object
experience
Section titled “experience”experience:
number
gameReward
Section titled “gameReward”gameReward:
boolean
loot:
object[] |null
lootDelivery
Section titled “lootDelivery”lootDelivery:
"drop"|"inventory"
lootMode
Section titled “lootMode”lootMode:
"each"|"shared"
radius
Section titled “radius”radius:
number
recipients
Section titled “recipients”recipients:
"killer"|"damagers"|"nearby"
setEnabled()
Section titled “setEnabled()”setEnabled(
enabled):void
Off ends every running arena and refuses start; camps and world events are unaffected.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setRewardPolicy()
Section titled “setRewardPolicy()”setRewardPolicy(
policy):void
Sets what arena enemies pay when they die (see NPC.setRewardPolicy), on their live NPCs and on every one spawned after. Throws a TypeError or RangeError for a malformed policy.
Parameters
Section titled “Parameters”policy
Section titled “policy”{ experience?: number; gameReward?: boolean; loot?: object[] | null; lootDelivery?: "drop" | "inventory"; lootMode?: "each" | "shared"; radius?: number; recipients?: "killer" | "damagers" | "nearby"; } | null
Fields left out come from NPC.setDefaultRewardPolicy; null clears it.
Returns
Section titled “Returns”void
start()
Section titled “start()”start(
id):boolean
Starts an arena: nearby clients load it, and the first wave is announced 5 s later. It runs until its last wave is cleared, or ends once nobody has been in it for 20 s.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
False for an unknown or running arena, or while arenas are disabled.
stop()
Section titled “stop()”stop(
id):boolean
Ends a running arena now and despawns its enemies.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
False when it is not running.