forgottenserver/data/scripts/talkactions/force_event.lua
Ranieri Althoff 46e2b7a47f
Move raid system to globalevents (#1813)
* Drop raids in C++ in favor of Lua global events

- Move raids to globalevents, create Lua interface
- Move force raid command to talkaction
- Create example raid as globalevent
- Add Lua interface to execute timed GlobalEvents
2023-12-12 22:09:44 -03:00

25 lines
551 B
Lua

local talk = TalkAction("/event", "!event")
function talk.onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
return false
end
logCommand(player, words, param)
local returnValue = Game.startEvent(param)
if returnValue == nil then
player:sendTextMessage(MESSAGE_INFO_DESCR, "No such event exists.")
return false
end
player:sendTextMessage(MESSAGE_INFO_DESCR, "Event started.")
return returnValue
end
talk:separator(" ")
talk:register()