2016-03-12 02:54:03 -05:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TeleportCommand Script
|
|
|
|
|
|
|
|
Functions:
|
|
|
|
|
|
|
|
eventRegion(numAnima)
|
|
|
|
eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6)
|
|
|
|
eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
|
|
|
|
|
2016-06-19 18:52:34 -04:00
|
|
|
--]]
|
2016-03-12 02:54:03 -05:00
|
|
|
|
2016-06-19 18:52:34 -04:00
|
|
|
require ("global")
|
2016-03-12 02:54:03 -05:00
|
|
|
|
2016-03-20 21:19:40 -04:00
|
|
|
function onEventStarted(player, actor, triggerName, isTeleport)
|
2017-05-01 22:30:43 -04:00
|
|
|
|
|
|
|
local worldMaster = GetWorldMaster();
|
|
|
|
|
2016-06-19 18:52:34 -04:00
|
|
|
if (isTeleport == 0) then
|
|
|
|
while (true) do
|
|
|
|
regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", 100);
|
|
|
|
|
|
|
|
if (regionChoice == nil) then break end
|
|
|
|
|
|
|
|
while (true) do
|
|
|
|
aetheryteChoice = callClientFunction(player, "delegateCommand", actor, "eventAetheryte", regionChoice, 2, 2, 2, 4, 4, 4);
|
|
|
|
|
|
|
|
if (aetheryteChoice == nil) then break end
|
|
|
|
|
2017-05-01 22:30:43 -04:00
|
|
|
player:PlayAnimation(0x4000FFA);
|
|
|
|
player:SendGameMessage(worldMaster, 34101, 0x20, 2, 0x13883d, 100, 100);
|
|
|
|
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
|
2016-06-19 18:52:34 -04:00
|
|
|
if (confirmChoice == 1) then
|
2017-05-01 22:30:43 -04:00
|
|
|
player:PlayAnimation(0x4000FFB);
|
|
|
|
player:SendGameMessage(worldMaster, 34105, 0x20);
|
|
|
|
--Do teleport
|
2016-06-19 18:52:34 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
player:endEvent();
|
|
|
|
return;
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2016-03-12 02:54:03 -05:00
|
|
|
else
|
2017-05-01 22:30:43 -04:00
|
|
|
player:PlayAnimation(0x4000FFA);
|
|
|
|
local choice, wasMulti = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
|
|
|
|
if (wasMulti and choice == 1 or choice == 2) then
|
|
|
|
player:PlayAnimation(0x4000FFB);
|
|
|
|
player:SendGameMessage(worldMaster, 34104, 0x20);
|
|
|
|
--Do return
|
|
|
|
elseif (not wasMulti and choice == 1) then
|
|
|
|
player:PlayAnimation(0x4000FFB);
|
|
|
|
player:SendGameMessage(worldMaster, 34104, 0x20);
|
|
|
|
--Do return
|
|
|
|
end
|
2016-06-19 18:52:34 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
player:endEvent();
|
2017-05-01 22:30:43 -04:00
|
|
|
end
|