1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-21 15:37:46 +00:00
kawari/resources/scripts/commands/debug/Festival.lua
thedax 961cb92ab1
New Lua command proposal: !festival (#26)
This command enables the user to set the current zone's festival.
For example, you can toggle the Starlight festival in any of the starting cities.

Thanks, OTCompa!
2025-06-19 12:29:10 -04:00

35 lines
993 B
Lua

-- A list of festival ids can be found in Hyperborea's source tree:
-- https://github.com/kawaii/Hyperborea/blob/main/Hyperborea/festivals.yaml
function onCommand(args, player)
local parts = split(args)
local argc = table.getn(parts)
local usage = "\nUsage: !festival <id1> <id2> <id3> <id4>"
local sender = "[festival] "
local id1 = tonumber(parts[1])
local id2 = tonumber(parts[2])
local id3 = tonumber(parts[3])
local id4 = tonumber(parts[4])
if not id1 then
player:send_message(sender.."At least one festival must be specified (for now, until the server has support for commands with no args)."..usage)
return
end
if not id2 then
id2 = 0
end
if not id3 then
id3 = 0
end
if not id4 then
id4 = 0
end
player:set_festival(id1, id2, id3, id4)
local message = string.format("Festival(s) changed to %s, %s, %s and %s.", id1, id2, id3, id4)
player:send_message(message)
end