1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 11:47:48 +00:00
project-meteor-server/data/scripts/commands/TeleportCommand.lua

51 lines
1.2 KiB
Lua
Raw Normal View History

--[[
TeleportCommand Script
Functions:
eventRegion(numAnima)
eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6)
eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
Menu Ids:
Region Menu: 0
Aetheryte Menu: 1
Confirm Menu: 2
--]]
function onEventStarted(player, actor, triggerName, isTeleport)
if (isTeleport == 0) then
2016-06-15 03:41:23 +01:00
player:SetCurrentMenuId(0);
player:RunEventFunction("delegateCommand", actor, "eventRegion", 100);
else
2016-06-15 03:41:23 +01:00
player:SetCurrentMenuId(2);
player:RunEventFunction("delegateCommand", actor, "eventConfirm", true, false, 1, 0x138824, false);
end
end
function onEventUpdate(player, actor, step, arg1)
2016-06-15 03:41:23 +01:00
menuId = player:GetCurrentMenuId();
if (menuId == 0) then --Region
if (arg1 ~= nil and arg1 >= 1) then
2016-06-15 03:41:23 +01:00
player:SetCurrentMenuId(1);
player:RunEventFunction("delegateCommand", actor, "eventAetheryte", arg1, 2, 2, 2, 4, 4, 4);
else
2016-06-15 03:41:23 +01:00
player:EndCommand();
end
elseif (menuId == 1) then --Aetheryte
if (arg1 == nil) then
2016-06-15 03:41:23 +01:00
player:EndCommand();
return;
end
2016-06-15 03:41:23 +01:00
player:SetCurrentMenuId(2);
player:RunEventFunction("delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
elseif (menuId == 2) then --Confirm
2016-06-15 03:41:23 +01:00
player:EndCommand();
end
end