Skip to content

Instantly share code, notes, and snippets.

@Ruin0x11
Last active June 1, 2018 04:33
Show Gist options
  • Save Ruin0x11/01250844804d3d015590f78753d99aef to your computer and use it in GitHub Desktop.
Save Ruin0x11/01250844804d3d015590f78753d99aef to your computer and use it in GitHub Desktop.
local Chara = Elona.require("Chara")
local Event = Elona.require("Event")
local Iter = Elona.require("Iter")
local Map = Elona.require("Map")
local function setup()
local player_pos = Chara.player().position
for pos in Iter.rectangle_iter(player_pos.x - 1, player_pos.y - 1,
player_pos.x + 1, player_pos.y + 1) do
if not (pos.x == player_pos.x and pos.y == player_pos.y) then
local chara = Chara.create(pos.x, pos.y, 249)
assert(chara:recruit_as_ally())
end
end
for i=0, 100 do
Chara.create(Map.random_pos(), 229)
end
end
Event.register(Event.EventKind.MapInitialized, setup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment