Lua API

World module

Functions for working with the state of the game world.

Usage

local World = ELONA.require("core.World")

Functions

deferred_event_id () Gets the ID of the next deferred event that will run.
add_deferred_event (event_id[, param1][, param2]) Adds a deferred event.
belongs_to_guild (guild_name) Returns true if the player is part of the provided guild.
join_guild (guild_name) Sets the player's guild affiliation and resets guild quotas.
ranking_title (ranking_id) Returns the player's title for the given ranking.
modify_ranking (ranking_id, amount, min) Modifies the player's rank in a given ranking.
random_title (The) Generates a random title.

Fields

data [R] Data for the current game save.

Functions

# deferred_event_id ()

Gets the ID of the next deferred event that will run.

Returns:
  • (num)
# add_deferred_event (event_id[, param1][, param2])

Adds a deferred event.

Parameters:
  • event_id : (num) the event id
  • param1 : (num) An extra parameter. (optional)
  • param2 : (num) An extra parameter. (optional)
# belongs_to_guild (guild_name)

Returns true if the player is part of the provided guild.

Parameters:
  • guild_name : (string) One of "mages", "fighters" or "thieves"
# join_guild (guild_name)

Sets the player's guild affiliation and resets guild quotas.

Parameters:
  • guild_name : (string) One of "mages", "fighters" or "thieves"
# ranking_title (ranking_id)

Returns the player's title for the given ranking.

Parameters:
  • ranking_id : (num)
# modify_ranking (ranking_id, amount, min)

Modifies the player's rank in a given ranking.

Parameters:
  • ranking_id : (num)
  • amount : (num)
  • min : (num)
# random_title (The)

Generates a random title.

Parameters:

Fields

# data

[R] Data for the current game save.